Swagger Petstore 1.0.0
License: MIT
Servers
Description | URL |
---|---|
http://petstore.swagger.io/v1 | http://petstore.swagger.io/v1 |
pets
GET /pets
List all pets
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
ApiKeyAuth | header | string | N/A | No | API key |
BasicAuth | header | string | N/A | No | Basic authentication |
limit | query | integer | No | How many items to return at one time (max 100) |
Response 200 OK
[
{
"id": 224,
"name": "string",
"tag": "string",
"category": "One"
}
]
Schema of the response body
{
"type": "array",
"items": {
"$ref": "#/components/schemas/Pet"
}
}
Response headers
Name | Description | Schema |
---|---|---|
x-next | A link to the next page of responses | string |
Other responses
{
"code": 91,
"message": "string"
}
Schema of the response body
{
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
POST /pets
Create a pet
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
ApiKeyAuth | header | string | N/A | No | API key |
BasicAuth | header | string | N/A | No | Basic authentication |
Response 201 Created
Other responses
{
"code": 221,
"message": "string"
}
Schema of the response body
{
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
GET /pets/{petId}
Info for a specific pet
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
ApiKeyAuth | header | string | N/A | No | API key |
BasicAuth | header | string | N/A | No | Basic authentication |
petId | path | string | No | The id of the pet to retrieve |
Response 200 OK
{
"id": 36,
"name": "string",
"tag": "string",
"category": "One"
}
Schema of the response body
{
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"name": {
"type": "string"
},
"tag": {
"type": "string"
},
"category": {
"type": "string",
"enum": [
"One",
"Two",
"Three"
]
}
}
}
Other responses
{
"code": 221,
"message": "string"
}
Schema of the response body
{
"type": "object",
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
}
}
}
PATCH /pets/{petId}
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
ApiKeyAuth | header | string | N/A | No | API key |
BasicAuth | header | string | N/A | No | Basic authentication |
Request body
Schema of the request body
{
"oneOf": [
{
"$ref": "#/components/schemas/Cat"
},
{
"$ref": "#/components/schemas/Dog"
}
]
}
Response 200 OK
Schemas
Cat
Name | Type |
---|---|
age | integer |
hunts | boolean |
Dog
Name | Type |
---|---|
bark | boolean |
breed | string |
Error
Name | Type |
---|---|
code | integer(int32) |
message | string |
Pet
Name | Type |
---|---|
category | string |
id | integer(int64) |
name | string |
tag | string |
Pets
Type: Array<Pet>
PetsIds
Type: Array<integer(int64)>
Security schemes
Name | Type | Scheme | Description |
---|---|---|---|
BasicAuth | http | basic | |
ApiKeyAuth | apiKey |