Created
June 23, 2014 03:07
-
-
Save binary132/1d6475b3f4da969d5383 to your computer and use it in GitHub Desktop.
A failing gojsonschema example.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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