{
  "openapi": "3.0.3",
  "info": {
    "title": "Petstore API",
    "description": "A sample API for testing codegen",
    "version": "1.0.0"
  },
  "paths": {
    "/pets": {
      "get": {
        "operationId": "listPets",
        "responses": {
          "200": {
            "description": "List of pets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": { "$ref": "#/components/schemas/Pet" }
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createPet",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/CreatePetRequest" }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created pet",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Pet" }
              }
            }
          }
        }
      }
    },
    "/pets/{petId}": {
      "get": {
        "operationId": "getPet",
        "parameters": [
          {
            "name": "petId",
            "in": "path",
            "required": true,
            "schema": { "type": "string" }
          }
        ],
        "responses": {
          "200": {
            "description": "A pet",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Pet" }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Pet": {
        "type": "object",
        "description": "A pet in the store",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier"
          },
          "name": {
            "type": "string",
            "description": "Pet's name"
          },
          "species": {
            "$ref": "#/components/schemas/Species"
          },
          "age": {
            "type": "integer",
            "description": "Age in years"
          },
          "tags": {
            "type": "array",
            "items": { "type": "string" }
          }
        },
        "required": ["id", "name", "species"]
      },
      "Species": {
        "type": "string",
        "description": "Type of animal",
        "enum": ["dog", "cat", "bird", "fish", "other"]
      },
      "CreatePetRequest": {
        "type": "object",
        "description": "Request to create a new pet",
        "properties": {
          "name": { "type": "string" },
          "species": { "$ref": "#/components/schemas/Species" },
          "age": { "type": "integer" }
        },
        "required": ["name", "species"]
      }
    }
  }
}
