54 lines
1.8 KiB
JSON
54 lines
1.8 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://example.com/recipe.json",
|
|
"title": "Recipe",
|
|
"description": "Recipe",
|
|
"type": "object",
|
|
"required": [ "title" ],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"title": { "type": "string" },
|
|
"description": { "type": "string" },
|
|
"source": { "type": "string" },
|
|
"ingredients": {
|
|
"type": "array",
|
|
"items": {
|
|
"$id": "https://example.com/ingredient.json",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [ "name" ],
|
|
"properties": {
|
|
"name": { "type": "string" },
|
|
"amount": { "type": "number" },
|
|
"unit": { "type": "string" },
|
|
"or": { "items": { "$ref": "/ingredient.json" } },
|
|
"note": { "type": "string" }
|
|
}
|
|
}
|
|
},
|
|
"steps": {
|
|
"type": "array",
|
|
"items": {
|
|
"oneOf": [
|
|
{ "type": "string" },
|
|
{
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [ "section" ],
|
|
"properties": {
|
|
"section": { "type": "string" },
|
|
"steps": {
|
|
"type": "array",
|
|
"items": {"type": "string"}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"subrecipes": {
|
|
"type": "array",
|
|
"items": { "$ref": "/recipe.json" }
|
|
}
|
|
}
|
|
}
|