{
"openapi": "3.1.0",
"info": {
"description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.",
"version": "1.0.0",
"title": "Swagger Petstore",
"termsOfService": "http://swagger.io/terms/",
"contact": {
"email": "apiteam@swagger.io"
},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},
"servers": [
{
"url": "http://petstore.swagger.io/v2"
}
],
"tags": [
{
"name": "pet",
"description": "Everything about your Pets",
"externalDocs": {
"description": "Find out more",
"url": "http://swagger.io"
}
}
],
"paths": {
"/pet": {
"post": {
"tags": [
"pet"
],
"summary": "Add a new pet to the store",
"description": "",
"operationId": "addPet",
"requestBody": {
"description": "Pet object that needs to be added to the store",
"required": true,
"content": {
"application/json": {
"schema": {
"allOf": [
{
"$ref": "#/components/schemas/BasePet"
},
{
"$ref": "#/components/schemas/Cat"
}
]
}
},
"application/xml": {
"schema": {
"$ref": "#/components/schemas/Pet"
}
}
}
},
"responses": {
"405": {
"description": "Invalid input"
}
}
}
}
},
"components": {
"schemas": {
"Id": {
"type": "integer",
"format": "int64"
},
"Name": {
"type": "string"
},
"Category": {
"type": "object",
"properties": {
"id": {
"$ref": "#/components/schemas/Id"
},
"name": {
"$ref": "#/components/schemas/Name"
}
},
"xml": {
"name": "Category"
}
},
"Tag": {
"type": "object",
"properties": {
"id": {
"$ref": "#/components/schemas/Id"
},
"name": {
"$ref": "#/components/schemas/Name"
}
},
"xml": {
"name": "Tag"
}
},
"BasePet": {
"type": "object",
"required": ["name", "age"],
"properties": {
"name": {
"type": "string"
},
"age": {
"type": "integer"
}
}
},
"Cat": {
"type": "object",
"required": ["hunts", "breed"],
"properties": {
"hunts": {
"type": "boolean"
},
"breed": {
"type": "string",
"enum": ["Bengal", "Siamese", "Ragdoll", "Birman"]
}
}
},
"LayerOne": {
"oneOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"layerTwo": {
"$ref": "#/components/schemas/LayerTwo"
}
}
},
{
"allOf": [
{
"$ref": "#/components/schemas/BasePet"
},
{
"$ref": "#/components/schemas/Cat"
}
]
},
{
"allOf": [
{
"$ref": "#/components/schemas/BasePet"
},
{
"$ref": "#/components/schemas/Dog"
}
]
}
]
},
"LayerTwo": {
"type": "object",
"properties": {
"layerThree": {
"$ref": "#/components/schemas/LayerThree"
}
}
},
"LayerThree": {
"type": "object",
"required": ["data"],
"properties": {
"data": {
"type": "object"
},
"loop": {
"$ref": "#/components/schemas/LayerOne"
}
}
},
"Dog": {
"type": "object",
"required": ["bark", "breed"],
"properties": {
"bark": {
"type": "boolean"
},
"breed": {
"type": "string",
"enum": ["Dingo", "Husky", "Retriever", "Shepherd"]
}
}
},
"Pet": {
"type": "object",
"unevaluatedProperties": false,
"required": [
"name",
"photoUrls"
],
"properties": {
"id": {
"$ref": "#/components/schemas/Id"
},
"category": {
"$ref": "#/components/schemas/Category"
},
"name": {
"$ref": "#/components/schemas/Name"
},
"photoUrls": {
"type": "array",
"xml": {
"name": "photoUrl",
"wrapped": true
},
"items": {
"type": "string"
}
},
"tags": {
"type": "array",
"xml": {
"name": "tag",
"wrapped": true
},
"items": {
"$ref": "#/components/schemas/Tag"
}
},
"status": {
"type": "string",
"description": "pet status in the store",
"enum": [
"available",
"pending",
"sold"
]
}
},
"xml": {
"name": "Pet"
}
}
},
"securitySchemes": {
"petstore_auth": {
"type": "oauth2",
"description": "My example client credential flow",
"flows": {
"clientCredentials": {
"tokenUrl": "https://api.example/oauth2/someid/token",
"scopes": {
"read:pets": "My read scope",
"write:pets": "My write scope"
}
}
}
}
}
},
"externalDocs": {
"description": "Find out more about Swagger",
"url": "http://swagger.io"
}
}