Skip to content

Instantly share code, notes, and snippets.

@chmac
Last active August 29, 2015 14:08
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 chmac/43bf148f476496b79207 to your computer and use it in GitHub Desktop.
Save chmac/43bf148f476496b79207 to your computer and use it in GitHub Desktop.
heroku-pets.yaml JSONified
{
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "PetStore on Heroku"
},
"host": "petstore-api.herokuapp.com",
"basePath": "/pet",
"paths": {
"/": {
"get": {
"responses": {
"200": {
"description": "List all pets"
}
}
},
"post": {
"parameters": [
{
"name": "pet",
"in": "body",
"description": "The pet JSON you want to post",
"schema": {
"$ref": "#/definitions/Pet"
},
"required": true
}
],
"responses": {
"200": {
"description": "Make a new pet"
}
}
},
"put": {
"parameters": [
{
"name": "pet",
"in": "body",
"description": "The pet JSON you want to post",
"schema": {
"$ref": "#/definitions/Pet"
},
"required": true
}
],
"responses": {
"200": {
"description": "Updates the pet"
}
}
}
},
"/{petId}": {
"get": {
"parameters": [
{
"name": "petId",
"type": "string",
"in": "path",
"description": "ID of the pet",
"required": true
}
],
"responses": {
"200": {
"description": "Sends the pet with pet Id"
}
}
}
}
},
"definitions": {
"Pet": {
"properties": {
"name": {
"type": "string"
},
"birthday": {
"type": "integer",
"format": "int32"
},
"phone": {
"$ref": "Phone"
},
"owner": {
"$ref": "Owner"
}
},
"required": [
"name",
"birthday",
"species"
]
},
"Phone": {
"properties": {
"code": {
"type": "string"
},
"number": {
"type": "string"
}
}
},
"Owner": {
"properties": {
"name": {
"type": "string"
},
"phone": {
"$ref": "Phone"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment