Files
formulation/container/schemas/v2/ingredient.schema.json
T

82 lines
3.5 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://recipes.uuard.com/schemas/v2/ingredient.schema.json",
"title": "Canonical ingredient",
"type": "object",
"required": ["schema_version", "id", "name", "status", "categories"],
"additionalProperties": false,
"properties": {
"schema_version": { "$ref": "common.schema.json#/$defs/schemaVersion" },
"id": { "$ref": "common.schema.json#/$defs/id" },
"name": { "$ref": "common.schema.json#/$defs/nonEmptyString" },
"description": { "type": "string" },
"status": { "type": "string", "enum": ["active", "deprecated", "archived"] },
"categories": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/id" }, "uniqueItems": true },
"tags": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/nonEmptyString" }, "uniqueItems": true },
"aliases": {
"type": "array",
"items": {
"type": "object",
"required": ["name"],
"additionalProperties": false,
"properties": {
"name": { "$ref": "common.schema.json#/$defs/nonEmptyString" },
"language": { "type": "string" },
"region": { "type": "string" },
"kind": { "type": "string", "enum": ["common", "alternate_spelling", "trade", "search", "merged"] }
}
}
},
"default_purchase_item_id": { "$ref": "common.schema.json#/$defs/id" },
"density_measurements": {
"type": "array",
"items": {
"type": "object",
"required": ["id", "mass", "volume", "source"],
"additionalProperties": false,
"properties": {
"id": { "$ref": "common.schema.json#/$defs/id" },
"mass": { "$ref": "common.schema.json#/$defs/amount" },
"volume": { "$ref": "common.schema.json#/$defs/amount" },
"temperature_c": { "type": "number" },
"state": { "$ref": "common.schema.json#/$defs/nonEmptyString" },
"source": { "$ref": "common.schema.json#/$defs/sourceReference" }
}
}
},
"measure_conversions": {
"description": "Ingredient-specific measures such as a packed cup or one clove; these are not universal unit conversions.",
"type": "array",
"items": {
"type": "object",
"required": ["id", "from", "to", "source"],
"additionalProperties": false,
"properties": {
"id": { "$ref": "common.schema.json#/$defs/id" },
"from": { "$ref": "common.schema.json#/$defs/amount" },
"to": { "$ref": "common.schema.json#/$defs/amount" },
"state": { "type": "string" },
"source": { "$ref": "common.schema.json#/$defs/sourceReference" }
}
}
},
"prep_actions": {
"type": "array",
"items": {
"type": "object",
"required": ["action_id", "yield_factor"],
"additionalProperties": false,
"properties": {
"action_id": { "$ref": "common.schema.json#/$defs/id" },
"yield_factor": { "description": "Prepared output divided by raw input; may exceed 1 when hydration or cooking adds mass.", "type": "number", "exclusiveMinimum": 0 },
"notes": { "type": "string" }
}
}
},
"nutrition_mapping_ids": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/id" }, "uniqueItems": true },
"allergen_mapping_ids": { "type": "array", "items": { "$ref": "common.schema.json#/$defs/id" }, "uniqueItems": true },
"notes": { "type": "array", "items": { "type": "string" } },
"extensions": { "type": "object", "additionalProperties": true }
}
}