commit | c88068c3f4e947ad4cebc5e7d921e2522095c933 | [log] [tgz] |
---|---|---|
author | sigu-399 <sigu.399@gmail.com> | Sat Jun 29 23:28:20 2013 +0800 |
committer | sigu-399 <sigu.399@gmail.com> | Sat Jun 29 23:28:20 2013 +0800 |
tree | ad1692eec4c6da97cd99bc1e6432d416b57fb0b7 | |
parent | 444226962080b8c3988c40a3eb0a12e05b3b57e4 [diff] |
fixed isFloat64AnInteger : now handles 64 bits int and uint values
An implementation of JSON Schema, based on IETF's draft v4 - Go language
Functional, two features are missing : dependencies as schemas and id(s) as scope for references
Test phase : Passed 97% of Json Schema Test Suite
Internal improvements/refactoring in progress, anyway the interface will not change
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 :