typescript-json-schema
Version:
typescript-json-schema generates JSON Schema files from your Typescript sources
34 lines (33 loc) • 739 B
JSON
{
"type": "array",
"items": {
"anyOf": [
{
"$ref": "#/definitions/MyObject"
},
{
"type": "string"
}
]
},
"definitions": {
"MyObject": {
"type": "object",
"properties": {
"array": {
"type": "array",
"items": {
"type": [
"string",
"number"
]
}
}
},
"required": [
"array"
]
}
},
"$schema": "http://json-schema.org/draft-04/schema#"
}