openapi: 3.0.0
info:
title: Pet Store API
version: 1.0.0
description: A sample Pet Store API
servers:
- url: https://petstore.example.com/api/v1
paths:
/pets:
get:
summary: List all pets
operationId: listPets
responses:
'200':
description: A list of pets
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Pet'
post:
summary: Add a new pet
operationId: addPet
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
responses:
'201':
description: Pet created
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
/pets/findByStatus:
get:
summary: Find pets by status
operationId: findPetsByStatus
parameters:
- name: status
in: query
required: true
description: Status values to filter by (can be multiple)
schema:
type: array
items:
type: string
enum: [available, pending, sold]
responses:
'200':
description: List of pets with the specified status
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Pet'
/pets/{petId}:
get:
summary: Get a pet by ID
operationId: getPetById
parameters:
- name: petId
in: path
required: true
schema:
type: integer
responses:
'200':
description: A pet
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'
components:
schemas:
Pet:
type: object
properties:
id:
type: integer
name:
type: string
tag:
type: string