{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1
    },
    "category": {
      "type": ["string", "null"]
    },
    "cuisine": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "pizza",
            "sushi",
            "ramen",
            "mexican",
            "burger",
            "steak",
            "seafood",
            "indian",
            "chinese",
            "italian",
            "vegetarian",
            "bbq",
            "breakfast",
            "bagel",
            "ice_cream",
            "donut"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "address": {
      "type": ["string", "null"]
    },
    "locality": {
      "type": ["string", "null"]
    },
    "region": {
      "type": ["string", "null"]
    },
    "country": {
      "type": ["string", "null"]
    },
    "lat": {
      "anyOf": [
        {
          "type": "number",
          "minimum": -90,
          "maximum": 90
        },
        {
          "type": "null"
        }
      ]
    },
    "lng": {
      "anyOf": [
        {
          "type": "number",
          "minimum": -180,
          "maximum": 180
        },
        {
          "type": "null"
        }
      ]
    },
    "timezone": {
      "type": ["string", "null"]
    },
    "summary": {
      "type": ["string", "null"]
    },
    "quote": {
      "type": ["string", "null"]
    },
    "highlights": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "place_ref": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "table": {
              "type": "string",
              "enum": ["place", "event_listing"]
            },
            "id": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            "meta": {
              "type": "object",
              "properties": {
                "created_at": {
                  "type": ["string", "null"]
                },
                "updated_at": {
                  "type": ["string", "null"]
                },
                "deleted_at": {
                  "type": ["string", "null"]
                },
                "legacy_ref": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "table": {
                          "type": "string"
                        },
                        "key": {
                          "type": ["string", "number"]
                        },
                        "row": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": ["table", "key", "row"],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "dataset": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          },
          "required": ["table", "id"],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "street": {
      "type": ["string", "null"]
    },
    "postal_code": {
      "type": ["string", "null"]
    },
    "neighborhood": {
      "type": ["string", "null"]
    },
    "phone": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 40
        },
        {
          "type": "null"
        }
      ]
    },
    "website": {
      "anyOf": [
        {
          "type": "string",
          "format": "uri"
        },
        {
          "type": "null"
        }
      ]
    },
    "links": {
      "maxItems": 20,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "website",
              "instagram",
              "tiktok",
              "facebook",
              "x",
              "menu",
              "reservation",
              "tickets",
              "phone",
              "email",
              "maps",
              "order",
              "calendar"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "label": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "venue_key": {
            "type": ["string", "null"]
          },
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.:-]{1,64}$"
          },
          "meta": {
            "type": "object",
            "properties": {
              "created_at": {
                "type": ["string", "null"]
              },
              "updated_at": {
                "type": ["string", "null"]
              },
              "deleted_at": {
                "type": ["string", "null"]
              },
              "legacy_ref": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "table": {
                        "type": "string"
                      },
                      "key": {
                        "type": ["string", "number"]
                      },
                      "row": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": ["table", "key", "row"],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "dataset": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "required": ["kind", "url", "label", "id"],
        "additionalProperties": false
      }
    },
    "hours": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "mon": {
              "maxItems": 4,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "open": {
                    "type": "string",
                    "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"
                  },
                  "close": {
                    "type": "string",
                    "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"
                  }
                },
                "required": ["open", "close"],
                "additionalProperties": false
              },
              "atomic": true
            },
            "tue": {
              "maxItems": 4,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "open": {
                    "type": "string",
                    "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"
                  },
                  "close": {
                    "type": "string",
                    "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"
                  }
                },
                "required": ["open", "close"],
                "additionalProperties": false
              },
              "atomic": true
            },
            "wed": {
              "maxItems": 4,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "open": {
                    "type": "string",
                    "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"
                  },
                  "close": {
                    "type": "string",
                    "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"
                  }
                },
                "required": ["open", "close"],
                "additionalProperties": false
              },
              "atomic": true
            },
            "thu": {
              "maxItems": 4,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "open": {
                    "type": "string",
                    "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"
                  },
                  "close": {
                    "type": "string",
                    "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"
                  }
                },
                "required": ["open", "close"],
                "additionalProperties": false
              },
              "atomic": true
            },
            "fri": {
              "maxItems": 4,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "open": {
                    "type": "string",
                    "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"
                  },
                  "close": {
                    "type": "string",
                    "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"
                  }
                },
                "required": ["open", "close"],
                "additionalProperties": false
              },
              "atomic": true
            },
            "sat": {
              "maxItems": 4,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "open": {
                    "type": "string",
                    "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"
                  },
                  "close": {
                    "type": "string",
                    "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"
                  }
                },
                "required": ["open", "close"],
                "additionalProperties": false
              },
              "atomic": true
            },
            "sun": {
              "maxItems": 4,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "open": {
                    "type": "string",
                    "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"
                  },
                  "close": {
                    "type": "string",
                    "pattern": "^(?:[01]\\d|2[0-3]):[0-5]\\d$"
                  }
                },
                "required": ["open", "close"],
                "additionalProperties": false
              },
              "atomic": true
            },
            "meta": {
              "type": "object",
              "properties": {
                "created_at": {
                  "type": ["string", "null"]
                },
                "updated_at": {
                  "type": ["string", "null"]
                },
                "deleted_at": {
                  "type": ["string", "null"]
                },
                "legacy_ref": {
                  "anyOf": [
                    {
                      "type": "object",
                      "properties": {
                        "table": {
                          "type": "string"
                        },
                        "key": {
                          "type": ["string", "number"]
                        },
                        "row": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": ["table", "key", "row"],
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "dataset": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "price_level": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1,
          "maximum": 4
        },
        {
          "type": "null"
        }
      ]
    },
    "offerings": {
      "maxItems": 50,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": ["amenity", "recurring", "deal", "event", "feature"]
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "detail": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ]
          },
          "tags": {
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 60
            }
          },
          "schedule": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "rrule": {
                        "type": "string"
                      },
                      "start_local": {
                        "type": ["string", "null"]
                      },
                      "end_local": {
                        "type": ["string", "null"]
                      },
                      "meta": {
                        "type": "object",
                        "properties": {
                          "created_at": {
                            "type": ["string", "null"]
                          },
                          "updated_at": {
                            "type": ["string", "null"]
                          },
                          "deleted_at": {
                            "type": ["string", "null"]
                          },
                          "legacy_ref": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "table": {
                                    "type": "string"
                                  },
                                  "key": {
                                    "type": ["string", "number"]
                                  },
                                  "row": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": ["table", "key", "row"],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "dataset": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "required": ["rrule", "start_local", "end_local"],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "date": {
                        "type": "string",
                        "format": "date",
                        "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])))$"
                      },
                      "start_local": {
                        "type": ["string", "null"]
                      },
                      "end_local": {
                        "type": ["string", "null"]
                      },
                      "meta": {
                        "type": "object",
                        "properties": {
                          "created_at": {
                            "type": ["string", "null"]
                          },
                          "updated_at": {
                            "type": ["string", "null"]
                          },
                          "deleted_at": {
                            "type": ["string", "null"]
                          },
                          "legacy_ref": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "table": {
                                    "type": "string"
                                  },
                                  "key": {
                                    "type": ["string", "number"]
                                  },
                                  "row": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  }
                                },
                                "required": ["table", "key", "row"],
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "dataset": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "required": ["date", "start_local", "end_local"],
                    "additionalProperties": false
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "schedule_text": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "valid_from": {
            "anyOf": [
              {
                "type": "string",
                "format": "date",
                "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])))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "valid_to": {
            "anyOf": [
              {
                "type": "string",
                "format": "date",
                "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])))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "price_text": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "booking_url": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "image_url": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "venue_key": {
            "type": ["string", "null"]
          },
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.:-]{1,64}$"
          },
          "meta": {
            "type": "object",
            "properties": {
              "created_at": {
                "type": ["string", "null"]
              },
              "updated_at": {
                "type": ["string", "null"]
              },
              "deleted_at": {
                "type": ["string", "null"]
              },
              "legacy_ref": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "table": {
                        "type": "string"
                      },
                      "key": {
                        "type": ["string", "number"]
                      },
                      "row": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": ["table", "key", "row"],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "dataset": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "kind",
          "title",
          "detail",
          "tags",
          "schedule",
          "schedule_text",
          "valid_from",
          "valid_to",
          "price_text",
          "booking_url",
          "image_url",
          "id"
        ],
        "additionalProperties": false
      }
    },
    "photo_order": {
      "maxItems": 40,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "cover_photo": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1
        },
        {
          "type": "null"
        }
      ]
    },
    "meta": {
      "type": "object",
      "properties": {
        "created_at": {
          "type": ["string", "null"]
        },
        "updated_at": {
          "type": ["string", "null"]
        },
        "deleted_at": {
          "type": ["string", "null"]
        },
        "legacy_ref": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "table": {
                  "type": "string"
                },
                "key": {
                  "type": ["string", "number"]
                },
                "row": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": ["table", "key", "row"],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "dataset": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "name",
    "category",
    "address",
    "locality",
    "region",
    "country",
    "lat",
    "lng",
    "timezone",
    "summary",
    "quote",
    "highlights",
    "place_ref"
  ],
  "additionalProperties": false,
  "$id": "https://sendtopigeon.com/schemas/place@1.schema.json",
  "title": "Pigeon Open Data: place@1",
  "$comment": "Apache-2.0. Structural schema; use Zod/parseRecord for semantic invariants. This published schema URL is immutable.",
  "examples": [
    {
      "name": "demo",
      "category": null,
      "address": null,
      "locality": null,
      "region": null,
      "country": null,
      "lat": -90,
      "lng": -180,
      "timezone": null,
      "summary": null,
      "quote": null,
      "highlights": [],
      "place_ref": {
        "table": "place",
        "id": "0194ab00-0000-7000-8000-000000000001"
      }
    }
  ]
}
