Skip to content

Instantly share code, notes, and snippets.

@binary132
Created June 23, 2014 03:07
Show Gist options
  • Save binary132/1d6475b3f4da969d5383 to your computer and use it in GitHub Desktop.
Save binary132/1d6475b3f4da969d5383 to your computer and use it in GitHub Desktop.
A failing gojsonschema example.
package main
import "github.com/xeipuuv/gojsonschema"
func main() {
testMap := map[string]interface{}{
"title": "Example Schema",
"type": "object",
"properties": map[string]interface{}{
"firstName": map[string]interface{}{
"type": "string",
},
"lastName": map[string]interface{}{
"type": "string",
},
"age": map[string]interface{}{
"description": "Age in years",
"type": "integer",
"minimum": 0,
},
},
"required": []interface{}{"firstName", "lastName"},
}
_, err := gojsonschema.NewJsonSchemaDocument(testMap)
if err != nil {
panic(err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment