typescript-json-schema
Version:
typescript-json-schema generates JSON Schema files from your Typescript sources
41 lines (40 loc) • 959 B
JSON
{
"type": "object",
"properties": {
"list": {
"type": "array",
"items": {
"$ref": "#/definitions/MySubObject"
}
},
"sub1": {
"$ref": "#/definitions/MySubObject"
},
"sub2": {
"$ref": "#/definitions/MySubObject",
"description": "Property-level description",
"additionalProperties": false
}
},
"required": [
"list",
"sub1",
"sub2"
],
"definitions": {
"MySubObject": {
"description": "Type-level description",
"additionalProperties": true,
"type": "object",
"properties": {
"value": {
"type": "string"
}
},
"required": [
"value"
]
}
},
"$schema": "http://json-schema.org/draft-04/schema#"
}