{
  "openapi": "3.1.0",
  "info": {
    "title": "WhichPetPlan Read-only Facts API",
    "version": "1.0.0",
    "description": "Read-only sourced policy catalog. No live premium, eligibility guarantee, affiliate destination or personal data. Policy documents and current insurer quotes govern."
  },
  "servers": [
    {
      "url": "https://whichpetplan.com"
    }
  ],
  "paths": {
    "/api/plans": {
      "get": {
        "operationId": "getPetPlanFacts",
        "summary": "Read sourced pet-policy mechanics",
        "description": "Existing curated API. Per-plan sources and lastVerified are catalog records, not fresh API verification. Premium estimates are intentionally absent because no dated comparable quote sample exists. State notes are included only when recorded. Editorial scores are not insurer or industry ratings.",
        "parameters": [
          {
            "name": "slug",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "species",
            "in": "query",
            "schema": {
              "enum": [
                "dog",
                "cat"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Catalog facts; no matching slug/species yields an empty plans array",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PetCatalog"
                }
              }
            }
          },
          "500": {
            "description": "Catalog unavailable"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "PetCatalog": {
        "type": "object",
        "properties": {
          "site": {
            "const": "WhichPetPlan"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "api": {
            "type": "string",
            "format": "uri"
          },
          "lastVerified": {
            "type": "string"
          },
          "rules": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "filters": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "plans": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PetPlanFacts"
            }
          }
        },
        "required": [
          "site",
          "url",
          "api",
          "lastVerified",
          "rules",
          "filters",
          "plans"
        ],
        "additionalProperties": false
      },
      "PetPlanFacts": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "species": {
            "type": "array",
            "items": {
              "enum": [
                "dog",
                "cat"
              ]
            }
          },
          "citationUrl": {
            "type": "string",
            "format": "uri"
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "required": [
                "label",
                "url"
              ],
              "additionalProperties": false
            }
          },
          "lastVerified": {
            "type": "string"
          },
          "scoresAreEditorial": {
            "const": true
          }
        },
        "required": [
          "slug",
          "name",
          "species",
          "citationUrl",
          "sources",
          "lastVerified",
          "scoresAreEditorial"
        ],
        "additionalProperties": true
      }
    }
  }
}
