Skip to content

Instantly share code, notes, and snippets.

@maheeka
Created September 20, 2016 09:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maheeka/4eaedd2e2e0765959a4166865bf9adf9 to your computer and use it in GitHub Desktop.
Save maheeka/4eaedd2e2e0765959a4166865bf9adf9 to your computer and use it in GitHub Desktop.
{
"basePath": "/v2",
"definitions": {
"Category": {
"properties": {
"id": {
"format": "int64",
"type": "integer"
},
"name": {
"type": "string"
}
},
"type": "object",
"xml": {
"name": "Category"
}
},
"Pet": {
"properties": {
"category": {
"$ref": "#/definitions/Category"
},
"id": {
"format": "int64",
"type": "integer"
},
"name": {
"example": "doggie",
"type": "string"
},
"photoUrls": {
"items": {
"type": "string"
},
"type": "array",
"xml": {
"name": "photoUrl",
"wrapped": true
}
},
"status": {
"description": "pet status in the store",
"enum": [
"available",
"pending",
"sold"
],
"type": "string"
},
"tags": {
"items": {
"$ref": "#/definitions/Tag"
},
"type": "array",
"xml": {
"name": "tag",
"wrapped": true
}
}
},
"required": [
"name",
"photoUrls"
],
"type": "object",
"xml": {
"name": "Pet"
}
},
"Tag": {
"properties": {
"id": {
"format": "int64",
"type": "integer"
},
"name": {
"type": "string"
}
},
"type": "object",
"xml": {
"name": "Tag"
}
}
},
"externalDocs": {
"description": "Find out more about Swagger",
"url": "http://swagger.io"
},
"host": "petstore.swagger.io",
"info": {
"contact": {
"email": "apiteam@swagger.io"
},
"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.",
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
},
"termsOfService": "http://swagger.io/terms/",
"title": "Swagger Petstore",
"version": "1.0.0"
},
"paths": {
"/pet": {
"post": {
"consumes": [
"application/json",
"application/xml"
],
"description": "",
"operationId": "addPet",
"parameters": [
{
"description": "Pet object that needs to be added to the store",
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/Pet"
}
}
],
"produces": [
"application/xml",
"application/json"
],
"responses": {
"405": {
"description": "Invalid input"
}
},
"security": [
{
"petstore_auth": [
"write:pets",
"read:pets"
]
}
],
"summary": "Add a new pet to the store",
"tags": [
"pet"
]
},
"put": {
"consumes": [
"application/json",
"application/xml"
],
"description": "",
"operationId": "updatePet",
"parameters": [
{
"description": "Pet object that needs to be added to the store",
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/Pet"
}
}
],
"produces": [
"application/xml",
"application/json"
],
"responses": {
"400": {
"description": "Invalid ID supplied"
},
"404": {
"description": "Pet not found"
},
"405": {
"description": "Validation exception"
}
},
"security": [
{
"petstore_auth": [
"write:pets",
"read:pets"
]
}
],
"summary": "Update an existing pet",
"tags": [
"pet"
]
}
},
"/pet/{petId}": {
"delete": {
"description": "",
"operationId": "deletePet",
"parameters": [
{
"in": "header",
"name": "api_key",
"required": false,
"type": "string"
},
{
"description": "Pet id to delete",
"format": "int64",
"in": "path",
"name": "petId",
"required": true,
"type": "integer"
}
],
"produces": [
"application/xml",
"application/json"
],
"responses": {
"400": {
"description": "Invalid ID supplied"
},
"404": {
"description": "Pet not found"
}
},
"security": [
{
"petstore_auth": [
"write:pets",
"read:pets"
]
}
],
"summary": "Deletes a pet",
"tags": [
"pet"
]
},
"get": {
"description": "Returns a single pet",
"operationId": "getPetById",
"parameters": [
{
"description": "ID of pet to return",
"format": "int64",
"in": "path",
"name": "petId",
"required": true,
"type": "integer"
}
],
"produces": [
"application/xml",
"application/json"
],
"responses": {
"200": {
"description": "successful operation",
"schema": {
"$ref": "#/definitions/Pet"
}
},
"400": {
"description": "Invalid ID supplied"
},
"404": {
"description": "Pet not found"
}
},
"security": [
{
"api_key": []
}
],
"summary": "Find pet by ID",
"tags": [
"pet"
]
},
"post": {
"consumes": [
"application/x-www-form-urlencoded"
],
"description": "",
"operationId": "updatePetWithForm",
"parameters": [
{
"description": "ID of pet that needs to be updated",
"format": "int64",
"in": "path",
"name": "petId",
"required": true,
"type": "integer"
},
{
"description": "Updated name of the pet",
"in": "formData",
"name": "name",
"required": false,
"type": "string"
},
{
"description": "Updated status of the pet",
"in": "formData",
"name": "status",
"required": false,
"type": "string"
}
],
"produces": [
"application/xml",
"application/json"
],
"responses": {
"405": {
"description": "Invalid input"
}
},
"security": [
{
"petstore_auth": [
"write:pets",
"read:pets"
]
}
],
"summary": "Updates a pet in the store with form data",
"tags": [
"pet"
]
}
}
},
"schemes": [
"http"
],
"securityDefinitions": {
"api_key": {
"in": "header",
"name": "api_key",
"type": "apiKey"
},
"petstore_auth": {
"authorizationUrl": "http://petstore.swagger.io/oauth/dialog",
"flow": "implicit",
"scopes": {
"read:pets": "read your pets",
"write:pets": "modify pets in your account"
},
"type": "oauth2"
}
},
"swagger": "2.0",
"tags": [
{
"description": "Everything about your Pets",
"externalDocs": {
"description": "Find out more",
"url": "http://swagger.io"
},
"name": "pet"
},
{
"description": "Access to Petstore orders",
"name": "store"
},
{
"description": "Operations about user",
"externalDocs": {
"description": "Find out more about our store",
"url": "http://swagger.io"
},
"name": "user"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment