· 6 years ago · Mar 17, 2020, 06:42 AM
1swagger: "2.0"
2info:
3 description: "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters."
4 version: "1.0.0"
5 title: "Swagger Petstore"
6 termsOfService: "http://swagger.io/terms/"
7 contact:
8 email: "apiteam@swagger.io"
9 license:
10 name: "Apache 2.0"
11 url: "http://www.apache.org/licenses/LICENSE-2.0.html"
12host: "petstore.swagger.io"
13basePath: "/v2"
14tags:
15- name: "pet"
16 description: "Everything about your Pets"
17 externalDocs:
18 description: "Find out more"
19 url: "http://swagger.io"
20- name: "store"
21 description: "Access to Petstore orders"
22- name: "user"
23 description: "Operations about user"
24 externalDocs:
25 description: "Find out more about our store"
26 url: "http://swagger.io"
27schemes:
28- "https"
29- "http"
30paths:
31 /pet:
32 get:
33 tags:
34 - "pet"
35 summary: "Finds Pets by status"
36 description: "Multiple status values can be provided with comma separated strings"
37 operationId: "findPetsByStatus"
38 produces:
39 - "application/xml"
40 - "application/json"
41 parameters:
42 - name: "status"
43 in: "query"
44 description: "Status values that need to be considered for filter"
45 required: true
46 type: "array"
47 items:
48 type: "string"
49 enum:
50 - "available"
51 - "pending"
52 - "sold"
53 default: "available"
54 collectionFormat: "multi"
55 responses:
56 200:
57 description: "successful operation"
58 schema:
59 type: "array"
60 items:
61 $ref: "#/definitions/Pet"
62 400:
63 description: "Invalid status value"
64 security:
65 - petstore_auth:
66 - "write:pets"
67 - "read:pets"
68 /pet:
69 get:
70 tags:
71 - "pet"
72 summary: "Finds all Pets"
73 description: "Finds and returns all pets"
74 operationId: "findPets"
75 produces:
76 - "application/xml"
77 - "application/json"
78 responses:
79 200:
80 description: "successful operation"
81 schema:
82 type: "array"
83 items:
84 $ref: "#/definitions/Pet"
85 400:
86 description: "Invalid status value"
87 security:
88 - petstore_auth:
89 - "write:pets"
90 - "read:pets"
91
92securityDefinitions:
93 petstore_auth:
94 type: "oauth2"
95 authorizationUrl: "http://petstore.swagger.io/oauth/dialog"
96 flow: "implicit"
97 scopes:
98 write:pets: "modify pets in your account"
99 read:pets: "read your pets"
100 api_key:
101 type: "apiKey"
102 name: "api_key"
103 in: "header"
104definitions:
105 Order:
106 type: "object"
107 properties:
108 id:
109 type: "integer"
110 format: "int64"
111 petId:
112 type: "integer"
113 format: "int64"
114 quantity:
115 type: "integer"
116 format: "int32"
117 shipDate:
118 type: "string"
119 format: "date-time"
120 status:
121 type: "string"
122 description: "Order Status"
123 enum:
124 - "placed"
125 - "approved"
126 - "delivered"
127 complete:
128 type: "boolean"
129 default: false
130 xml:
131 name: "Order"
132 Category:
133 type: "object"
134 properties:
135 id:
136 type: "integer"
137 format: "int64"
138 name:
139 type: "string"
140 xml:
141 name: "Category"
142 User:
143 type: "object"
144 properties:
145 id:
146 type: "integer"
147 format: "int64"
148 username:
149 type: "string"
150 firstName:
151 type: "string"
152 lastName:
153 type: "string"
154 email:
155 type: "string"
156 password:
157 type: "string"
158 phone:
159 type: "string"
160 userStatus:
161 type: "integer"
162 format: "int32"
163 description: "User Status"
164 xml:
165 name: "User"
166 Tag:
167 type: "object"
168 properties:
169 id:
170 type: "integer"
171 format: "int64"
172 name:
173 type: "string"
174 xml:
175 name: "Tag"
176 Pet:
177 type: "object"
178 required:
179 - "name"
180 - "photoUrls"
181 properties:
182 id:
183 type: "integer"
184 format: "int64"
185 category:
186 $ref: "#/definitions/Category"
187 name:
188 type: "string"
189 example: "doggie"
190 photoUrls:
191 type: "array"
192 xml:
193 name: "photoUrl"
194 wrapped: true
195 items:
196 type: "string"
197 tags:
198 type: "array"
199 xml:
200 name: "tag"
201 wrapped: true
202 items:
203 $ref: "#/definitions/Tag"
204 status:
205 type: "string"
206 description: "pet status in the store"
207 enum:
208 - "available"
209 - "pending"
210 - "sold"
211 xml:
212 name: "Pet"
213 ApiResponse:
214 type: "object"
215 properties:
216 code:
217 type: "integer"
218 format: "int32"
219 type:
220 type: "string"
221 message:
222 type: "string"
223externalDocs:
224 description: "Find out more about Swagger"
225 url: "http://swagger.io"