Skip to content

Instantly share code, notes, and snippets.

@zakgrant
Created July 1, 2013 11:15
Show Gist options
  • Save zakgrant/5900025 to your computer and use it in GitHub Desktop.
Save zakgrant/5900025 to your computer and use it in GitHub Desktop.
This is how to represent an object that can have multiple types within a JSON Schema
{
"$schema": "http://json-schema.org/draft-03/schema#",
"type": [
{
"type": "number",
"minimum": 0,
"exclusiveMinimum": true
},
{
"type": "string",
"pattern": "^.+@.+\\..+$"
}
]
}
@zakgrant
Copy link
Author

zakgrant commented Jul 2, 2013

@geraintluff thanks for your input, that is more intuitive especially in this context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment