{ "openapi": "3.0.2", "info": { "description": "This is a sample Pet Store Server based on the OpenAPI 3.0 specification. You can find out more about\nSwagger at [http://swagger.io](http://swagger.io). In the third iteration of the pet store, we've switched to the design first approach!\nYou can now help us improve the API whether it's by making changes to the definition itself or to the code.\nThat way, with time, we can improve the API in general, and expose some of the new features in OAS3.\n\nSome useful links:\n- [The Pet Store repository](https://github.com/swagger-api/swagger-petstore)\n- [The source API definition for the Pet Store](https://github.com/swagger-api/swagger-petstore/blob/master/src/main/resources/openapi.yaml)", "version": "1.0.6-SNAPSHOT", "title": "Swagger Petstore - OpenAPI 3.0", "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": "/v3" } ], "paths": { "/pet": { "post": { "operationId": "addPet", "summary": "Add a new pet to the store", "description": "Add a new pet to the store", "requestBody": { "description": "Create a new pet in the store", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Pet" } }, "application/x-www-form-urlencoded": { "schema": { "$ref": "#/components/schemas/Pet" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/Pet" } } } }, "responses": { "200": { "description": "Successful operation", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Pet" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/Pet" } } } }, "405": { "description": "Invalid input" } }, "security": [ { "petstore_auth": [ "write:pets", "read:pets" ] } ], "tags": [ "pet" ] }, "put": { "operationId": "updatePet", "summary": "Update an existing pet", "description": "Update an existing pet by Id", "requestBody": { "description": "Update an existent pet in the store", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Pet" } }, "application/x-www-form-urlencoded": { "schema": { "$ref": "#/components/schemas/Pet" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/Pet" } } } }, "responses": { "200": { "description": "Successful operation", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Pet" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/Pet" } } } }, "400": { "description": "Invalid ID supplied" }, "404": { "description": "Pet not found" }, "405": { "description": "Validation exception" } }, "security": [ { "petstore_auth": [ "write:pets", "read:pets" ] } ], "tags": [ "pet" ] } }, "/pet/findByStatus": { "get": { "operationId": "findPetsByStatus", "summary": "Finds Pets by status", "description": "Multiple status values can be provided with comma separated strings", "parameters": [ { "name": "status", "in": "query", "description": "Status values that need to be considered for filter", "required": false, "schema": { "type": "string", "default": "available", "enum": [ "available", "pending", "sold" ] }, "explode": true } ], "responses": { "200": { "description": "successful operation", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Pet" } } }, "application/xml": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Pet" } } } } }, "400": { "description": "Invalid status value" } }, "security": [ { "petstore_auth": [ "write:pets", "read:pets" ] } ], "tags": [ "pet" ] } } }, "components": { "schemas": { "Address": { "type": "object", "properties": { "street": { "type": "string", "example": "437 Lytton" }, "city": { "type": "string", "example": "Palo Alto" }, "state": { "type": "string", "example": "CA" }, "zip": { "type": "string", "example": 94301 } }, "xml": { "name": "address" } }, "ApiResponse": { "type": "object", "properties": { "code": { "type": "integer", "format": "int32" }, "type": { "type": "string" }, "message": { "type": "string" } }, "xml": { "name": "##default" } }, "Category": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "example": 1 }, "name": { "type": "string", "example": "Dogs" } }, "x-swagger-router-model": "io.swagger.petstore.model.Category", "xml": { "name": "category" } }, "Customer": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "example": 100000 }, "username": { "type": "string", "example": "fehguy" }, "address": { "type": "array", "items": { "$ref": "#/components/schemas/Address" }, "xml": { "wrapped": true, "name": "addresses" } } }, "xml": { "name": "customer" } }, "Order": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "example": 10 }, "petId": { "type": "integer", "format": "int64", "example": 198772 }, "quantity": { "type": "integer", "format": "int32", "example": 7 }, "shipDate": { "type": "string", "format": "date-time" }, "status": { "description": "Order Status", "type": "string", "example": "approved", "enum": [ "placed", "approved", "delivered" ] }, "complete": { "type": "boolean" } }, "x-swagger-router-model": "io.swagger.petstore.model.Order", "xml": { "name": "order" } }, "Pet": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "example": 10 }, "name": { "type": "string", "example": "doggie" }, "category": { "$ref": "#/components/schemas/Category" }, "photoUrls": { "type": "array", "items": { "type": "string", "xml": { "name": "photoUrl" } }, "xml": { "wrapped": true } }, "tags": { "type": "array", "items": { "$ref": "#/components/schemas/Tag", "xml": { "name": "tag" } }, "xml": { "wrapped": true } }, "status": { "description": "pet status in the store", "type": "string", "enum": [ "available", "pending", "sold" ] } }, "required": [ "name", "photoUrls" ], "x-swagger-router-model": "io.swagger.petstore.model.Pet", "xml": { "name": "pet" } }, "Tag": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" } }, "x-swagger-router-model": "io.swagger.petstore.model.Tag", "xml": { "name": "tag" } }, "User": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "example": 10 }, "username": { "type": "string", "example": "theUser" }, "firstName": { "type": "string", "example": "John" }, "lastName": { "type": "string", "example": "James" }, "email": { "type": "string", "example": "john@email.com" }, "password": { "type": "string", "example": 12345 }, "phone": { "type": "string", "example": 12345 }, "userStatus": { "description": "User Status", "type": "integer", "format": "int32", "example": 1 } }, "x-swagger-router-model": "io.swagger.petstore.model.User", "xml": { "name": "user" } } }, "requestBodies": { "Pet": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Pet" } }, "application/xml": { "schema": { "$ref": "#/components/schemas/Pet" } } }, "description": "Pet object that needs to be added to the store" }, "UserArray": { "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/User" } } } }, "description": "List of user object" } }, "securitySchemes": { "api_key": { "type": "apiKey", "name": "api_key", "in": "header" }, "petstore_auth": { "type": "oauth2", "flows": { "implicit": { "authorizationUrl": "https://petstore.swagger.io/oauth/authorize", "scopes": { "write:pets": "modify pets in your account", "read:pets": "read your pets" } } } } } }, "tags": [ { "name": "pet", "description": "Everything about your Pets", "externalDocs": { "description": "Find out more", "url": "http://swagger.io" } } ], "externalDocs": { "description": "Find out more about Swagger", "url": "http://swagger.io" } }