commit | 68365e66074903538b29d912e67764ce87fad8e6 | [log] [tgz] |
---|---|---|
author | sigu-399 <sigu.399@gmail.com> | Tue Jun 18 19:30:40 2013 +0800 |
committer | sigu-399 <sigu.399@gmail.com> | Tue Jun 18 19:30:40 2013 +0800 |
tree | 11884e40b3adc21e0a90cf98bf581b9b636a25f0 | |
parent | f99c0fe6a0cd7e5ccad696df74a22f76463df531 [diff] |
generated missing json schema test suite files
An implementation of JSON Schema, based on IETF's draft v4 - Go language
Completed. Testing and debugging in progress ( 75% )
package main import ( "github.com/sigu-399/gojsonschema" "fmt" ) func main() { schema, err := gojsonschema.NewJsonSchemaDocument("http://myhost/bla/schema1.json") // OR //schema, err := gojsonschema.NewJsonSchemaDocument("file:///home/me/myschemas/schema1.json") if err != nil { panic(err.Error()) } jsonToValidate, err := gojsonschema.GetHttpJson("http://myotherhost/blu/extract56.json") // OR //jsonToValidate, err := gojsonschema.GetFileJson("file:///home/billy/hotels.json") if err != nil { panic(err.Error()) } validationResult := schema.Validate(jsonToValidate) fmt.Printf("IsValid %v\n", validationResult.IsValid()) fmt.Printf("%v\n", validationResult.GetErrorMessages()) }
###Website http://json-schema.org
###Schema Core http://json-schema.org/latest/json-schema-core.html
###Schema Validation http://json-schema.org/latest/json-schema-validation.html