Skip to content

Instantly share code, notes, and snippets.

@vishcious
Created February 28, 2017 15:59
Show Gist options
  • Save vishcious/7bceb7369a18f81f840cab63863fbe2d to your computer and use it in GitHub Desktop.
Save vishcious/7bceb7369a18f81f840cab63863fbe2d to your computer and use it in GitHub Desktop.
{
"swagger": "2.0",
"info": {
"description": "This is a sample server Petstore server. You can find out more about Swagger at <a href='http://swagger.wordnik.com'>http://swagger.wordnik.com</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key 'special-key' to test the authorization filters",
"version": "1.0.0",
"title": "Petstore API",
"contact": {},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},
"host": "petstore.swagger.wordnik.com",
"basePath": "/api",
"tags": [
{
"name": "Pet",
"description": "Operations about pets"
},
{
"name": "Store",
"description": "Operations about store"
},
{
"name": "User",
"description": "Operations about user"
}
],
"schemes": [
"https"
],
"paths": {
"/pet": {
"post": {
"tags": [
"Pet"
],
"summary": "Add a new pet to the store",
"operationId": "addPet",
"consumes": [
"application/json",
"application/xml",
"text/xml"
],
"parameters": [
{
"in": "body",
"name": "body",
"required": false,
"schema": {
"$ref": "#/definitions/Pet"
}
}
],
"responses": {
"200": {
"description": "Success"
},
"405": {
"description": "Status 405"
}
}
},
"put": {
"tags": [
"Pet"
],
"summary": "Update an existing pet",
"operationId": "updatePet",
"consumes": [
"application/json",
"application/xml",
"text/xml"
],
"parameters": [
{
"in": "body",
"name": "body",
"required": false,
"schema": {
"$ref": "#/definitions/Pet"
}
}
],
"responses": {
"200": {
"description": "Success"
},
"400": {
"description": "Status 400"
},
"404": {
"description": "Status 404"
},
"405": {
"description": "Status 405"
}
}
}
},
"/pet/findByStatus": {
"get": {
"tags": [
"Pet"
],
"summary": "Finds Pets by status",
"description": "Multiple status values can be provided with comma separated strings",
"operationId": "findPetsByStatus",
"produces": [
"application/json",
"application/xml",
"text/xml"
],
"parameters": [
{
"name": "status",
"in": "query",
"description": "Status values that need to be considered for filter",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Pet"
}
}
},
"400": {
"description": "Status 400"
}
}
}
},
"/pet/findByTags": {
"get": {
"tags": [
"Pet"
],
"summary": "Finds Pets by tags",
"description": "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
"operationId": "findPetsByTags",
"produces": [
"application/json",
"application/xml",
"text/xml"
],
"parameters": [
{
"name": "tags",
"in": "query",
"description": "Tags to filter by",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Pet"
}
}
},
"400": {
"description": "Status 400"
}
}
}
},
"/pet/{petId}": {
"get": {
"tags": [
"Pet"
],
"summary": "Find pet by ID",
"description": "Returns a single pet",
"operationId": "getPetById",
"produces": [
"application/json",
"application/xml",
"text/xml"
],
"parameters": [
{
"name": "petId",
"in": "path",
"description": "ID of pet that needs to be fetched",
"required": true,
"type": "integer",
"format": "int64"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/Pet"
}
},
"400": {
"description": "Status 400"
},
"404": {
"description": "Status 404"
}
}
},
"post": {
"tags": [
"Pet"
],
"summary": "Updates a pet in the store with form data",
"operationId": "updatePetWithForm",
"parameters": [
{
"name": "petId",
"in": "path",
"description": "ID of pet that needs to be fetched",
"required": true,
"type": "integer",
"format": "int64"
}
],
"responses": {
"200": {
"description": "Success"
},
"405": {
"description": "Status 405"
}
}
},
"delete": {
"tags": [
"Pet"
],
"summary": "Deletes a pet",
"operationId": "deletePet",
"parameters": [
{
"name": "petId",
"in": "path",
"description": "ID of pet that needs to be fetched",
"required": true,
"type": "integer",
"format": "int64"
}
],
"responses": {
"200": {
"description": "Success"
},
"400": {
"description": "Status 400"
}
}
}
},
"/store/order": {
"post": {
"tags": [
"Store"
],
"summary": "Place an order for a pet",
"operationId": "placeOrder",
"consumes": [
"application/json"
],
"parameters": [
{
"in": "body",
"name": "body",
"required": false,
"schema": {
"$ref": "#/definitions/Order"
}
}
],
"responses": {
"200": {
"description": "Success"
},
"400": {
"description": "Status 400"
}
}
}
},
"/store/order/{orderId}": {
"get": {
"tags": [
"Store"
],
"summary": "Find purchase order by ID",
"description": "For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions",
"operationId": "getOrderById",
"produces": [
"application/json"
],
"parameters": [
{
"name": "orderId",
"in": "path",
"description": "ID of the order that needs to be deleted",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/Order"
}
},
"400": {
"description": "Status 400"
},
"404": {
"description": "Status 404"
}
}
},
"delete": {
"tags": [
"Store"
],
"summary": "Delete purchase order by ID",
"description": "For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors",
"operationId": "deleteOrder",
"parameters": [
{
"name": "orderId",
"in": "path",
"description": "ID of the order that needs to be deleted",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Success"
},
"400": {
"description": "Status 400"
},
"404": {
"description": "Status 404"
}
}
}
},
"/user": {
"post": {
"tags": [
"User"
],
"summary": "Create user",
"description": "This can only be done by the logged in user.",
"operationId": "createUser",
"consumes": [
"application/json"
],
"parameters": [
{
"in": "body",
"name": "body",
"required": false,
"schema": {
"$ref": "#/definitions/User"
}
}
],
"responses": {
"200": {
"description": "Success"
}
}
}
},
"/user/createWithArray": {
"post": {
"tags": [
"User"
],
"summary": "Creates list of users with given input array",
"operationId": "createUsersWithArrayInput",
"consumes": [
"application/json"
],
"parameters": [
{
"in": "body",
"name": "body",
"required": false,
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/User"
}
}
}
],
"responses": {
"200": {
"description": "Success"
}
}
}
},
"/user/createWithList": {
"post": {
"tags": [
"User"
],
"summary": "Creates list of users with given list input",
"operationId": "createUsersWithListInput",
"consumes": [
"application/json"
],
"parameters": [
{
"in": "body",
"name": "body",
"required": false,
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/User"
}
}
}
],
"responses": {
"200": {
"description": "Success"
}
}
}
},
"/user/{userlogin}": {
"get": {
"tags": [
"User"
],
"summary": "Get user by user name",
"operationId": "getUserByName",
"produces": [
"application/json"
],
"parameters": [
{
"name": "userlogin",
"in": "path",
"description": "name that need to be deleted",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/User"
}
},
"400": {
"description": "Status 400"
},
"404": {
"description": "Status 404"
}
}
},
"put": {
"tags": [
"User"
],
"summary": "Updated user",
"description": "This can only be done by the logged in user.",
"operationId": "updateUser",
"consumes": [
"application/json"
],
"parameters": [
{
"name": "userlogin",
"in": "path",
"description": "name that need to be deleted",
"required": true,
"type": "string"
},
{
"in": "body",
"name": "body",
"required": false,
"schema": {
"$ref": "#/definitions/User"
}
}
],
"responses": {
"200": {
"description": "Success"
},
"400": {
"description": "Status 400"
},
"404": {
"description": "Status 404"
}
}
},
"delete": {
"tags": [
"User"
],
"summary": "Delete user",
"description": "This can only be done by the logged in user.",
"operationId": "deleteUser",
"parameters": [
{
"name": "userlogin",
"in": "path",
"description": "name that need to be deleted",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Success"
},
"400": {
"description": "Status 400"
},
"404": {
"description": "Status 404"
}
}
}
}
},
"definitions": {
"Tag": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int32"
},
"name": {
"type": "string"
}
}
},
"Pet": {
"type": "object",
"required": [
"id",
"name"
],
"properties": {
"id": {
"type": "integer",
"format": "int32",
"description": "unique identifier for the pet"
},
"category": {
"$ref": "#/definitions/Category"
},
"name": {
"type": "string"
},
"photoUrls": {
"type": "array",
"items": {
"type": "string"
}
},
"tags": {
"type": "array",
"items": {
"$ref": "#/definitions/Tag"
}
},
"status": {
"type": "string",
"description": "pet status in the store"
}
}
},
"Category": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int32"
},
"name": {
"type": "string"
}
}
},
"Order": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int32"
},
"petId": {
"type": "integer",
"format": "int32"
},
"quantity": {
"type": "integer",
"format": "int32"
},
"status": {
"type": "string",
"description": "Order Status"
},
"shipDate": {
"type": "string"
}
}
},
"User": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int32"
},
"firstName": {
"type": "string"
},
"userlogin": {
"type": "string"
},
"lastName": {
"type": "string"
},
"email": {
"type": "string"
},
"password": {
"type": "string"
},
"phone": {
"type": "string"
},
"userStatus": {
"type": "integer",
"format": "int32",
"description": "User Status"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment