ASCP_API
/
swagger.yaml
718 строк · 17.3 Кб
1---
2swagger: "2.0"
3info:
4description: "This is a sample server Petstore server. You can find out more about\
5\ Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).\
6\ For this sample, you can use the api key `special-key` to test the authorization\
7\ filters."
8version: "1.0.5"
9title: "Swagger Petstore"
10termsOfService: "http://swagger.io/terms/"
11contact:
12email: "apiteam@swagger.io"
13license:
14name: "Apache 2.0"
15url: "http://www.apache.org/licenses/LICENSE-2.0.html"
16host: "petstore.swagger.io"
17basePath: "/v2"
18tags:
19- name: "pet"
20description: "Everything about your Pets"
21externalDocs:
22description: "Find out more"
23url: "http://swagger.io"
24- name: "store"
25description: "Access to Petstore orders"
26- name: "user"
27description: "Operations about user"
28externalDocs:
29description: "Find out more about our store"
30url: "http://swagger.io"
31schemes:
32- "https"
33- "http"
34paths:
35/pet/{petId}/uploadImage:
36post:
37tags:
38- "pet"
39summary: "uploads an image"
40description: ""
41operationId: "uploadFile"
42consumes:
43- "multipart/form-data"
44produces:
45- "application/json"
46parameters:
47- name: "petId"
48in: "path"
49description: "ID of pet to update"
50required: true
51type: "integer"
52format: "int64"
53- name: "additionalMetadata"
54in: "formData"
55description: "Additional data to pass to server"
56required: false
57type: "string"
58- name: "file"
59in: "formData"
60description: "file to upload"
61required: false
62type: "file"
63responses:
64200:
65description: "successful operation"
66schema:
67$ref: "#/definitions/ApiResponse"
68security:
69- petstore_auth:
70- "write:pets"
71- "read:pets"
72/pet:
73post:
74tags:
75- "pet"
76summary: "Add a new pet to the store"
77description: ""
78operationId: "addPet"
79consumes:
80- "application/json"
81- "application/xml"
82produces:
83- "application/json"
84- "application/xml"
85parameters:
86- in: "body"
87name: "body"
88description: "Pet object that needs to be added to the store"
89required: true
90schema:
91$ref: "#/definitions/Pet"
92responses:
93405:
94description: "Invalid input"
95security:
96- petstore_auth:
97- "write:pets"
98- "read:pets"
99put:
100tags:
101- "pet"
102summary: "Update an existing pet"
103description: ""
104operationId: "updatePet"
105consumes:
106- "application/json"
107- "application/xml"
108produces:
109- "application/json"
110- "application/xml"
111parameters:
112- in: "body"
113name: "body"
114description: "Pet object that needs to be added to the store"
115required: true
116schema:
117$ref: "#/definitions/Pet"
118responses:
119400:
120description: "Invalid ID supplied"
121404:
122description: "Pet not found"
123405:
124description: "Validation exception"
125security:
126- petstore_auth:
127- "write:pets"
128- "read:pets"
129/pet/findByStatus:
130get:
131tags:
132- "pet"
133summary: "Finds Pets by status"
134description: "Multiple status values can be provided with comma separated strings"
135operationId: "findPetsByStatus"
136produces:
137- "application/json"
138- "application/xml"
139parameters:
140- name: "status"
141in: "query"
142description: "Status values that need to be considered for filter"
143required: true
144type: "array"
145items:
146type: "string"
147enum:
148- "available"
149- "pending"
150- "sold"
151default: "available"
152collectionFormat: "multi"
153responses:
154200:
155description: "successful operation"
156schema:
157type: "array"
158items:
159$ref: "#/definitions/Pet"
160400:
161description: "Invalid status value"
162security:
163- petstore_auth:
164- "write:pets"
165- "read:pets"
166/pet/findByTags:
167get:
168tags:
169- "pet"
170summary: "Finds Pets by tags"
171description: "Multiple tags can be provided with comma separated strings. Use\
172\ tag1, tag2, tag3 for testing."
173operationId: "findPetsByTags"
174produces:
175- "application/json"
176- "application/xml"
177parameters:
178- name: "tags"
179in: "query"
180description: "Tags to filter by"
181required: true
182type: "array"
183items:
184type: "string"
185collectionFormat: "multi"
186responses:
187200:
188description: "successful operation"
189schema:
190type: "array"
191items:
192$ref: "#/definitions/Pet"
193400:
194description: "Invalid tag value"
195security:
196- petstore_auth:
197- "write:pets"
198- "read:pets"
199deprecated: true
200/pet/{petId}:
201get:
202tags:
203- "pet"
204summary: "Find pet by ID"
205description: "Returns a single pet"
206operationId: "getPetById"
207produces:
208- "application/json"
209- "application/xml"
210parameters:
211- name: "petId"
212in: "path"
213description: "ID of pet to return"
214required: true
215type: "integer"
216format: "int64"
217responses:
218200:
219description: "successful operation"
220schema:
221$ref: "#/definitions/Pet"
222400:
223description: "Invalid ID supplied"
224404:
225description: "Pet not found"
226security:
227- api_key: []
228post:
229tags:
230- "pet"
231summary: "Updates a pet in the store with form data"
232description: ""
233operationId: "updatePetWithForm"
234consumes:
235- "application/x-www-form-urlencoded"
236produces:
237- "application/json"
238- "application/xml"
239parameters:
240- name: "petId"
241in: "path"
242description: "ID of pet that needs to be updated"
243required: true
244type: "integer"
245format: "int64"
246- name: "name"
247in: "formData"
248description: "Updated name of the pet"
249required: false
250type: "string"
251- name: "status"
252in: "formData"
253description: "Updated status of the pet"
254required: false
255type: "string"
256responses:
257405:
258description: "Invalid input"
259security:
260- petstore_auth:
261- "write:pets"
262- "read:pets"
263delete:
264tags:
265- "pet"
266summary: "Deletes a pet"
267description: ""
268operationId: "deletePet"
269produces:
270- "application/json"
271- "application/xml"
272parameters:
273- name: "api_key"
274in: "header"
275required: false
276type: "string"
277- name: "petId"
278in: "path"
279description: "Pet id to delete"
280required: true
281type: "integer"
282format: "int64"
283responses:
284400:
285description: "Invalid ID supplied"
286404:
287description: "Pet not found"
288security:
289- petstore_auth:
290- "write:pets"
291- "read:pets"
292/store/order:
293post:
294tags:
295- "store"
296summary: "Place an order for a pet"
297description: ""
298operationId: "placeOrder"
299consumes:
300- "application/json"
301produces:
302- "application/json"
303- "application/xml"
304parameters:
305- in: "body"
306name: "body"
307description: "order placed for purchasing the pet"
308required: true
309schema:
310$ref: "#/definitions/Order"
311responses:
312200:
313description: "successful operation"
314schema:
315$ref: "#/definitions/Order"
316400:
317description: "Invalid Order"
318/store/order/{orderId}:
319get:
320tags:
321- "store"
322summary: "Find purchase order by ID"
323description: "For valid response try integer IDs with value >= 1 and <= 10.\
324\ Other values will generated exceptions"
325operationId: "getOrderById"
326produces:
327- "application/json"
328- "application/xml"
329parameters:
330- name: "orderId"
331in: "path"
332description: "ID of pet that needs to be fetched"
333required: true
334type: "integer"
335maximum: 10
336minimum: 1
337format: "int64"
338responses:
339200:
340description: "successful operation"
341schema:
342$ref: "#/definitions/Order"
343400:
344description: "Invalid ID supplied"
345404:
346description: "Order not found"
347delete:
348tags:
349- "store"
350summary: "Delete purchase order by ID"
351description: "For valid response try integer IDs with positive integer value.\
352\ Negative or non-integer values will generate API errors"
353operationId: "deleteOrder"
354produces:
355- "application/json"
356- "application/xml"
357parameters:
358- name: "orderId"
359in: "path"
360description: "ID of the order that needs to be deleted"
361required: true
362type: "integer"
363minimum: 1
364format: "int64"
365responses:
366400:
367description: "Invalid ID supplied"
368404:
369description: "Order not found"
370/store/inventory:
371get:
372tags:
373- "store"
374summary: "Returns pet inventories by status"
375description: "Returns a map of status codes to quantities"
376operationId: "getInventory"
377produces:
378- "application/json"
379parameters: []
380responses:
381200:
382description: "successful operation"
383schema:
384type: "object"
385additionalProperties:
386type: "integer"
387format: "int32"
388security:
389- api_key: []
390/user/createWithArray:
391post:
392tags:
393- "user"
394summary: "Creates list of users with given input array"
395description: ""
396operationId: "createUsersWithArrayInput"
397consumes:
398- "application/json"
399produces:
400- "application/json"
401- "application/xml"
402parameters:
403- in: "body"
404name: "body"
405description: "List of user object"
406required: true
407schema:
408type: "array"
409items:
410$ref: "#/definitions/User"
411responses:
412default:
413description: "successful operation"
414/user/createWithList:
415post:
416tags:
417- "user"
418summary: "Creates list of users with given input array"
419description: ""
420operationId: "createUsersWithListInput"
421consumes:
422- "application/json"
423produces:
424- "application/json"
425- "application/xml"
426parameters:
427- in: "body"
428name: "body"
429description: "List of user object"
430required: true
431schema:
432type: "array"
433items:
434$ref: "#/definitions/User"
435responses:
436default:
437description: "successful operation"
438/user/{username}:
439get:
440tags:
441- "user"
442summary: "Get user by user name"
443description: ""
444operationId: "getUserByName"
445produces:
446- "application/json"
447- "application/xml"
448parameters:
449- name: "username"
450in: "path"
451description: "The name that needs to be fetched. Use user1 for testing. "
452required: true
453type: "string"
454responses:
455200:
456description: "successful operation"
457schema:
458$ref: "#/definitions/User"
459400:
460description: "Invalid username supplied"
461404:
462description: "User not found"
463put:
464tags:
465- "user"
466summary: "Updated user"
467description: "This can only be done by the logged in user."
468operationId: "updateUser"
469consumes:
470- "application/json"
471produces:
472- "application/json"
473- "application/xml"
474parameters:
475- name: "username"
476in: "path"
477description: "name that need to be updated"
478required: true
479type: "string"
480- in: "body"
481name: "body"
482description: "Updated user object"
483required: true
484schema:
485$ref: "#/definitions/User"
486responses:
487400:
488description: "Invalid user supplied"
489404:
490description: "User not found"
491delete:
492tags:
493- "user"
494summary: "Delete user"
495description: "This can only be done by the logged in user."
496operationId: "deleteUser"
497produces:
498- "application/json"
499- "application/xml"
500parameters:
501- name: "username"
502in: "path"
503description: "The name that needs to be deleted"
504required: true
505type: "string"
506responses:
507400:
508description: "Invalid username supplied"
509404:
510description: "User not found"
511/user/login:
512get:
513tags:
514- "user"
515summary: "Logs user into the system"
516description: ""
517operationId: "loginUser"
518produces:
519- "application/json"
520- "application/xml"
521parameters:
522- name: "username"
523in: "query"
524description: "The user name for login"
525required: true
526type: "string"
527- name: "password"
528in: "query"
529description: "The password for login in clear text"
530required: true
531type: "string"
532responses:
533200:
534description: "successful operation"
535headers:
536X-Expires-After:
537type: "string"
538format: "date-time"
539description: "date in UTC when token expires"
540X-Rate-Limit:
541type: "integer"
542format: "int32"
543description: "calls per hour allowed by the user"
544schema:
545type: "string"
546400:
547description: "Invalid username/password supplied"
548/user/logout:
549get:
550tags:
551- "user"
552summary: "Logs out current logged in user session"
553description: ""
554operationId: "logoutUser"
555produces:
556- "application/json"
557- "application/xml"
558parameters: []
559responses:
560default:
561description: "successful operation"
562/user:
563post:
564tags:
565- "user"
566summary: "Create user"
567description: "This can only be done by the logged in user."
568operationId: "createUser"
569consumes:
570- "application/json"
571produces:
572- "application/json"
573- "application/xml"
574parameters:
575- in: "body"
576name: "body"
577description: "Created user object"
578required: true
579schema:
580$ref: "#/definitions/User"
581responses:
582default:
583description: "successful operation"
584securityDefinitions:
585api_key:
586type: "apiKey"
587name: "api_key"
588in: "header"
589petstore_auth:
590type: "oauth2"
591authorizationUrl: "https://petstore.swagger.io/oauth/authorize"
592flow: "implicit"
593scopes:
594read:pets: "read your pets"
595write:pets: "modify pets in your account"
596definitions:
597ApiResponse:
598type: "object"
599properties:
600code:
601type: "integer"
602format: "int32"
603type:
604type: "string"
605message:
606type: "string"
607Category:
608type: "object"
609properties:
610id:
611type: "integer"
612format: "int64"
613name:
614type: "string"
615xml:
616name: "Category"
617Pet:
618type: "object"
619required:
620- "name"
621- "photoUrls"
622properties:
623id:
624type: "integer"
625format: "int64"
626category:
627$ref: "#/definitions/Category"
628name:
629type: "string"
630example: "doggie"
631photoUrls:
632type: "array"
633xml:
634wrapped: true
635items:
636type: "string"
637xml:
638name: "photoUrl"
639tags:
640type: "array"
641xml:
642wrapped: true
643items:
644xml:
645name: "tag"
646$ref: "#/definitions/Tag"
647status:
648type: "string"
649description: "pet status in the store"
650enum:
651- "available"
652- "pending"
653- "sold"
654xml:
655name: "Pet"
656Tag:
657type: "object"
658properties:
659id:
660type: "integer"
661format: "int64"
662name:
663type: "string"
664xml:
665name: "Tag"
666Order:
667type: "object"
668properties:
669id:
670type: "integer"
671format: "int64"
672petId:
673type: "integer"
674format: "int64"
675quantity:
676type: "integer"
677format: "int32"
678shipDate:
679type: "string"
680format: "date-time"
681status:
682type: "string"
683description: "Order Status"
684enum:
685- "placed"
686- "approved"
687- "delivered"
688complete:
689type: "boolean"
690xml:
691name: "Order"
692User:
693type: "object"
694properties:
695id:
696type: "integer"
697format: "int64"
698username:
699type: "string"
700firstName:
701type: "string"
702lastName:
703type: "string"
704email:
705type: "string"
706password:
707type: "string"
708phone:
709type: "string"
710userStatus:
711type: "integer"
712format: "int32"
713description: "User Status"
714xml:
715name: "User"
716externalDocs:
717description: "Find out more about Swagger"
718url: "http://swagger.io"
719