{
  "openapi": "3.0.3",
  "info": {
    "title": "Swagger Petstore — DevDocify playground",
    "version": "playground-1.0.0",
    "description": "OpenAPI description for the operations exposed in the DevDocify Petstore API playground.\n\n**Scope:** Covers `GET /pet/findByStatus`, `POST /pet`, `PUT /pet`, `DELETE /pet/{petId}`, `GET /user/login`, and `GET /user/logout`. All operations run against the public sample server at `petstore3.swagger.io` without authentication.\n\n**Audience:** Technical writers, client developers, and tooling. Use it to generate snippets, mocks, or contract tests for the demo surface only.\n\n**Encoding:** Requests and responses use UTF-8. Successful JSON responses use `application/json` unless noted."
  },
  "servers": [
    {
      "url": "https://petstore3.swagger.io/api/v3",
      "description": "Swagger Petstore public sample (OpenAPI 3.0)."
    }
  ],
  "tags": [
    {
      "name": "Pets",
      "description": "Pet catalog queries and mutations."
    },
    {
      "name": "User session",
      "description": "Sample user session flow (login and logout) using GET for demo purposes. Do not treat this as a production authentication pattern."
    }
  ],
  "paths": {
    "/pet/findByStatus": {
      "get": {
        "tags": ["Pets"],
        "summary": "Find pets by inventory status",
        "description": "Returns an array of **Pet** resources whose `status` field matches the required query parameter.\n\nUse this operation to retrieve a slice of the store catalog (for example all pets currently `available`). The demo server returns synthetic data; IDs and fields may vary between calls.\n\n**Security:** This GET is unauthenticated on the public sample server.",
        "operationId": "findPetsByStatus",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": true,
            "description": "Inventory state to filter by. Must be one of the allowed enum values.",
            "schema": {
              "type": "string",
              "enum": ["available", "pending", "sold"],
              "default": "available"
            },
            "example": "available"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. Response body is a JSON array of pets (may be empty if no pets match).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Pet"
                  }
                },
                "example": [
                  {
                    "id": 1,
                    "name": "doggie",
                    "photoUrls": ["https://example.com/photo.jpg"],
                    "status": "available"
                  }
                ]
              }
            }
          },
          "400": {
            "description": "Bad request. Typically returned when `status` is missing or not a valid enum value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "code": 400,
                  "type": "error",
                  "message": "Invalid status value"
                }
              }
            }
          },
          "500": {
            "description": "Server error. Retry with backoff."
          }
        }
      }
    },
    "/pet": {
      "post": {
        "tags": ["Pets"],
        "summary": "Add a new pet to the store",
        "description": "Creates a new **Pet** resource on the sample server. The server assigns an `id` and returns the created pet in the response body.\n\n`name` and `photoUrls` are required. `status` defaults to `available` if omitted.\n\n**Security:** Unauthenticated on the public sample server.",
        "operationId": "addPet",
        "requestBody": {
          "required": true,
          "description": "Pet to add. `name` and `photoUrls` are required.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pet"
              },
              "example": {
                "name": "Rex",
                "photoUrls": ["https://example.com/rex.jpg"],
                "status": "available",
                "category": {
                  "id": 1,
                  "name": "Dogs"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pet created. Response body contains the new pet with server-assigned `id`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pet"
                },
                "example": {
                  "id": 9223372036854775807,
                  "name": "Rex",
                  "photoUrls": ["https://example.com/rex.jpg"],
                  "status": "available",
                  "category": {
                    "id": 1,
                    "name": "Dogs"
                  }
                }
              }
            }
          },
          "405": {
            "description": "Invalid input. The request body is missing required fields or has an invalid value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "500": {
            "description": "Server error."
          }
        }
      },
      "put": {
        "tags": ["Pets"],
        "summary": "Update an existing pet",
        "description": "Replaces the stored fields of an existing **Pet** resource. The `id` field in the request body identifies the pet to update; include all fields you want to retain, not just changed ones.\n\n**Security:** Unauthenticated on the public sample server.",
        "operationId": "updatePet",
        "requestBody": {
          "required": true,
          "description": "Updated pet. Must include `id`, `name`, and `photoUrls`.",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pet"
              },
              "example": {
                "id": 1,
                "name": "Rex (updated)",
                "photoUrls": ["https://example.com/rex-updated.jpg"],
                "status": "pending"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pet updated. Response body contains the updated pet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pet"
                },
                "example": {
                  "id": 1,
                  "name": "Rex (updated)",
                  "photoUrls": ["https://example.com/rex-updated.jpg"],
                  "status": "pending"
                }
              }
            }
          },
          "400": {
            "description": "Invalid `id` supplied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Pet not found for the given `id`."
          },
          "405": {
            "description": "Validation exception."
          },
          "500": {
            "description": "Server error."
          }
        }
      }
    },
    "/pet/{petId}": {
      "delete": {
        "tags": ["Pets"],
        "summary": "Delete a pet by ID",
        "description": "Removes the **Pet** resource identified by `petId` from the sample store. On the public demo server this operation is accepted for any numeric `petId` and returns a success response regardless of whether the pet existed.\n\n**Security:** Unauthenticated on the public sample server.",
        "operationId": "deletePet",
        "parameters": [
          {
            "name": "petId",
            "in": "path",
            "required": true,
            "description": "Numeric ID of the pet to delete.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "default": 1
            },
            "example": 1
          }
        ],
        "responses": {
          "200": {
            "description": "Pet deleted successfully."
          },
          "400": {
            "description": "Invalid pet ID supplied (must be a positive integer).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Pet not found."
          },
          "500": {
            "description": "Server error."
          }
        }
      }
    },
    "/user/login": {
      "get": {
        "tags": ["User session"],
        "summary": "Log in with username and password (sample)",
        "description": "Returns a **plain-text session token** in the response body for the supplied credentials.\n\n**Warning:** Credentials are passed as **query parameters**, which appear in logs and browser history. This matches the upstream Swagger Petstore sample for teaching only — **do not** copy this pattern for production APIs.\n\n**Response headers:** On success, the sample server may include rate-limit and session expiry hints (see response `headers` below).",
        "operationId": "loginUser",
        "parameters": [
          {
            "name": "username",
            "in": "query",
            "required": true,
            "description": "User name registered with the sample server.",
            "schema": {
              "type": "string",
              "default": "theUser"
            },
            "example": "theUser"
          },
          {
            "name": "password",
            "in": "query",
            "required": true,
            "description": "Password for the sample user.",
            "schema": {
              "type": "string",
              "default": "12345"
            },
            "example": "12345"
          }
        ],
        "responses": {
          "200": {
            "description": "Login accepted. Body is a string (often prefixed with `logged in user session:` followed by a token).",
            "headers": {
              "X-Rate-Limit": {
                "description": "Maximum number of calls per hour allowed for this client (sample server).",
                "schema": {
                  "type": "integer",
                  "example": 1000
                }
              },
              "X-Expires-After": {
                "description": "UTC date/time after which the session may be treated as expired (format depends on server).",
                "schema": {
                  "type": "string",
                  "example": "Wed, 20 Mar 2024 12:00:00 GMT"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "string",
                  "example": "logged in user session:1234567890"
                }
              }
            }
          },
          "400": {
            "description": "Invalid username or password supplied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                },
                "example": {
                  "code": 400,
                  "type": "error",
                  "message": "Invalid username/password supplied"
                }
              }
            }
          }
        }
      }
    },
    "/user/logout": {
      "get": {
        "tags": ["User session"],
        "summary": "Log out current session (sample)",
        "description": "Ends the current session on the sample server. The public demo typically returns a short confirmation message.\n\n**Note:** Session behavior depends on server-side state; for the playground, this call is safe to run without prior login for demonstration.",
        "operationId": "logoutUser",
        "responses": {
          "200": {
            "description": "Logout acknowledged. Body format is a string on the sample server.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string",
                  "example": "ok"
                }
              }
            }
          },
          "500": {
            "description": "Server error while processing logout."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Category": {
        "type": "object",
        "properties": {
          "id": { "type": "integer", "format": "int64", "example": 1 },
          "name": { "type": "string", "example": "Dogs" }
        }
      },
      "Tag": {
        "type": "object",
        "properties": {
          "id": { "type": "integer", "format": "int64" },
          "name": { "type": "string" }
        }
      },
      "Pet": {
        "type": "object",
        "description": "Pet resource as returned by the sample store.",
        "required": ["name", "photoUrls"],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "description": "Server-assigned identifier. Omit on POST; include on PUT."
          },
          "name": {
            "type": "string",
            "description": "Display name of the pet.",
            "example": "Rex"
          },
          "category": {
            "$ref": "#/components/schemas/Category"
          },
          "photoUrls": {
            "type": "array",
            "items": { "type": "string", "format": "uri" },
            "description": "URLs of photos associated with the pet.",
            "example": ["https://example.com/rex.jpg"]
          },
          "tags": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/Tag" }
          },
          "status": {
            "type": "string",
            "description": "Inventory status.",
            "enum": ["available", "pending", "sold"],
            "example": "available"
          }
        }
      },
      "ApiError": {
        "type": "object",
        "description": "Typical error envelope returned by the sample server for failed requests (shape may vary slightly by endpoint).",
        "properties": {
          "code": { "type": "integer", "example": 400 },
          "type": { "type": "string", "example": "error" },
          "message": {
            "type": "string",
            "description": "Human-readable explanation safe to show to integrators (no stack traces in normal operation)."
          }
        }
      }
    }
  }
}
