{
"openapi": "3.0.3",
"info": {
"title": "Petstore",
"version": "1.0.0"
},
"servers": [
{
"url": "/api/v1"
}
],
"paths": {
"/pets": {
"get": {
"operationId": "listPets",
"summary": "List all pets",
"parameters": [
{
"name": "limit",
"in": "query",
"schema": {
"type": "integer"
},
"description": "Max items to return"
},
{
"name": "status",
"in": "query",
"schema": {
"type": "string",
"enum": [
"available",
"pending",
"sold"
]
},
"description": "Filter by status"
}
]
},
"post": {
"operationId": "createPet",
"summary": "Create a pet",
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"description": "Pet name"
},
"tag": {
"type": "string",
"description": "Pet tag"
},
"age": {
"type": "integer",
"description": "Pet age"
}
}
}
}
}
}
}
},
"/pets/{petId}": {
"get": {
"operationId": "getPet",
"summary": "Get a pet by ID",
"parameters": [
{
"name": "petId",
"in": "path",
"required": true,
"schema": {
"type": "integer"
},
"description": "Pet ID"
}
]
},
"delete": {
"operationId": "deletePet",
"summary": "Delete a pet",
"parameters": [
{
"name": "petId",
"in": "path",
"required": true,
"schema": {
"type": "integer"
},
"description": "Pet ID"
}
]
},
"put": {
"operationId": "updatePet",
"summary": "Update a pet",
"parameters": [
{
"name": "petId",
"in": "path",
"required": true,
"schema": {
"type": "integer"
},
"description": "Pet ID"
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Pet name"
},
"tag": {
"type": "string",
"description": "Pet tag"
}
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Pet": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"tag": {
"type": "string"
}
}
}
}
}
}