1+ openapi : " 3.0.0"
2+ externalDocs :
3+ url : petstore.com
4+ description : Pet Store website
5+ info :
6+ version : 1.0.0
7+ contact :
8+ name : John Smith
9+ 10+ url : petstore.com
11+ title : OpenAPI Spec 3.0 Petstore
12+ license :
13+ name : MIT
14+ servers :
15+ - url : http://petstore.swagger.io/v1
16+ description : prodcutive env
17+ - url : http://qa.petstore.swagger.io/v1
18+ description : qa env
19+ - url : http://dev.petstore.swagger.io/v1
20+ description : dev env
21+
22+ components :
23+
24+ responses :
25+ " 200 " :
26+ description : " ok"
27+ content :
28+ application/json :
29+ schema :
30+ $ref : " #/components/schemas/Pet"
31+ example :
32+ $ref : " #/components/schemas/Pet"
33+ links :
34+ UserRepositories :
35+ # returns array of '#/components/schemas/repository'
36+ operationRef : ' https://na2.gigantic-server.com/#/paths/~12.0~1repositories~1{username}/get'
37+ parameters :
38+ username : $response.body#/username
39+ securitySchemes :
40+ api_key :
41+ type : " apiKey"
42+ description : Api key security
43+ name : " api_key"
44+ in : " header"
45+ petstore_auth :
46+ type : oauth2
47+ flows :
48+ implicit :
49+ authorizationUrl : https://example.com/api/oauth/dialog
50+ scopes :
51+ write:pets : modify pets in your account
52+ read:pets : read your pets
53+ authorizationCode :
54+ authorizationUrl : https://example.com/api/oauth/dialog
55+ tokenUrl : https://example.com/api/oauth/token
56+ scopes :
57+ write:pets : modify pets in your account
58+ read:pets : read your pets
59+ examples :
60+ petsArrayExample :
61+ summary : s
62+ description : aaa
63+ value :
64+ -
65+ id : 233
66+ name : Archie
67+ -
68+ id : 455
69+ name : Bella
70+ petExample1 :
71+ description : pet1
72+ value :
73+ id : 2333
74+ name : Max
75+ petExample2 :
76+ description : pet2
77+ value :
78+ id : 344
79+ name : Brea
80+ errorExample :
81+ value :
82+ code : 1400
83+ message : Unexpected error
84+ schemas :
85+ Pet :
86+ type : object
87+ required :
88+ - id
89+ - name
90+ properties :
91+ id :
92+ type : integer
93+ format : int64
94+ name :
95+ type : string
96+ tag :
97+ type : string
98+ Pets :
99+ type : array
100+ items :
101+ $ref : " #/components/schemas/Pet"
102+ Error :
103+ type : object
104+ required :
105+ - code
106+ - message
107+ properties :
108+ code :
109+ type : integer
110+ format : int32
111+ message :
112+ type : string
113+ paths :
114+ /pets :
115+ get :
116+ summary : List all pets
117+ operationId : listPets
118+ tags :
119+ - pets
120+ parameters :
121+ - name : limit
122+ in : query
123+ description : how many items to return at one time (max 100)
124+ required : false
125+ schema :
126+ type : integer
127+ format : int32
128+ responses :
129+ " 200 " :
130+
131+ description : A paged array of pets
132+ headers :
133+ x-next :
134+ description : A link
135+ schema :
136+ type : string
137+ content :
138+ application/json :
139+ schema :
140+ $ref : " #/components/schemas/Pets"
141+ examples :
142+ pet1 :
143+ $ref : " #/components/examples/petsArrayExample"
144+
145+ post :
146+ summary : Create a pet
147+
148+ requestBody :
149+ content :
150+ application/json :
151+ schema :
152+ $ref : " #/components/schemas/Pet"
153+
154+ examples :
155+ e1 :
156+ $ref : " #/components/examples/petExample1"
157+
158+
159+ tags :
160+ - pets
161+ responses :
162+ " 201 " :
163+ description : Null response
164+ default :
165+ description : unexpected error
166+ content :
167+ application/json :
168+ schema :
169+ $ref : " #/components/schemas/Error"
170+ examples :
171+ err1 :
172+ $ref : " #/components/examples/errorExample"
173+ /pets/{petId} :
174+ get :
175+ summary : Info for specific pet
176+ operationId : showPetById
177+ tags :
178+ - pets
179+ parameters :
180+ - name : petId
181+ in : path
182+ required : true
183+ description : The id of the pet to retrieve
184+ schema :
185+ type : string
186+ responses :
187+ default :
188+
189+ $ref : " #/components/responses/200"
190+ " 200 " :
191+ description : Expected response to a valid request
192+ content :
193+ application/json :
194+ schema :
195+ $ref : " #/components/schemas/Pet"
196+
197+ examples :
198+ one :
199+ $ref : " #/components/examples/petExample1"
200+ /users/{id} :
201+ parameters :
202+ - name : id
203+ in : path
204+ required : true
205+ description : the user identifier, as userId
206+ schema :
207+ type : string
208+ get :
209+ responses :
210+
211+ ' 200 ' :
212+ description : the user being returned
213+ content :
214+ application/json :
215+ schema :
216+ type : object
217+ properties :
218+ uuid : # the unique user id
219+ type : string
220+ format : uuid
221+ links :
222+ address :
223+ # the target link operationId
224+ operationId : getUserAddress
225+ parameters :
226+ # get the `id` field from the request path parameter named `id`
227+ userId : $request.path.id
228+ # the path item of the linked operation
229+ /users/{userid}/address :
230+ parameters :
231+ - name : userid
232+ in : path
233+ required : true
234+ description : the user identifier, as userId
235+ schema :
236+ type : string
237+ # linked operation
238+ get :
239+ operationId : getUserAddress
240+ responses :
241+ ' 200 ' :
242+ description : the user's address
243+ content :
244+ application/json :
245+ schema :
246+ type : object
247+ properties :
248+ addressLine1 :
249+ type : string
250+ country :
251+ type : string
252+ example :
253+ addressLine1 : Washintong 3434
254+ country : USA
0 commit comments