allow using a single string as an ingredient instead of a dict

This commit is contained in:
Emi Vasilek 2023-11-28 12:28:52 +00:00
parent 072aa03a53
commit 883f0756f9
5 changed files with 59 additions and 17 deletions

View file

@ -13,17 +13,22 @@
"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" }
}
"oneOf": [
{ "type": "string" },
{
"$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": {