restructure

This commit is contained in:
Emi Vasilek 2023-11-19 00:18:12 +01:00
parent 9e44070fe7
commit 81fdafb907
13 changed files with 376 additions and 366 deletions

View file

@ -0,0 +1,47 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://example.com/ingredients.json",
"title": "Ingredients",
"description": "Ingredients",
"type": "array",
"items": {
"type": "object",
"required": [ "name" ],
"additionalProperties": false,
"properties": {
"name": { "type": "string" },
"wdid": { "type": "integer" },
"prices": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [ "price", "amount", "unit" ],
"properties": {
"price": { "type": "number" },
"amount": { "type": "number" },
"unit": { "type": "string" },
"currency": { "type": "string" }
}
}
},
"conversions": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [ "from", "to", "ratio" ],
"properties": {
"from": { "type": "string" },
"to": { "type": "string" },
"ratio": { "type": "number" }
}
}
},
"aliases": {
"type": "array",
"items": { "type": "string" }
}
}
}
}

View file

@ -0,0 +1,36 @@
{
"$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" },
"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": { "type": "string" }
},
"subrecipes": {
"type": "array",
"items": { "$ref": "/recipe.json" }
}
}
}

View file

@ -0,0 +1,11 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://example.com/settings.json",
"title": "Settings",
"description": "Settings",
"type": "object",
"additionalProperties": false,
"properties": {
"default_currency": { "type": "string" }
}
}

View file

@ -0,0 +1,31 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://example.com/units.json",
"title": "Units",
"description": "Units",
"type": "array",
"items": {
"type": "object",
"required": [ "name" ],
"additionalProperties": false,
"properties": {
"name": { "type": "string" },
"conversions": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": [ "to", "ratio" ],
"properties": {
"to": { "type": "string" },
"ratio": { "type": "integer" }
}
}
},
"aliases": {
"type": "array",
"items": { "type": "string" }
}
}
}
}