I\'m trying to create proper JSON Schema for menu with sub-menus. So I should define an array from item which should contain three items. 1 Display name, 2 URL and Children
use definitions and $ref.
Use this online json/schema editor to check your schema visually.
Paste the schema code to the Schema area and click Update Schema.
editor screenshot:
------------------>>>
schema code:
{
"definitions": {
"MenuItem": {
"title": "MenuItem",
"properties": {
"display_name": {
"type": "string",
"title": "Link display name",
"minLength": 2
},
"url": {
"type": "string",
"title": "URL address",
"minLength": 2
},
"children": {
"type": "array",
"title": "Children",
"items": {
"$ref": "#/definitions/MenuItem"
}
}
}
}
},
"title": "MenuItems",
"type": "array",
"items": {
"$ref": "#/definitions/MenuItem"
}
}