| 1 |
swagger: '2.0' |
| 2 |
info: |
| 3 |
version: 1.0.9-abcd |
| 4 |
title: 'Swagger Sample API' |
| 5 |
description: 'A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification' |
| 6 |
termsOfService: 'http://helloreverb.com/terms/' |
| 7 |
contact: {name: 'wordnik api team', url: 'http://developer.wordnik.com'} |
| 8 |
license: {name: 'Creative Commons 4.0 International', url: 'http://creativecommons.org/licenses/by/4.0/'} |
| 9 |
host: my.api.com |
| 10 |
basePath: /v1 |
| 11 |
schemes: |
| 12 |
- http |
| 13 |
- https |
| 14 |
consumes: |
| 15 |
- application/json |
| 16 |
produces: |
| 17 |
- application/json |
| 18 |
- application/xml |
| 19 |
paths: |
| 20 |
'/pets/{petId}': {get: {description: 'Returns a pet based on ID', summary: 'Find pet by ID', operationId: getPetsById, produces: [application/json, text/html], parameters: [{name: petId, in: path, description: 'ID of pet that needs to be fetched', required: true, type: array, items: {type: string}, collectionFormat: csv}], responses: {'200': {description: 'pet response', schema: {$ref: Pet}, examples: {application/json: {id: 9, category: {name: domestic}, name: monster, tags: [{name: 'for sale'}], status: alive}}}, default: {description: 'error payload', schema: {$ref: ErrorModel}}}}} |
| 21 |
definitions: |
| 22 |
Pet: {required: [name], properties: {name: {type: string, example: cat}, tag: {type: string, example: 'for sale'}}} |
| 23 |
ErrorModel: {required: [code, message], properties: {code: {type: integer, format: int32}, message: {type: string}}} |