commit | ddef12e7760df910067fb19fd941d508a650838d | [log] [tgz] |
---|---|---|
author | sigu-399 <sigu.399@gmail.com> | Sun Jun 23 21:49:10 2013 +0800 |
committer | sigu-399 <sigu.399@gmail.com> | Sun Jun 23 21:49:10 2013 +0800 |
tree | 62c0853b2fefce9660c25bf2b93e07787ac47b93 | |
parent | 14287b6c347e68579c90f2a8ff8847e3ee68c473 [diff] |
added remote files tests, updated base schemas for refRemote
An implementation of JSON Schema, based on IETF's draft v4 - Go language
Working, but not all keyword are yet implemented.
What is missing : dependencies as schemas
Testing / debugging / improvements in progress ( Passed 95% 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 :