commit | 59c48f173167bb4e411bd85d92dad6db3d66824b | [log] [tgz] |
---|---|---|
author | sigu-399 <sigu.399@gmail.com> | Tue Jun 18 18:25:03 2013 +0800 |
committer | sigu-399 <sigu.399@gmail.com> | Tue Jun 18 18:25:03 2013 +0800 |
tree | be0e8e859b41f14e79108d4d8bb6f4007d159119 | |
parent | 8cb546d909e14767b846d2dbfe97d8a984cb78c8 [diff] |
fixes according to json test suite results
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