1 | swagger: "2.0"
|
2 | info:
|
3 | version: 1.0.0
|
4 | title: Swagger Petstore
|
5 | license:
|
6 | name: MIT
|
7 | host: petstore.swagger.io
|
8 | basePath: /v1
|
9 | schemes:
|
10 | - http
|
11 | consumes:
|
12 | - application/json
|
13 | produces:
|
14 | - application/json
|
15 | paths:
|
16 | /pets:
|
17 | get:
|
18 | summary: List all pets
|
19 | operationId: listPets
|
20 | tags:
|
21 | - foo
|
22 | parameters:
|
23 | - name: limit
|
24 | in: query
|
25 | description: How many items to return at one time (max 100).
|
26 | required: false
|
27 | type: integer
|
28 | format: int32
|
29 | responses:
|
30 | 200:
|
31 | description: An paged array of pets
|
32 | headers:
|
33 | x-next:
|
34 | type: string
|
35 | description: A link to the next page of responses
|
36 | schema:
|
37 | $ref: '#/definitions/Pets'
|
38 | default:
|
39 | description: unexpected error
|
40 | schema:
|
41 | $ref: '#/definitions/Error'
|
42 | post:
|
43 | summary: Create a pet
|
44 | operationId: createPets
|
45 | tags:
|
46 | - pets
|
47 | responses:
|
48 | 201:
|
49 | description: Null response
|
50 | default:
|
51 | description: unexpected error
|
52 | schema:
|
53 | $ref: '#/definitions/Error'
|
54 | /pets/{petId}:
|
55 | get:
|
56 | summary: |
|
57 | Info for a specific pet or
|
58 | a long sentance over a few
|
59 | lines
|
60 | operationId: showPetById
|
61 | tags:
|
62 | - pets
|
63 | parameters:
|
64 | - name: petId
|
65 | in: path
|
66 | required: true
|
67 | description: The id of the pet to retrieve
|
68 | type: string
|
69 | responses:
|
70 | 200:
|
71 | description: Expected response to a valid request
|
72 | schema:
|
73 | $ref: '#/definitions/Pets'
|
74 | default:
|
75 | description: unexpected error
|
76 | schema:
|
77 | $ref: '#/definitions/Error'
|
78 | definitions:
|
79 | Pet:
|
80 | required:
|
81 | - id
|
82 | - name
|
83 | properties:
|
84 | id:
|
85 | type: integer
|
86 | format: int64
|
87 | name:
|
88 | type: string
|
89 | tag:
|
90 | type: string
|
91 | Pets:
|
92 | type: array
|
93 | items:
|
94 | $ref: '#/definitions/Pet'
|
95 | Error:
|
96 | required:
|
97 | - code
|
98 | - message
|
99 | properties:
|
100 | code:
|
101 | type: integer
|
102 | format: int32
|
103 | message:
|
104 | type: string
|