{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/receptapi/json-schema/receptapi-recipe-schema.json",
  "title": "Recipe",
  "x-generated": "2026-11-08",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/receptapi-openapi.json#/components/schemas/Recipe",
  "allOf": [
    {
      "type": "object",
      "properties": {
        "slug": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "servings": {
          "type": "integer"
        },
        "total_minutes": {
          "type": "integer"
        },
        "difficulty": {
          "type": "string",
          "enum": [
            "latt",
            "medel",
            "svar"
          ]
        },
        "category": {
          "type": "string"
        },
        "cuisine": {
          "type": [
            "string",
            "null"
          ]
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "image_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "api_url": {
          "type": "string",
          "format": "uri"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    {
      "type": "object",
      "properties": {
        "active_minutes": {
          "type": [
            "integer",
            "null"
          ]
        },
        "allergens": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Allergen"
          }
        },
        "text_status": {
          "type": "string",
          "enum": [
            "rewritten",
            "original_facts_only"
          ]
        },
        "verified": {
          "type": "boolean"
        },
        "nutrition": {
          "type": [
            "object",
            "null"
          ]
        },
        "source": {
          "type": "object",
          "properties": {
            "name": {
              "type": [
                "string",
                "null"
              ]
            },
            "url": {
              "type": "string",
              "format": "uri"
            }
          }
        },
        "ingredients": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "position": {
                "type": "integer"
              },
              "raw_text": {
                "type": "string"
              },
              "amount": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "unit": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "note": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "group": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "ingredient": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "slug": {
                    "type": "string"
                  },
                  "name_sv": {
                    "type": "string"
                  },
                  "category": {
                    "type": "string"
                  },
                  "allergens": {
                    "type": "array",
                    "items": {
                      "$ref": "#/$defs/Allergen"
                    }
                  }
                }
              }
            }
          }
        },
        "steps": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "position": {
                "type": "integer"
              },
              "text": {
                "type": "string"
              },
              "timer_seconds": {
                "type": [
                  "integer",
                  "null"
                ]
              }
            }
          }
        }
      }
    }
  ],
  "$defs": {
    "Allergen": {
      "type": "string",
      "enum": [
        "gluten",
        "kraftdjur",
        "agg",
        "fisk",
        "jordnotter",
        "soja",
        "mjolk",
        "notter",
        "selleri",
        "senap",
        "sesam",
        "svaveldioxid",
        "lupin",
        "blotdjur"
      ]
    }
  }
}