Currently the Schema
definition is not documented at all, the only resources i could find are these:
http://support.apiary.io/knowledgebase/articles/147279-json-schema-validation https://github.com/apiaryio/api-blueprint/issues/112
but none of those examples discuss how to create nested schema.
I would like to validate this response:
{
date: (datetime),
url: (url),
changes: [
{
date: (datetime),
url: (url)
},
...
],
items: [
{
name: (string),
url: (url)
},
...
]
}
based on my current knowledge, i've started to create schema what looks like this
{
"type": "object",
"required": true,
"properties": {
"date": {
"type": "datetime",
"required": true
},
"url": {
"type": "string",
"required": true
},
"changes": {
"type": "array",
"required": true
},
"items": {
"type": "array",
"required": true
}
}
}
but how to create schema for nested item
and change
?
what types can i use?
how to validate datetime
? expected value is YYYY-MM-DD HH:MM:SS