Skip to content

Instantly share code, notes, and snippets.

@vasilkosturski
Created March 28, 2023 12:43
Show Gist options
  • Save vasilkosturski/18d6ad06150636326304551a1ebb52b8 to your computer and use it in GitHub Desktop.
Save vasilkosturski/18d6ad06150636326304551a1ebb52b8 to your computer and use it in GitHub Desktop.
Json schema
{
"title": "Root Schema",
"type": "object",
"default": {},
"required": [
"checked",
"dimensions",
"id",
"name",
"price",
"tags"
],
"properties": {
"checked": {
"title": "The checked Schema",
"type": "boolean",
"default": false,
"examples": [
false
]
},
"dimensions": {
"title": "The dimensions Schema",
"type": "object",
"default": {},
"required": [
"width",
"height"
],
"properties": {
"width": {
"title": "The width Schema",
"type": "integer",
"default": 0,
"examples": [
5
]
},
"height": {
"title": "The height Schema",
"type": "integer",
"default": 0,
"examples": [
10
]
}
},
"examples": [{
"width": 5,
"height": 10
}]
},
"id": {
"title": "The id Schema",
"type": "integer",
"default": 0,
"examples": [
1
]
},
"name": {
"title": "The name Schema",
"type": "string",
"default": "",
"examples": [
"A green door"
]
},
"price": {
"title": "The price Schema",
"type": "number",
"default": 0.0,
"examples": [
12.5
]
},
"tags": {
"title": "The tags Schema",
"type": "array",
"default": [],
"items": {
"title": "A Schema",
"type": "string",
"examples": [
"home",
"green"
]
},
"examples": [
["home",
"green"
]
]
}
},
"examples": [{
"checked": false,
"dimensions": {
"width": 5,
"height": 10
},
"id": 1,
"name": "A green door",
"price": 12.5,
"tags": [
"home",
"green"
]
}]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment