{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "minLength": 1
    },
    "summary": {
      "type": "string"
    },
    "ingredients": {
      "maxItems": 100,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.:-]{1,64}$"
          },
          "raw": {
            "type": "string",
            "minLength": 1
          },
          "item": {
            "type": "string",
            "minLength": 1
          },
          "qty": {
            "type": "object",
            "properties": {
              "value": {
                "type": "string",
                "pattern": "^\\d+(?:\\.\\d+)?$"
              },
              "max": {
                "type": "string",
                "pattern": "^\\d+(?:\\.\\d+)?$"
              },
              "unit": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              }
            },
            "required": ["value", "unit"]
          },
          "prep": {
            "type": "string",
            "minLength": 1
          },
          "group": {
            "type": "string",
            "minLength": 1
          },
          "optional": {
            "type": "boolean"
          },
          "note": {
            "type": "string",
            "minLength": 1
          },
          "meta": {
            "type": "object",
            "properties": {
              "created_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "updated_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "deleted_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "legacy_ref": {
                "type": "object",
                "properties": {
                  "table": {
                    "type": "string"
                  },
                  "key": {
                    "type": ["string", "number"]
                  },
                  "row": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": ["table", "key", "row"]
              },
              "dataset": {
                "type": "string"
              }
            }
          }
        },
        "required": ["id", "raw", "item"]
      }
    },
    "steps": {
      "maxItems": 100,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.:-]{1,64}$"
          },
          "text": {
            "type": "string",
            "minLength": 1
          },
          "group": {
            "type": "string",
            "minLength": 1
          },
          "ingredient_ids": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "timer_seconds": {
            "type": "number",
            "minimum": 0
          },
          "temperature": {
            "type": "object",
            "properties": {
              "value": {
                "type": "number"
              },
              "unit": {
                "type": "string",
                "known": ["c", "f"]
              }
            },
            "required": ["value", "unit"]
          },
          "meta": {
            "type": "object",
            "properties": {
              "created_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "updated_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "deleted_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "legacy_ref": {
                "type": "object",
                "properties": {
                  "table": {
                    "type": "string"
                  },
                  "key": {
                    "type": ["string", "number"]
                  },
                  "row": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": ["table", "key", "row"]
              },
              "dataset": {
                "type": "string"
              }
            }
          }
        },
        "required": ["id", "text"]
      }
    },
    "yield": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string",
          "minLength": 1
        },
        "servings": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "quantity": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "unit": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": ["text"]
    },
    "prep_seconds": {
      "type": "number",
      "minimum": 0
    },
    "cook_seconds": {
      "type": "number",
      "minimum": 0
    },
    "total_seconds": {
      "type": "number",
      "minimum": 0
    },
    "equipment": {
      "maxItems": 100,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "cuisine": {
      "maxItems": 100,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "course": {
      "maxItems": 100,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "diet": {
      "maxItems": 100,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "tags": {
      "maxItems": 100,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "nutrition": {
      "type": "object",
      "properties": {
        "basis": {
          "type": "string",
          "known": ["per_serving", "per_100g", "whole_recipe", "unspecified"]
        },
        "serving_size": {
          "type": "string",
          "minLength": 1
        },
        "energy_kcal": {
          "type": "number",
          "minimum": 0
        },
        "protein_g": {
          "type": "number",
          "minimum": 0
        },
        "carbohydrate_g": {
          "type": "number",
          "minimum": 0
        },
        "fat_g": {
          "type": "number",
          "minimum": 0
        },
        "fiber_g": {
          "type": "number",
          "minimum": 0
        },
        "sodium_mg": {
          "type": "number",
          "minimum": 0
        },
        "raw": {
          "type": "string",
          "minLength": 1
        }
      },
      "required": ["basis"]
    },
    "source": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri"
        },
        "creator": {
          "type": "string",
          "minLength": 1
        },
        "attribution": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "notes": {
      "type": "string"
    },
    "meta": {
      "type": "object",
      "properties": {
        "created_at": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
        },
        "deleted_at": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
        },
        "legacy_ref": {
          "type": "object",
          "properties": {
            "table": {
              "type": "string"
            },
            "key": {
              "type": ["string", "number"]
            },
            "row": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "required": ["table", "key", "row"]
        },
        "dataset": {
          "type": "string"
        }
      }
    }
  },
  "required": ["title", "ingredients", "steps", "equipment", "cuisine", "course", "diet", "tags", "source"],
  "$id": "https://sendtopigeon.com/schemas/recipe@1.read.schema.json",
  "title": "Pigeon Open Data: recipe@1.read",
  "$comment": "Apache-2.0. Structural schema; use Zod/parseRecord for semantic invariants. This published schema URL is immutable.",
  "examples": [
    {
      "title": "demo",
      "ingredients": [],
      "steps": [],
      "equipment": [],
      "cuisine": [],
      "course": [],
      "diet": [],
      "tags": [],
      "source": {}
    }
  ]
}
