| 1 |
{ |
| 2 |
"swagger": "2.0", |
| 3 |
"info": { |
| 4 |
"version": "1.0.9-abcd", |
| 5 |
"title": "Swagger Sample API", |
| 6 |
"description": "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification", |
| 7 |
"termsOfService": "http://helloreverb.com/terms/", |
| 8 |
"contact": { |
| 9 |
"name": "wordnik api team", |
| 10 |
"url": "http://developer.wordnik.com" |
| 11 |
}, |
| 12 |
"license": { |
| 13 |
"name": "Creative Commons 4.0 International", |
| 14 |
"url": "http://creativecommons.org/licenses/by/4.0/" |
| 15 |
} |
| 16 |
}, |
| 17 |
"host": "my.api.com", |
| 18 |
"basePath": "/v1", |
| 19 |
"schemes": [ |
| 20 |
"http", |
| 21 |
"https" |
| 22 |
], |
| 23 |
"consumes": [ |
| 24 |
"text/plain; charset=utf-8", |
| 25 |
"application/json", |
| 26 |
"application/vnd.github+json", |
| 27 |
"application/vnd.github.v3+json", |
| 28 |
"application/vnd.github.v3.raw+json", |
| 29 |
"application/vnd.github.v3.text+json", |
| 30 |
"application/vnd.github.v3.html+json", |
| 31 |
"application/vnd.github.v3.full+json", |
| 32 |
"application/vnd.github.v3.diff", |
| 33 |
"application/vnd.github.v3.patch" |
| 34 |
], |
| 35 |
"produces": [ |
| 36 |
"application/json", |
| 37 |
"application/xml" |
| 38 |
], |
| 39 |
"paths": { |
| 40 |
"/pets/{id}": { |
| 41 |
"parameters": [ |
| 42 |
{ |
| 43 |
"name": "id", |
| 44 |
"in": "path", |
| 45 |
"description": "ID of pet to use", |
| 46 |
"required": true, |
| 47 |
"type": "array", |
| 48 |
"items": { |
| 49 |
"type": "string" |
| 50 |
}, |
| 51 |
"collectionFormat": "csv" |
| 52 |
} |
| 53 |
], |
| 54 |
"get": { |
| 55 |
"description": "Returns pets based on ID", |
| 56 |
"summary": "Find pets by ID", |
| 57 |
"operationId": "getPetsById", |
| 58 |
"produces": [ |
| 59 |
"application/json", |
| 60 |
"text/html" |
| 61 |
], |
| 62 |
"responses": { |
| 63 |
"200": { |
| 64 |
"description": "pet response", |
| 65 |
"schema": { |
| 66 |
"type": "array", |
| 67 |
"items": { |
| 68 |
"$ref": "Pet" |
| 69 |
} |
| 70 |
} |
| 71 |
}, |
| 72 |
"default": { |
| 73 |
"description": "error payload", |
| 74 |
"schema": { |
| 75 |
"$ref": "ErrorModel" |
| 76 |
} |
| 77 |
} |
| 78 |
} |
| 79 |
} |
| 80 |
} |
| 81 |
}, |
| 82 |
"definitions": { |
| 83 |
"Pet": { |
| 84 |
"required": [ |
| 85 |
"name" |
| 86 |
], |
| 87 |
"properties": { |
| 88 |
"name": { |
| 89 |
"type": "string" |
| 90 |
}, |
| 91 |
"tag": { |
| 92 |
"type": "string" |
| 93 |
} |
| 94 |
} |
| 95 |
}, |
| 96 |
"ErrorModel": { |
| 97 |
"required": [ "code", "message" ], |
| 98 |
"properties": { |
| 99 |
"code": { |
| 100 |
"type": "integer", |
| 101 |
"format": "int32" |
| 102 |
}, |
| 103 |
"message": { |
| 104 |
"type": "string" |
| 105 |
} |
| 106 |
} |
| 107 |
} |
| 108 |
} |
| 109 |
} |