Last active
August 9, 2016 15:50
-
-
Save xbklairith/4504f7d53295cb47669d208a870f3825 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
swagger: '2.0' | |
info: | |
version: 1.0.0 | |
title: Swager api sample | |
description: | | |
#### Swagger API description example | |
schemes: | |
- https | |
host: swagger-api-sample.herokuapp.com | |
paths: | |
/: | |
get: | |
responses: | |
200: | |
description: Echo OK | |
/pokemon/list: | |
get: | |
responses: | |
200: | |
description: Return all as array | |
schema: | |
type: array | |
items: | |
$ref: '#/definitions/Monster' | |
/pokemon/info/{monsterName}: | |
get: | |
parameters: | |
- name: monsterName | |
in: path | |
required: true | |
type: string | |
responses: | |
200: | |
description: Return a monster from name | |
schema: | |
$ref: '#/definitions/Monster' | |
/pokemon/add: | |
post: | |
description: Add new Pokemon | |
parameters: | |
- name: newMonster | |
in: body | |
required: true | |
schema: | |
$ref: '#/definitions/Monster' | |
responses: | |
200: | |
description: Return added monster | |
schema: | |
$ref: '#/definitions/Monster' | |
definitions: | |
Monster: | |
type: object | |
properties: | |
name: | |
type: string | |
description: Pokemon name | |
hp: | |
type: number | |
description: Max health points | |
atk: | |
type: number | |
description: atk damages |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment