Skip to content

Instantly share code, notes, and snippets.

@owenconti
Created August 1, 2017 00:28
Show Gist options
  • Save owenconti/97429f8569e0600a482f03a1174f8f5e to your computer and use it in GitHub Desktop.
Save owenconti/97429f8569e0600a482f03a1174f8f5e 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 [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":"[email protected]"
},
"license":{
"name":"Apache 2.0",
"url":"http://www.apache.org/licenses/LICENSE-2.0.html"
}
},
"host":"petstore.swagger.io",
"basePath":"/v2",
"tags":[
{
"name":"pet",
"description":"Everything about your Pets",
"externalDocs":{
"description":"Find out more",
"url":"http://swagger.io"
}
}
],
"schemes":[
"http"
],
"paths":{
"/pet/findByStatus":{
"post":{
"tags":[
"pet"
],
"summary":"Finds Pets by status",
"description":"Multiple status values can be provided with comma separated strings",
"operationId":"findPetsByStatus",
"produces":[
"application/xml",
"application/json"
],
"parameters":[
{
"name":"optional",
"in":"query",
"description":"Status values that need to be considered for filter",
"required":false,
"type":"boolean"
},
{
"name":"required",
"in":"query",
"description":"Status values that need to be considered for filter",
"required":true,
"type":"boolean"
}
],
"responses":{
"200":{
"description":"successful operation",
"schema":{
"type":"array",
"items":{
"$ref":"#/definitions/Pet"
}
}
},
"400":{
"description":"Invalid status value"
}
},
"security":[
{
"petstore_auth":[
"write:pets",
"read:pets"
]
}
]
}
}
},
"securityDefinitions":{
"petstore_auth":{
"type":"oauth2",
"authorizationUrl":"http://petstore.swagger.io/oauth/dialog",
"flow":"implicit",
"scopes":{
"write:pets":"modify pets in your account",
"read:pets":"read your pets"
}
},
"api_key":{
"type":"apiKey",
"name":"api_key",
"in":"header"
}
},
"definitions":{
"Order":{
"type":"object",
"properties":{
"id":{
"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"
]
},
"complete":{
"type":"boolean",
"default":false
}
},
"xml":{
"name":"Order"
}
},
"Category":{
"type":"object",
"properties":{
"id":{
"type":"integer",
"format":"int64"
},
"name":{
"type":"string"
}
},
"xml":{
"name":"Category"
}
},
"User":{
"type":"object",
"properties":{
"id":{
"type":"integer",
"format":"int64"
},
"username":{
"type":"string"
},
"firstName":{
"type":"string"
},
"lastName":{
"type":"string"
},
"email":{
"type":"string"
},
"password":{
"type":"string"
},
"phone":{
"type":"string"
},
"userStatus":{
"type":"integer",
"format":"int32",
"description":"User Status"
}
},
"xml":{
"name":"User"
}
},
"Tag":{
"type":"object",
"properties":{
"id":{
"type":"integer",
"format":"int64"
},
"name":{
"type":"string"
}
},
"xml":{
"name":"Tag"
}
},
"Pet":{
"type":"object",
"required":[
"name",
"photoUrls"
],
"properties":{
"id":{
"type":"integer",
"format":"int64"
},
"category":{
"$ref":"#/definitions/Category"
},
"name":{
"type":"string",
"example":"doggie"
},
"photoUrls":{
"type":"array",
"xml":{
"name":"photoUrl",
"wrapped":true
},
"items":{
"type":"string"
}
},
"tags":{
"type":"array",
"xml":{
"name":"tag",
"wrapped":true
},
"items":{
"$ref":"#/definitions/Tag"
}
},
"status":{
"type":"string",
"description":"pet status in the store",
"enum":[
"available",
"pending",
"sold"
]
}
},
"xml":{
"name":"Pet"
}
},
"ApiResponse":{
"type":"object",
"properties":{
"code":{
"type":"integer",
"format":"int32"
},
"type":{
"type":"string"
},
"message":{
"type":"string"
}
}
}
},
"externalDocs":{
"description":"Find out more about Swagger",
"url":"http://swagger.io"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment