{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tinyplates-dev/json-schema/tinyplates-dev-shopping-item-schema.json",
  "title": "ShoppingItem",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tinyplates-dev-openapi.json#/components/schemas/ShoppingItem",
  "type": "object",
  "required": [
    "category",
    "display",
    "name",
    "recipeIds"
  ],
  "properties": {
    "category": {
      "type": "string",
      "enum": [
        "bakery",
        "dairy",
        "drinks",
        "frozen",
        "meat",
        "other",
        "pantry",
        "produce",
        "seafood",
        "spices"
      ],
      "description": "The aisle to find it in."
    },
    "display": {
      "type": "string",
      "description": "The line as a reader would write it, such as \"6 onion\"."
    },
    "extras": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Quantity"
      },
      "description": "Amounts a recipe asked for in a unit this line's own cannot take, one per unit: \"1 cup\" with a note of \"plus 3 tbsp\" is \"1 cup + 3 tbsp\". Buy them as well as the quantity."
    },
    "name": {
      "type": "string"
    },
    "plusMore": {
      "type": "boolean",
      "description": "A recipe also asked for this without saying how much — oil for frying, a garnish — so the quantity is a minimum rather than the whole of it."
    },
    "quantity": {
      "$ref": "#/$defs/Quantity"
    },
    "recipeIds": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The recipes that asked for it."
    }
  },
  "additionalProperties": false,
  "$defs": {
    "NonNegative": {
      "type": "number",
      "description": "a non-negative number",
      "title": "nonNegative",
      "minimum": 0
    },
    "Quantity": {
      "type": "object",
      "required": [
        "value"
      ],
      "properties": {
        "max": {
          "$ref": "#/$defs/NonNegative"
        },
        "unit": {
          "$ref": "#/$defs/Unit"
        },
        "value": {
          "$ref": "#/$defs/NonNegative"
        }
      },
      "additionalProperties": false
    },
    "Unit": {
      "type": "string",
      "enum": [
        "g",
        "kg",
        "lb",
        "oz",
        "cl",
        "cup",
        "dl",
        "fl-oz",
        "gallon",
        "l",
        "ml",
        "pint",
        "quart",
        "tbsp",
        "tsp",
        "bag",
        "bottle",
        "box",
        "bunch",
        "can",
        "clove",
        "cube",
        "dash",
        "drop",
        "ear",
        "handful",
        "head",
        "jar",
        "knob",
        "leaf",
        "package",
        "packet",
        "piece",
        "pinch",
        "portion",
        "pot",
        "scoop",
        "sheet",
        "shot",
        "slice",
        "sprig",
        "stalk",
        "stick",
        "tub",
        "cm",
        "inch"
      ]
    }
  }
}