{
  "openapi": "3.1.0",
  "info": {
    "title": "Porteño Guide API",
    "version": "1.0.0",
    "description": "Public, read-only access to published Porteño Guide listings."
  },
  "servers": [
    {
      "url": "https://portenoguide.com"
    }
  ],
  "paths": {
    "/api/listings": {
      "get": {
        "summary": "List published listings",
        "parameters": [
          {
            "name": "neighborhood",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Published listings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Listing"
                      }
                    },
                    "count": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/listings/{slug}": {
      "get": {
        "summary": "Get one published listing",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A published listing",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Listing"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Listing not found"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Listing": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "slug": {
            "type": "string"
          },
          "name_en": {
            "type": "string"
          },
          "name_es": {
            "type": [
              "string",
              "null"
            ]
          },
          "category": {
            "type": "string"
          },
          "neighborhood": {
            "type": "string"
          },
          "description_en": {
            "type": "string"
          },
          "description_es": {
            "type": [
              "string",
              "null"
            ]
          },
          "address": {
            "type": "string"
          },
          "postal_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "website": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "hours": {
            "type": [
              "string",
              "null"
            ]
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "tags": {
            "type": [
              "string",
              "null"
            ]
          },
          "editor_note": {
            "type": [
              "string",
              "null"
            ]
          },
          "cuisine": {
            "type": [
              "string",
              "null"
            ]
          },
          "price_range": {
            "type": [
              "string",
              "null"
            ]
          },
          "latitude": {
            "type": [
              "number",
              "null"
            ]
          },
          "longitude": {
            "type": [
              "number",
              "null"
            ]
          },
          "opening_hours": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "day_of_week": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "opens": {
                  "type": "string"
                },
                "closes": {
                  "type": "string"
                }
              },
              "required": [
                "day_of_week",
                "opens",
                "closes"
              ]
            }
          },
          "accepts_reservations": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "reservation_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "menu_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "signature_dishes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "accessibility_notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "source_urls": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "visited_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "published": {
            "type": "integer",
            "enum": [
              1
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "slug",
          "name_en",
          "category",
          "neighborhood",
          "description_en",
          "address",
          "published",
          "created_at",
          "updated_at"
        ]
      }
    }
  }
}