144 lines
5.8 KiB
JSON
144 lines
5.8 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://recipes.uuard.com/schemas/v2/recipe.schema.json",
|
|
"title": "Canonical recipe",
|
|
"type": "object",
|
|
"required": ["schema_version", "id", "revision", "status", "title", "yield", "components", "steps", "categories", "tags"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"schema_version": { "$ref": "common.schema.json#/$defs/schemaVersion" },
|
|
"id": { "$ref": "common.schema.json#/$defs/id" },
|
|
"revision": { "$ref": "common.schema.json#/$defs/revision" },
|
|
"status": { "type": "string", "enum": ["draft", "testing", "active", "retired", "archived"] },
|
|
"title": { "$ref": "common.schema.json#/$defs/nonEmptyString" },
|
|
"summary": { "type": "string" },
|
|
"categories": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/nonEmptyString" }, "uniqueItems": true },
|
|
"tags": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/nonEmptyString" }, "uniqueItems": true },
|
|
"yield": {
|
|
"type": "object",
|
|
"required": ["amount"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"amount": { "$ref": "common.schema.json#/$defs/amount" },
|
|
"servings": { "$ref": "common.schema.json#/$defs/positiveDecimal" },
|
|
"serving_size": { "$ref": "common.schema.json#/$defs/amount" },
|
|
"description": { "type": "string" },
|
|
"yield_factor": { "type": "number", "exclusiveMinimum": 0 },
|
|
"basis": { "type": "string", "enum": ["measured", "estimated", "theoretical"] }
|
|
}
|
|
},
|
|
"scaling": {
|
|
"type": "object",
|
|
"required": ["mode"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"mode": { "type": "string", "enum": ["amount", "percentage", "hybrid"] },
|
|
"basis_id": { "$ref": "common.schema.json#/$defs/id" },
|
|
"basis_amount": { "$ref": "common.schema.json#/$defs/amount" }
|
|
}
|
|
},
|
|
"components": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"items": {
|
|
"type": "object",
|
|
"required": ["id", "name", "items"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"id": { "$ref": "common.schema.json#/$defs/id" },
|
|
"name": { "$ref": "common.schema.json#/$defs/nonEmptyString" },
|
|
"yield": { "$ref": "common.schema.json#/$defs/amount" },
|
|
"items": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"items": { "$ref": "#/$defs/componentItem" }
|
|
},
|
|
"notes": { "type": "array", "items": { "type": "string" } }
|
|
}
|
|
}
|
|
},
|
|
"steps": {
|
|
"type": "array",
|
|
"minItems": 1,
|
|
"items": {
|
|
"type": "object",
|
|
"required": ["id", "order", "instruction"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"id": { "$ref": "common.schema.json#/$defs/id" },
|
|
"order": { "type": "integer", "minimum": 1 },
|
|
"instruction": { "$ref": "common.schema.json#/$defs/nonEmptyString" },
|
|
"component_ids": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/id" }, "uniqueItems": true },
|
|
"item_ids": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/id" }, "uniqueItems": true },
|
|
"equipment_ids": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/id" }, "uniqueItems": true },
|
|
"duration": { "$ref": "common.schema.json#/$defs/amount" },
|
|
"temperature": { "$ref": "common.schema.json#/$defs/amount" },
|
|
"critical_control_point": { "type": "boolean" }
|
|
}
|
|
}
|
|
},
|
|
"equipment_ids": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/id" }, "uniqueItems": true },
|
|
"shelf_life": {
|
|
"type": "object",
|
|
"required": ["duration"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"duration": { "$ref": "common.schema.json#/$defs/amount" },
|
|
"storage_condition": { "$ref": "common.schema.json#/$defs/nonEmptyString" },
|
|
"notes": { "type": "string" }
|
|
}
|
|
},
|
|
"media": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/media" } },
|
|
"notes": { "type": "array", "items": { "type": "string" } },
|
|
"extensions": { "type": "object", "additionalProperties": true }
|
|
},
|
|
"$defs": {
|
|
"componentItem": {
|
|
"type": "object",
|
|
"required": ["id", "reference", "amount"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"id": { "$ref": "common.schema.json#/$defs/id" },
|
|
"reference": {
|
|
"oneOf": [
|
|
{
|
|
"type": "object",
|
|
"required": ["ingredient_id"],
|
|
"additionalProperties": false,
|
|
"properties": { "ingredient_id": { "$ref": "common.schema.json#/$defs/id" } }
|
|
},
|
|
{
|
|
"type": "object",
|
|
"required": ["recipe_id"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"recipe_id": { "$ref": "common.schema.json#/$defs/id" },
|
|
"revision": { "$ref": "common.schema.json#/$defs/revision" },
|
|
"component_id": { "$ref": "common.schema.json#/$defs/id" }
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"amount": { "$ref": "common.schema.json#/$defs/amount" },
|
|
"percentage": { "type": "number", "minimum": 0 },
|
|
"basis_member": { "type": "boolean" },
|
|
"prep": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"required": ["action_id"],
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"action_id": { "$ref": "common.schema.json#/$defs/id" },
|
|
"yield_factor": { "type": "number", "exclusiveMinimum": 0, "maximum": 1 },
|
|
"notes": { "type": "string" }
|
|
}
|
|
}
|
|
},
|
|
"optional": { "type": "boolean", "default": false },
|
|
"notes": { "type": "string" }
|
|
}
|
|
}
|
|
}
|
|
}
|