petstore.json•2.42 kB
{
"openapi": "3.0.0",
"info": {
"title": "Test Petstore API",
"version": "1.0.0",
"description": "A simple petstore API for testing"
},
"servers": [
{
"url": "https://petstore.test.com/api/v1"
}
],
"paths": {
"/pets": {
"get": {
"operationId": "listPets",
"summary": "List all pets",
"parameters": [
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": 10
}
}
],
"responses": {
"200": {
"description": "List of pets",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Pet"
}
}
}
}
}
}
},
"post": {
"operationId": "createPet",
"summary": "Create a new pet",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Pet"
}
}
}
},
"responses": {
"201": {
"description": "Pet created"
}
}
}
},
"/pets/{petId}": {
"get": {
"operationId": "getPetById",
"summary": "Get a pet by ID",
"parameters": [
{
"name": "petId",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Pet details",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Pet"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Pet": {
"type": "object",
"required": ["name"],
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"tag": {
"type": "string"
}
}
}
}
}
}