{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:folio:1:groceries",
  "title": "groceries.json",
  "description": "The grocery list. Only in full exports.",
  "type": "array",
  "items": {
    "type": "object",
    "required": [
      "id",
      "name",
      "aisle",
      "checked",
      "sources"
    ],
    "properties": {
      "id": {
        "type": "string",
        "minLength": 1
      },
      "foodId": {
        "type": [
          "string",
          "null"
        ],
        "description": "Null for an item typed in."
      },
      "text": {
        "type": [
          "string",
          "null"
        ],
        "description": "What was typed, for a typed item."
      },
      "name": {
        "type": "string"
      },
      "grams": {
        "type": [
          "number",
          "null"
        ],
        "minimum": 0
      },
      "ml": {
        "type": [
          "number",
          "null"
        ],
        "minimum": 0
      },
      "overrideGrams": {
        "type": [
          "number",
          "null"
        ],
        "minimum": 0,
        "description": "An amount the cook typed in place of the merged total."
      },
      "overrideMl": {
        "type": [
          "number",
          "null"
        ],
        "minimum": 0
      },
      "aisle": {
        "type": "string",
        "minLength": 1,
        "description": "Produce, Bakery, Meat & fish, Dairy & eggs, Grains & pasta, Tins & jars, Baking, Spices & oils, Frozen, Drinks or Other. Any other name is kept and listed after Drinks, alphabetically."
      },
      "checked": {
        "type": "boolean"
      },
      "createdAt": {
        "type": [
          "string",
          "null"
        ],
        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{1,9})?Z$",
        "description": "ISO 8601 in UTC with a Z, seconds required, fractions of a second optional (up to 9 digits): 2026-11-08T12:00:00Z."
      },
      "sources": {
        "type": "array",
        "items": {
          "type": "object",
          "required": [
            "recipeId",
            "title",
            "quantityText",
            "unit"
          ],
          "properties": {
            "recipeId": {
              "type": "string"
            },
            "title": {
              "type": "string"
            },
            "quantityText": {
              "type": "string"
            },
            "unit": {
              "type": "string"
            },
            "grams": {
              "type": [
                "number",
                "null"
              ],
              "minimum": 0
            },
            "ml": {
              "type": [
                "number",
                "null"
              ],
              "minimum": 0
            },
            "quantity": {
              "type": [
                "number",
                "null"
              ],
              "minimum": 0
            }
          },
          "description": "One recipe line this item came from."
        }
      }
    }
  }
}
