Last active
June 30, 2016 17:07
-
-
Save Sequoia/d86032bff4413759c2f27e9cf852817b to your computer and use it in GitHub Desktop.
This file contains 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
{ | |
"$schema" : "http://json-schema.org/draft-04/schema#", | |
"id": "https://gist.githubusercontent.com/Sequoia/d86032bff4413759c2f27e9cf852817b/raw/demo-schema.json", | |
"title": "More than one type", | |
"description": "This schema has a single property with multiple types", | |
"definitions" : { | |
"specialString" : { | |
"type" : "string", | |
"description": "(3) The String One!", | |
"enum" : ["yes", "no", "maybe"] | |
} | |
}, | |
"properties" :{ | |
"test" : { | |
"description": "a property that can be null, a string, or an object", | |
"anyOf" : [ | |
{ | |
"type" : "null", | |
"description": "(1) The Null One!" | |
}, | |
{ | |
"type" : "object", | |
"description": "(2) The Object One!", | |
"properties": { | |
"name" : { | |
"type": "string" | |
} | |
}, | |
"additionalProperties": false | |
}, | |
{ "$ref" : "#/definitions/specialString" } | |
] | |
} | |
} | |
} |
This file contains 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
{ | |
"$schema" : "https://gist.githubusercontent.com/Sequoia/d86032bff4413759c2f27e9cf852817b/raw/demo-schema.json", | |
"test": { | |
"badProperty" : "foo", | |
"should say 'bad property!' not prompt me to make type null" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment