1{
2 "swagger": "2.0",
3 "info": {
4 "version": "1.0.0",
5 "title": "Swagger Petstore",
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 "email": "foo@example.com",
11 "url": "http://madskristensen.net"
12 },
13 "license": {
14 "name": "MIT",
15 "url": "http://github.com/gruntjs/grunt/blob/master/LICENSE-MIT"
16 }
17 },
18 "host": "petstore.swagger.wordnik.com",
19 "basePath": "/api",
20 "schemes": [
21 "http"
22 ],
23 "consumes": [
24 "application/json"
25 ],
26 "produces": [
27 "application/json"
28 ],
29 "paths": {
30 "/pets": {
31 "get": {
32 "description": "Returns all pets from the system that the user has access to",
33 "operationId": "findPets",
34 "produces": [
35 "application/json",
36 "application/xml",
37 "text/xml",
38 "text/html"
39 ],
40 "parameters": [
41 {
42 "name": "tags",
43 "in": "query",
44 "description": "tags to filter by",
45 "required": false,
46 "type": "array",
47 "items": {
48 "type": "string"
49 },
50 "collectionFormat": "csv"
51 },
52 {
53 "name": "limit",
54 "in": "query",
55 "description": "maximum number of results to return",
56 "required": false,
57 "type": "integer",
58 "format": "int32"
59 }
60 ],
61 "responses": {
62 "200": {
63 "description": "pet response",
64 "schema": {
65 "type": "array",
66 "items": {
67 "$ref": "#/definitions/pet"
68 }
69 }
70 },
71 "default": {
72 "description": "unexpected error",
73 "schema": {
74 "$ref": "#/definitions/errorModel"
75 }
76 }
77 }
78 },
79 "post": {
80 "description": "Creates a new pet in the store. Duplicates are allowed",
81 "operationId": "addPet",
82 "produces": [
83 "application/json"
84 ],
85 "parameters": [
86 {
87 "name": "pet",
88 "in": "body",
89 "description": "Pet to add to the store",
90 "required": true,
91 "schema": {
92 "$ref": "#/definitions/newPet"
93 }
94 }
95 ],
96 "responses": {
97 "200": {
98 "description": "pet response",
99 "schema": {
100 "$ref": "#/definitions/pet"
101 }
102 },
103 "default": {
104 "description": "unexpected error",
105 "schema": {
106 "$ref": "#/definitions/errorModel"
107 }
108 }
109 }
110 }
111 },
112 "/pets/{id}": {
113 "get": {
114 "description": "Returns a user based on a single ID, if the user does not have access to the pet",
115 "operationId": "findPetById",
116 "produces": [
117 "application/json",
118 "application/xml",
119 "text/xml",
120 "text/html"
121 ],
122 "parameters": [
123 {
124 "name": "id",
125 "in": "path",
126 "description": "ID of pet to fetch",
127 "required": true,
128 "type": "integer",
129 "format": "int64"
130 }
131 ],
132 "responses": {
133 "200": {
134 "description": "pet response",
135 "schema": {
136 "$ref": "#/definitions/pet"
137 }
138 },
139 "default": {
140 "description": "unexpected error",
141 "schema": {
142 "$ref": "#/definitions/errorModel"
143 }
144 }
145 }
146 },
147 "delete": {
148 "description": "deletes a single pet based on the ID supplied",
149 "operationId": "deletePet",
150 "parameters": [
151 {
152 "name": "id",
153 "in": "path",
154 "description": "ID of pet to delete",
155 "required": true,
156 "type": "integer",
157 "format": "int64"
158 }
159 ],
160 "responses": {
161 "204": {
162 "description": "pet deleted"
163 },
164 "default": {
165 "description": "unexpected error",
166 "schema": {
167 "$ref": "#/definitions/errorModel"
168 }
169 }
170 }
171 }
172 }
173 },
174 "definitions": {
175 "pet": {
176 "required": [
177 "id",
178 "name"
179 ],
180 "properties": {
181 "id": {
182 "type": "integer",
183 "format": "int64"
184 },
185 "name": {
186 "type": "string"
187 },
188 "tag": {
189 "type": "string"
190 }
191 }
192 },
193 "newPet": {
194 "allOf": [
195 {
196 "$ref": "pet"
197 },
198 {
199 "required": [
200 "name"
201 ],
202 "properties": {
203 "id": {
204 "type": "integer",
205 "format": "int64"
206 }
207 }
208 }
209 ]
210 },
211 "errorModel": {
212 "required": [
213 "code",
214 "message"
215 ],
216 "properties": {
217 "code": {
218 "type": "integer",
219 "format": "int32"
220 },
221 "message": {
222 "type": "string"
223 }
224 }
225 }
226 }
227}
View as plain text