{
  "openapi": "3.0.3",
  "info": {
    "title": "Test API",
    "description": "A test API for VenomQA OpenAPI parsing tests",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "http://localhost:8000",
      "description": "Local development server"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/users": {
      "get": {
        "summary": "List all users",
        "description": "Returns a paginated list of all users",
        "operationId": "listUsers",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "description": "Page number",
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Items per page",
            "schema": {
              "type": "integer",
              "default": 10
            },
            "example": 20
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/User"
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Create a new user",
        "operationId": "createUser",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUser"
              },
              "example": {
                "name": "John Doe",
                "email": "john@example.com",
                "role": "user"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "User created successfully"
          }
        }
      }
    },
    "/users/{userId}": {
      "parameters": [
        {
          "name": "userId",
          "in": "path",
          "required": true,
          "description": "The user ID",
          "schema": {
            "type": "integer"
          }
        }
      ],
      "get": {
        "summary": "Get user by ID",
        "operationId": "getUserById",
        "responses": {
          "200": {
            "description": "Successful response"
          },
          "404": {
            "description": "User not found"
          }
        }
      },
      "put": {
        "summary": "Update user",
        "operationId": "updateUser",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "example": "Updated Name"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "active": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "User updated"
          }
        }
      },
      "delete": {
        "summary": "Delete user",
        "operationId": "deleteUser",
        "responses": {
          "204": {
            "description": "User deleted"
          }
        }
      }
    },
    "/items": {
      "get": {
        "summary": "List items",
        "security": [],
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": ["electronics", "clothing", "food"]
            },
            "example": "electronics"
          },
          {
            "name": "X-Request-ID",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "example": "req-12345"
          }
        ],
        "responses": {
          "200": {
            "description": "List of items"
          }
        }
      },
      "post": {
        "summary": "Create item",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["name", "price"],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "price": {
                    "type": "number",
                    "minimum": 0
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Item created"
          }
        }
      }
    },
    "/health": {
      "get": {
        "summary": "Health check endpoint",
        "security": [],
        "responses": {
          "200": {
            "description": "Service is healthy"
          }
        }
      }
    },
    "/internal/admin": {
      "get": {
        "summary": "Admin-only endpoint",
        "description": "This endpoint should be excluded by pattern",
        "responses": {
          "200": {
            "description": "Admin data"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "User": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "role": {
            "type": "string",
            "enum": ["admin", "user", "guest"]
          }
        }
      },
      "CreateUser": {
        "type": "object",
        "required": ["name", "email"],
        "properties": {
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "role": {
            "type": "string",
            "enum": ["admin", "user", "guest"],
            "default": "user"
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  }
}
