commit | 63ea5549f9f5ca4801341534879170616c926da5 | [log] [tgz] |
---|---|---|
author | sigu-399 <sigu.399@gmail.com> | Sat Jun 22 03:32:55 2013 +0800 |
committer | sigu-399 <sigu.399@gmail.com> | Sat Jun 22 03:32:55 2013 +0800 |
tree | 4bc3bc669dc02882e029540f4d14311d7dd5b3d9 | |
parent | 7ce29a191efe3f6e0014531eaa28bc97b05bac31 [diff] |
fixed addtionalProperties and patternProperties interaction
An implementation of JSON Schema, based on IETF's draft v4 - Go language
Working, but not all keyword are yet implemented.
What is missing : definitions, dependencies
Testing / debugging / improvements in progress ( Passed 91% of Json Schema Test Suite )
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
https://github.com/sigu-399/gojsonpointer
https://github.com/sigu-399/gojsonreference
gojsonschema uses the following test suite :