{ "swagger": "2.0", "info": { "description": "Api Documentation", "version": "1.0", "title": "Api Documentation", "termsOfService": "urn:tos", "contact": { }, "license": { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0" } }, "host": "petstore.swagger.io", "basePath": "/", "tags": [ { "name": "generic-pet-controller", "description": "Generic Pet Controller" }, { "name": "pet-controller", "description": "Operations about pets" }, { "name": "pet-store-resource", "description": "Operations about store" }, { "name": "user-controller", "description": "Operations about user" } ], "schemes": [ "https", "http" ], "produces": [ "application/xml", "application/json" ], "paths": { "/api/pet": { "post": { "tags": [ "pet-controller" ], "summary": "Add a new pet to the store", "operationId": "addPetUsingPOST_1", "consumes": [ "application/json" ], "produces": [ "application/xml", "application/json" ], "parameters": [ { "in": "body", "name": "pet", "description": "Pet object that needs to be added to the store", "required": true, "schema": { "$ref": "#/definitions/Pet" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "string" } }, "405": { "description": "Invalid input" } }, "security": [ { "petstore_auth": [ "write:pets", "read:pets" ] } ] }, "put": { "tags": [ "pet-controller" ], "summary": "Update an existing pet", "operationId": "updatePetUsingPUT_2", "consumes": [ "application/json" ], "produces": [ "application/xml", "application/json" ], "parameters": [ { "in": "body", "name": "pet", "description": "Pet object that needs to be added to the store", "required": true, "schema": { "$ref": "#/definitions/Pet" } } ], "responses": { "200": { "description": "OK", "schema": { "type": "string" } }, "400": { "description": "Invalid ID supplied" }, "404": { "description": "Pet not found" }, "405": { "description": "Validation exception" } }, "security": [ { "petstore_auth": [ "write:pets", "read:pets" ] } ] } }, "/api/pet/findByStatus": { "get": { "tags": [ "pet-controller" ], "summary": "Finds Pets by status", "description": "Multiple status values can be provided with comma-separated strings", "operationId": "findPetsByStatusUsingGET_2", "produces": [ "application/xml", "application/json" ], "parameters": [ { "name": "status", "in": "query", "description": "Status values that need to be considered for filter", "required": true, "type": "string", "default": "available", "allowEmptyValue": false, "enum": [ "available", "pending", "sold" ] } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/Pet" } } }, "400": { "description": "Invalid status value" } }, "security": [ { "petstore_auth": [ "write:pets", "read:pets" ] } ] } }, "/api/pet/findByTags": { "get": { "tags": [ "pet-controller" ], "summary": "Finds Pets by tags", "description": "Multiple tags can be provided with comma-separated strings. Use tag1, tag2, tag3 for testing.", "operationId": "findPetsByTagsUsingGET_2", "produces": [ "application/xml", "application/json" ], "parameters": [ { "name": "tags", "in": "query", "description": "Tags to filter by", "required": true, "type": "string", "allowEmptyValue": false } ], "responses": { "200": { "description": "OK", "schema": { "type": "array", "items": { "$ref": "#/definitions/Pet" } } }, "400": { "description": "Invalid tag value" } }, "security": [ { "petstore_auth": [ "write:pets", "read:pets" ] } ], "deprecated": true } }, "/api/pet/{petId}": { "get": { "tags": [ "pet-controller" ], "summary": "Find pet by ID", "description": "Returns a pet when ID < 10. ID > 10 or non-integers will simulate API error conditions", "operationId": "getPetByIdUsingGET_5", "produces": [ "application/xml", "application/json" ], "parameters": [ { "name": "petId", "in": "path", "description": "ID of pet that needs to be fetched", "required": true, "type": "string", "maximum": 5, "exclusiveMaximum": false, "minimum": 1, "exclusiveMinimum": false, "allowEmptyValue": false } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/Pet" } }, "400": { "description": "Invalid ID supplied", "headers": { "header1": { "type": "string" }, "header2": { "type": "string" }, "header3": { "type": "string" }, "header4": { "type": "string" } } }, "404": { "description": "Pet not found", "headers": { "header3": { "type": "string" }, "header4": { "type": "string" } } } }, "security": [ { "api_key": [ ] }, { "petstore_auth": [ "write:pets", "read:pets" ] } ] } }, "/api/store/order": { "post": { "tags": [ "pet-store-resource" ], "summary": "Place an order for a pet", "operationId": "placeOrderUsingPOST", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "complete", "in": "query", "required": false, "type": "boolean" }, { "name": "id", "in": "query", "required": false, "type": "integer", "format": "int64" }, { "name": "identifier", "in": "query", "required": false, "type": "integer", "format": "int64" }, { "name": "petId", "in": "query", "required": false, "type": "integer", "format": "int64" }, { "name": "quantity", "in": "query", "required": false, "type": "integer", "format": "int32" }, { "name": "shipDate", "in": "query", "required": false, "type": "string", "format": "date-time" }, { "name": "status", "in": "query", "description": "Order Status", "required": false, "type": "string", "enum": [ "placed", "approved", "delivered" ] } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/Order" } }, "400": { "description": "Invalid Order" } } } }, "/api/store/order/{orderId}": { "get": { "tags": [ "Pet Store" ], "summary": "Find purchase order by ID", "description": "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", "operationId": "getOrderByIdUsingGET", "produces": [ "application/json" ], "parameters": [ { "name": "orderId", "in": "path", "description": "ID of pet that needs to be fetched", "required": true, "type": "string", "maximum": 5, "exclusiveMaximum": false, "minimum": 1, "exclusiveMinimum": false, "allowEmptyValue": false } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/Order" } }, "400": { "description": "Invalid ID supplied" }, "404": { "description": "Order not found" } } }, "delete": { "tags": [ "pet-store-resource" ], "summary": "Delete purchase order by ID", "description": "For valid response try integer IDs with value < 1000. Anything above 1000 or non-integers will generate API errors", "operationId": "deleteOrderUsingDELETE", "produces": [ "application/json" ], "parameters": [ { "name": "orderId", "in": "path", "description": "ID of the order that needs to be deleted", "required": true, "type": "string", "exclusiveMaximum": false, "minimum": 1, "exclusiveMinimum": false, "allowEmptyValue": false } ], "responses": { "200": { "description": "OK", "schema": { "type": "string" } }, "400": { "description": "Invalid ID supplied" }, "404": { "description": "Order not found" } } } }, "/api/user": { "post": { "tags": [ "user-controller" ], "summary": "Create user", "description": "This can only be done by the logged in user.", "operationId": "createUserUsingPOST", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "in": "body", "name": "user", "description": "Created user object", "required": true, "schema": { "$ref": "#/definitions/User" } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/User" } } } } }, "/api/user/createWithArray": { "post": { "tags": [ "user-controller" ], "summary": "Creates list of users with given input array", "operationId": "createUsersWithArrayInputUsingPOST", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "in": "body", "name": "users", "description": "List of user object", "required": true, "schema": { "type": "array", "items": { "$ref": "#/definitions/User" } } } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/User" } } } } }, "/api/user/createWithList": { "post": { "tags": [ "user-controller" ], "summary": "Creates list of users with given input array", "operationId": "createUsersWithListInputUsingPOST", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "in": "body", "name": "users", "description": "List of user object", "required": true, "schema": { "type": "array", "items": { "$ref": "#/definitions/User" } } } ], "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/api/user/login": { "get": { "tags": [ "user-controller" ], "summary": "Logs user into the system", "operationId": "loginUserUsingGET", "produces": [ "application/json" ], "parameters": [ { "name": "password", "in": "query", "description": "The password for login in clear text", "required": true, "type": "string", "allowEmptyValue": false }, { "name": "username", "in": "query", "description": "The user name for login", "required": true, "type": "string", "allowEmptyValue": false } ], "responses": { "200": { "description": "OK", "schema": { "type": "string" } }, "400": { "description": "Invalid username/password supplied" } } } }, "/api/user/logout": { "get": { "tags": [ "user-controller" ], "summary": "Logs out current logged in user session", "operationId": "logoutUserUsingGET", "produces": [ "application/json" ], "responses": { "200": { "description": "OK", "schema": { "type": "string" } } } } }, "/api/user/{username}": { "get": { "tags": [ "user-controller" ], "summary": "Get user by user name", "operationId": "getUserByNameUsingGET", "produces": [ "application/json" ], "parameters": [ { "name": "username", "in": "path", "description": "The name that needs to be fetched. Use user1 for testing. ", "required": true, "type": "string", "allowEmptyValue": false } ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/User" } }, "400": { "description": "Invalid username supplied" }, "404": { "description": "User not found" } } }, "put": { "tags": [ "user-controller" ], "summary": "Updated user", "description": "This can only be done by the logged in user.", "operationId": "updateUserUsingPUT", "consumes": [ "application/json" ], "produces": [ "application/json" ], "parameters": [ { "name": "email", "in": "query", "required": false, "type": "string" }, { "name": "firstName", "in": "query", "required": false, "type": "string" }, { "name": "id", "in": "query", "required": false, "type": "integer", "format": "int64" }, { "name": "identifier", "in": "query", "required": false, "type": "string" }, { "name": "lastName", "in": "query", "required": false, "type": "string" }, { "name": "password", "in": "query", "required": false, "type": "string" }, { "name": "phone", "in": "query", "required": false, "type": "string" }, { "name": "userStatus", "in": "query", "description": "User Status", "required": false, "type": "integer", "format": "int32", "enum": [ "1-registered", "2-active", "3-closed" ] }, { "name": "username", "in": "path", "description": "name that need to be deleted", "required": true, "type": "string", "allowEmptyValue": false }, { "name": "username", "in": "query", "required": false, "type": "string" } ], "responses": { "200": { "description": "OK", "schema": { "type": "string" } }, "400": { "description": "Invalid user supplied" }, "404": { "description": "User not found" } } }, "delete": { "tags": [ "user-controller" ], "summary": "Delete user", "description": "This can only be done by the logged in user.", "operationId": "deleteUserUsingDELETE", "produces": [ "application/json" ], "parameters": [ { "name": "username", "in": "path", "description": "The name that needs to be deleted", "required": true, "type": "string", "allowEmptyValue": false } ], "responses": { "200": { "description": "OK", "schema": { "type": "string" } }, "400": { "description": "Invalid username supplied" }, "404": { "description": "User not found" } } } }, "/generic/pets/test": { "post": { "tags": [ "generic-pet-controller" ], "summary": "test", "operationId": "testUsingPOST_1", "consumes": [ "application/json" ], "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/Pet" } } } } } }, "securityDefinitions": { "api_key": { "type": "apiKey", "name": "api_key", "in": "header" }, "petstore_auth": { "type": "oauth2", "authorizationUrl": "http://petstore.swagger.io/api/oauth/dialog", "flow": "implicit", "scopes": { "write:pets": "modify pets in your account", "read:pets": "read your pets" } } }, "definitions": { "Category": { "type": "object", "required": [ "id" ], "properties": { "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" } }, "title": "Category" }, "Order": { "type": "object", "properties": { "complete": { "type": "boolean" }, "id": { "type": "integer", "format": "int64" }, "identifier": { "type": "integer", "format": "int64" }, "petId": { "type": "integer", "format": "int64" }, "quantity": { "type": "integer", "format": "int32" }, "shipDate": { "type": "string", "format": "date-time" }, "status": { "type": "string", "description": "Order Status", "enum": [ "placed", "approved", "delivered" ] } }, "title": "Order" }, "Pet": { "type": "object", "properties": { "category": { "$ref": "#/definitions/Category" }, "id": { "type": "integer", "format": "int64" }, "identifier": { "type": "integer", "format": "int64" }, "name": { "type": "string" }, "photoUrls": { "type": "array", "items": { "type": "string" } }, "status": { "type": "string", "description": "pet status in the store", "enum": [ "available", "pending", "sold" ] }, "tags": { "type": "array", "items": { "$ref": "#/definitions/Tag" } } }, "title": "Pet" }, "Tag": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, "name": { "type": "string" } }, "title": "Tag" }, "User": { "type": "object", "properties": { "email": { "type": "string" }, "firstName": { "type": "string" }, "id": { "type": "integer", "format": "int64" }, "identifier": { "type": "string" }, "lastName": { "type": "string" }, "password": { "type": "string" }, "phone": { "type": "string" }, "userStatus": { "type": "integer", "format": "int32", "description": "User Status" }, "username": { "type": "string" } }, "title": "User" } } }