{
  "openapi": "3.1.0",
  "info": {
    "title": "Roby Castillo Firm API",
    "version": "1.0.0",
    "description": "Public information and consultation requests for Florida attorney Roby Castillo. Submitting an inquiry does not create an attorney-client relationship.",
    "contact": {
      "name": "Roby Castillo",
      "email": "robycastillo@attorneyrobycastillo.com",
      "url": "https://attorneyrobycastillo.com/"
    }
  },
  "servers": [
    {
      "url": "https://attorneyrobycastillo.com"
    }
  ],
  "tags": [
    { "name": "firm" },
    { "name": "inquiries" }
  ],
  "paths": {
    "/api/v1/health": {
      "get": {
        "tags": ["firm"],
        "summary": "Health check",
        "operationId": "getHealth",
        "responses": {
          "200": {
            "description": "Service is reachable",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": { "type": "string", "example": "ok" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/firm": {
      "get": {
        "tags": ["firm"],
        "summary": "Firm overview",
        "operationId": "getFirm",
        "responses": {
          "200": {
            "description": "Attorney and contact details",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Firm" }
              }
            }
          }
        }
      }
    },
    "/api/v1/practice-areas": {
      "get": {
        "tags": ["firm"],
        "summary": "Practice areas",
        "operationId": "getPracticeAreas",
        "responses": {
          "200": {
            "description": "Florida practice areas",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/PracticeAreas" }
              }
            }
          }
        }
      }
    },
    "/api/v1/faq": {
      "get": {
        "tags": ["firm"],
        "summary": "Frequently asked questions",
        "operationId": "getFaq",
        "responses": {
          "200": {
            "description": "Public FAQ entries",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Faq" }
              }
            }
          }
        }
      }
    },
    "/api/v1/inquiries": {
      "post": {
        "tags": ["inquiries"],
        "summary": "Submit a consultation request",
        "operationId": "createInquiry",
        "security": [
          {},
          { "bearerAuth": ["inquiries.write"] }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/Inquiry" }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Inquiry accepted"
          },
          "400": {
            "description": "Invalid request"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "opaque"
      }
    },
    "schemas": {
      "Firm": {
        "type": "object",
        "properties": {
          "name": { "type": "string" },
          "url": { "type": "string", "format": "uri" },
          "description": { "type": "string" },
          "telephone": { "type": "string" },
          "email": { "type": "string", "format": "email" },
          "areaServed": { "type": "string" }
        }
      },
      "PracticeAreas": {
        "type": "object",
        "properties": {
          "practiceAreas": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": { "type": "string" },
                "name": { "type": "string" },
                "summary": { "type": "string" }
              }
            }
          }
        }
      },
      "Faq": {
        "type": "object",
        "properties": {
          "faq": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "question": { "type": "string" },
                "answer": { "type": "string" }
              }
            }
          }
        }
      },
      "Inquiry": {
        "type": "object",
        "required": ["name", "email", "message"],
        "properties": {
          "name": { "type": "string" },
          "email": { "type": "string", "format": "email" },
          "phone": { "type": "string" },
          "topic": {
            "type": "string",
            "enum": ["personal_injury", "criminal_traffic", "wills_trusts", "animal_law", "other"]
          },
          "message": { "type": "string" }
        }
      }
    }
  }
}
