create-docusaurus-openapi-docs 0.0.0-1235

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/LICENSE +21 -0
  2. package/bin/index.js +36 -0
  3. package/lib/index.d.ts +4 -0
  4. package/lib/index.js +191 -0
  5. package/package.json +48 -0
  6. package/templates/default/blog/2019-05-28-first-blog-post.md +12 -0
  7. package/templates/default/blog/2019-05-29-long-blog-post.md +44 -0
  8. package/templates/default/blog/2021-08-01-mdx-blog-post.mdx +20 -0
  9. package/templates/default/blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg +0 -0
  10. package/templates/default/blog/2021-08-26-welcome/index.md +25 -0
  11. package/templates/default/blog/authors.yml +17 -0
  12. package/templates/default/docs/intro.md +49 -0
  13. package/templates/default/docs/petstore/add-pet.ParamsDetails.json +19 -0
  14. package/templates/default/docs/petstore/add-pet.RequestSchema.json +288 -0
  15. package/templates/default/docs/petstore/add-pet.StatusCodes.json +1 -0
  16. package/templates/default/docs/petstore/add-pet.api.mdx +45 -0
  17. package/templates/default/docs/petstore/create-user.RequestSchema.json +345 -0
  18. package/templates/default/docs/petstore/create-user.StatusCodes.json +1 -0
  19. package/templates/default/docs/petstore/create-user.api.mdx +45 -0
  20. package/templates/default/docs/petstore/create-users-with-array-input.RequestSchema.json +348 -0
  21. package/templates/default/docs/petstore/create-users-with-array-input.StatusCodes.json +1 -0
  22. package/templates/default/docs/petstore/create-users-with-array-input.api.mdx +47 -0
  23. package/templates/default/docs/petstore/create-users-with-list-input.RequestSchema.json +348 -0
  24. package/templates/default/docs/petstore/create-users-with-list-input.StatusCodes.json +1 -0
  25. package/templates/default/docs/petstore/create-users-with-list-input.api.mdx +47 -0
  26. package/templates/default/docs/petstore/delete-order.ParamsDetails.json +11 -0
  27. package/templates/default/docs/petstore/delete-order.RequestSchema.json +1 -0
  28. package/templates/default/docs/petstore/delete-order.StatusCodes.json +6 -0
  29. package/templates/default/docs/petstore/delete-order.api.mdx +49 -0
  30. package/templates/default/docs/petstore/delete-pet.ParamsDetails.json +18 -0
  31. package/templates/default/docs/petstore/delete-pet.RequestSchema.json +1 -0
  32. package/templates/default/docs/petstore/delete-pet.StatusCodes.json +1 -0
  33. package/templates/default/docs/petstore/delete-pet.api.mdx +43 -0
  34. package/templates/default/docs/petstore/delete-user.ParamsDetails.json +11 -0
  35. package/templates/default/docs/petstore/delete-user.RequestSchema.json +1 -0
  36. package/templates/default/docs/petstore/delete-user.StatusCodes.json +6 -0
  37. package/templates/default/docs/petstore/delete-user.api.mdx +45 -0
  38. package/templates/default/docs/petstore/find-pets-by-status.ParamsDetails.json +21 -0
  39. package/templates/default/docs/petstore/find-pets-by-status.RequestSchema.json +1 -0
  40. package/templates/default/docs/petstore/find-pets-by-status.StatusCodes.json +522 -0
  41. package/templates/default/docs/petstore/find-pets-by-status.api.mdx +51 -0
  42. package/templates/default/docs/petstore/find-pets-by-tags.ParamsDetails.json +12 -0
  43. package/templates/default/docs/petstore/find-pets-by-tags.RequestSchema.json +1 -0
  44. package/templates/default/docs/petstore/find-pets-by-tags.StatusCodes.json +522 -0
  45. package/templates/default/docs/petstore/find-pets-by-tags.api.mdx +55 -0
  46. package/templates/default/docs/petstore/get-inventory.RequestSchema.json +1 -0
  47. package/templates/default/docs/petstore/get-inventory.StatusCodes.json +15 -0
  48. package/templates/default/docs/petstore/get-inventory.api.mdx +43 -0
  49. package/templates/default/docs/petstore/get-order-by-id.ParamsDetails.json +16 -0
  50. package/templates/default/docs/petstore/get-order-by-id.RequestSchema.json +1 -0
  51. package/templates/default/docs/petstore/get-order-by-id.StatusCodes.json +127 -0
  52. package/templates/default/docs/petstore/get-order-by-id.api.mdx +49 -0
  53. package/templates/default/docs/petstore/get-pet-by-id.ParamsDetails.json +12 -0
  54. package/templates/default/docs/petstore/get-pet-by-id.RequestSchema.json +1 -0
  55. package/templates/default/docs/petstore/get-pet-by-id.StatusCodes.json +517 -0
  56. package/templates/default/docs/petstore/get-pet-by-id.api.mdx +49 -0
  57. package/templates/default/docs/petstore/get-user-by-name.ParamsDetails.json +11 -0
  58. package/templates/default/docs/petstore/get-user-by-name.RequestSchema.json +1 -0
  59. package/templates/default/docs/petstore/get-user-by-name.StatusCodes.json +683 -0
  60. package/templates/default/docs/petstore/get-user-by-name.api.mdx +47 -0
  61. package/templates/default/docs/petstore/login-user.ParamsDetails.json +18 -0
  62. package/templates/default/docs/petstore/login-user.RequestSchema.json +1 -0
  63. package/templates/default/docs/petstore/login-user.StatusCodes.json +29 -0
  64. package/templates/default/docs/petstore/login-user.api.mdx +43 -0
  65. package/templates/default/docs/petstore/logout-user.RequestSchema.json +1 -0
  66. package/templates/default/docs/petstore/logout-user.StatusCodes.json +1 -0
  67. package/templates/default/docs/petstore/logout-user.api.mdx +39 -0
  68. package/templates/default/docs/petstore/new-pet.RequestSchema.json +260 -0
  69. package/templates/default/docs/petstore/new-pet.StatusCodes.json +7 -0
  70. package/templates/default/docs/petstore/new-pet.api.mdx +45 -0
  71. package/templates/default/docs/petstore/pet.tag.mdx +15 -0
  72. package/templates/default/docs/petstore/place-order.RequestSchema.json +96 -0
  73. package/templates/default/docs/petstore/place-order.StatusCodes.json +133 -0
  74. package/templates/default/docs/petstore/place-order.api.mdx +43 -0
  75. package/templates/default/docs/petstore/schemas/cat.Schema.json +224 -0
  76. package/templates/default/docs/petstore/schemas/cat.schema.mdx +30 -0
  77. package/templates/default/docs/petstore/sidebar.ts +180 -0
  78. package/templates/default/docs/petstore/store.tag.mdx +15 -0
  79. package/templates/default/docs/petstore/subscribe-to-the-store-events.RequestSchema.2.json +28 -0
  80. package/templates/default/docs/petstore/subscribe-to-the-store-events.RequestSchema.3.json +28 -0
  81. package/templates/default/docs/petstore/subscribe-to-the-store-events.RequestSchema.4.json +25 -0
  82. package/templates/default/docs/petstore/subscribe-to-the-store-events.RequestSchema.5.json +20 -0
  83. package/templates/default/docs/petstore/subscribe-to-the-store-events.RequestSchema.json +27 -0
  84. package/templates/default/docs/petstore/subscribe-to-the-store-events.StatusCodes.2.json +21 -0
  85. package/templates/default/docs/petstore/subscribe-to-the-store-events.StatusCodes.3.json +17 -0
  86. package/templates/default/docs/petstore/subscribe-to-the-store-events.StatusCodes.4.json +9 -0
  87. package/templates/default/docs/petstore/subscribe-to-the-store-events.StatusCodes.5.json +9 -0
  88. package/templates/default/docs/petstore/subscribe-to-the-store-events.StatusCodes.json +20 -0
  89. package/templates/default/docs/petstore/subscribe-to-the-store-events.api.mdx +120 -0
  90. package/templates/default/docs/petstore/swagger-petstore-yaml.info.mdx +249 -0
  91. package/templates/default/docs/petstore/update-pet-with-form.ParamsDetails.json +11 -0
  92. package/templates/default/docs/petstore/update-pet-with-form.RequestSchema.json +22 -0
  93. package/templates/default/docs/petstore/update-pet-with-form.StatusCodes.json +1 -0
  94. package/templates/default/docs/petstore/update-pet-with-form.api.mdx +49 -0
  95. package/templates/default/docs/petstore/update-pet.ParamsDetails.json +19 -0
  96. package/templates/default/docs/petstore/update-pet.RequestSchema.json +288 -0
  97. package/templates/default/docs/petstore/update-pet.StatusCodes.json +7 -0
  98. package/templates/default/docs/petstore/update-pet.api.mdx +43 -0
  99. package/templates/default/docs/petstore/update-user.ParamsDetails.json +11 -0
  100. package/templates/default/docs/petstore/update-user.RequestSchema.json +345 -0
  101. package/templates/default/docs/petstore/update-user.StatusCodes.json +6 -0
  102. package/templates/default/docs/petstore/update-user.api.mdx +45 -0
  103. package/templates/default/docs/petstore/upload-file.ParamsDetails.json +11 -0
  104. package/templates/default/docs/petstore/upload-file.RequestSchema.json +10 -0
  105. package/templates/default/docs/petstore/upload-file.StatusCodes.json +20 -0
  106. package/templates/default/docs/petstore/upload-file.api.mdx +43 -0
  107. package/templates/default/docs/petstore/user.tag.mdx +15 -0
  108. package/templates/default/docs/tutorial-basics/_category_.json +8 -0
  109. package/templates/default/docs/tutorial-basics/congratulations.md +23 -0
  110. package/templates/default/docs/tutorial-basics/create-a-blog-post.md +36 -0
  111. package/templates/default/docs/tutorial-basics/create-a-document.md +55 -0
  112. package/templates/default/docs/tutorial-basics/create-a-page.md +45 -0
  113. package/templates/default/docs/tutorial-basics/deploy-your-site.md +31 -0
  114. package/templates/default/docs/tutorial-basics/markdown-features.mdx +145 -0
  115. package/templates/default/docs/tutorial-extras/_category_.json +7 -0
  116. package/templates/default/docs/tutorial-extras/manage-docs-versions.md +57 -0
  117. package/templates/default/docs/tutorial-extras/translate-your-site.md +90 -0
  118. package/templates/default/docusaurus.config.ts +273 -0
  119. package/templates/default/examples/petstore.yaml +1271 -0
  120. package/templates/default/gitignore +21 -0
  121. package/templates/default/package.json +44 -0
  122. package/templates/default/sidebars.ts +37 -0
  123. package/templates/default/src/components/HomepageFeatures/index.js +64 -0
  124. package/templates/default/src/components/HomepageFeatures/styles.module.css +11 -0
  125. package/templates/default/src/css/custom.css +77 -0
  126. package/templates/default/src/pages/index.js +42 -0
  127. package/templates/default/src/pages/index.module.css +23 -0
  128. package/templates/default/src/pages/markdown-page.md +7 -0
  129. package/templates/default/static/.nojekyll +0 -0
  130. package/templates/default/static/img/docusaurus.png +0 -0
  131. package/templates/default/static/img/favicon.ico +0 -0
  132. package/templates/default/static/img/logo.svg +1 -0
  133. package/templates/default/static/img/tutorial/docsVersionDropdown.png +0 -0
  134. package/templates/default/static/img/tutorial/localeDropdown.png +0 -0
  135. package/templates/default/static/img/undraw_docusaurus_mountain.svg +171 -0
  136. package/templates/default/static/img/undraw_docusaurus_react.svg +170 -0
  137. package/templates/default/static/img/undraw_docusaurus_tree.svg +40 -0
  138. package/templates/default/tsconfig.json +10 -0
@@ -0,0 +1,1271 @@
1
+ openapi: 3.0.0
2
+ servers:
3
+ - url: https://petstore.swagger.io/v2
4
+ description: Default server
5
+ - url: https://petstore.swagger.io/sandbox
6
+ description: Sandbox server
7
+ - url: http://127.0.0.1:4010
8
+ description: Prism Mock API (local)
9
+ info:
10
+ description: |
11
+ This is a sample server Petstore server.
12
+ You can find out more about Swagger at
13
+ [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).
14
+ For this sample, you can use the api key `special-key` to test the authorization filters.
15
+
16
+ ## Introduction
17
+ This API is documented in **OpenAPI format** and is based on
18
+ [Petstore sample](http://petstore.swagger.io/) provided by [swagger.io](http://swagger.io) team.
19
+ It was **extended** to illustrate features of [generator-openapi-repo](https://github.com/Rebilly/generator-openapi-repo)
20
+ tool and [ReDoc](https://github.com/Redocly/redoc) documentation. In addition to standard
21
+ OpenAPI syntax we use a few [vendor extensions](https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md).
22
+
23
+ ## OpenAPI Specification
24
+ This API is documented in **OpenAPI format** and is based on
25
+ [Petstore sample](http://petstore.swagger.io/) provided by [swagger.io](http://swagger.io) team.
26
+ It was **extended** to illustrate features of [generator-openapi-repo](https://github.com/Rebilly/generator-openapi-repo)
27
+ tool and [ReDoc](https://github.com/Redocly/redoc) documentation. In addition to standard
28
+ OpenAPI syntax we use a few [vendor extensions](https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md).
29
+
30
+ ## Cross-Origin Resource Sharing
31
+ This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/).
32
+ And that allows cross-domain communication from the browser.
33
+ All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
34
+
35
+ ## Authentication
36
+
37
+ Petstore offers two forms of authentication:
38
+ - API Key
39
+ - OAuth2
40
+
41
+ OAuth2 - an open protocol to allow secure authorization in a simple
42
+ and standard method from web, mobile and desktop applications.
43
+
44
+ version: 2.0.0
45
+ title: Swagger Petstore YAML
46
+ termsOfService: "http://swagger.io/terms/"
47
+ contact:
48
+ name: API Support
49
+ email: apiteam@swagger.io
50
+ url: https://github.com/Redocly/redoc
51
+ x-logo:
52
+ url: "https://redocly.github.io/redoc/petstore-logo.png"
53
+ altText: Petstore logo
54
+ x-dark-logo:
55
+ url: "/img/petstore-logo-dark.png"
56
+ altText: "Petstore dark logo"
57
+ license:
58
+ name: Apache 2.0
59
+ url: "http://www.apache.org/licenses/LICENSE-2.0.html"
60
+ externalDocs:
61
+ description: Find out how to create Github repo for your OpenAPI spec.
62
+ url: "https://github.com/Rebilly/generator-openapi-repo"
63
+ tags:
64
+ - name: pet
65
+ description: Everything about your Pets
66
+ x-displayName: Pets
67
+ - name: store
68
+ description: Access to Petstore orders
69
+ x-displayName: Petstore Orders
70
+ - name: user
71
+ description: Operations about user
72
+ x-displayName: Users
73
+ - name: pet_model
74
+ x-displayName: The Pet Model
75
+ description: |
76
+ <SchemaDefinition schemaRef="#/components/schemas/Pet" />
77
+ - name: store_model
78
+ x-displayName: The Order Model
79
+ description: |
80
+ <SchemaDefinition schemaRef="#/components/schemas/Order" exampleRef="#/components/examples/Order" showReadOnly={true} showWriteOnly={true} />
81
+ x-tagGroups:
82
+ - name: General
83
+ tags:
84
+ - pet
85
+ - store
86
+ - name: User Management
87
+ tags:
88
+ - user
89
+ - name: Models
90
+ tags:
91
+ - pet_model
92
+ - store_model
93
+ paths:
94
+ /pet:
95
+ parameters:
96
+ - name: Accept-Language
97
+ in: header
98
+ description: "The language you prefer for messages. Supported values are en-AU, en-CA, en-GB, en-US"
99
+ example: en-US
100
+ required: false
101
+ schema:
102
+ type: string
103
+ default: en-AU
104
+ - name: cookieParam
105
+ in: cookie
106
+ description: Some cookie
107
+ required: true
108
+ schema:
109
+ type: integer
110
+ format: int64
111
+ post:
112
+ tags:
113
+ - pet
114
+ summary: Add a new pet to the store
115
+ description: Add new pet to the store inventory.
116
+ operationId: addPet
117
+ responses:
118
+ "405":
119
+ description: Invalid input
120
+ security:
121
+ - petstore_auth:
122
+ - "write:pets"
123
+ - "read:pets"
124
+ - api_key: []
125
+ - ApiKeyAuth: []
126
+ - BasicAuth: []
127
+ - BearerAuth: []
128
+ - OAuth2: []
129
+ - OpenID: []
130
+
131
+ x-codeSamples:
132
+ - lang: "C#"
133
+ source: |
134
+ PetStore.v1.Pet pet = new PetStore.v1.Pet();
135
+ pet.setApiKey("your api key");
136
+ pet.petType = PetStore.v1.Pet.TYPE_DOG;
137
+ pet.name = "Rex";
138
+ // set other fields
139
+ PetStoreResponse response = pet.create();
140
+ if (response.statusCode == HttpStatusCode.Created)
141
+ {
142
+ // Successfully created
143
+ }
144
+ else
145
+ {
146
+ // Something wrong -- check response for errors
147
+ Console.WriteLine(response.getRawResponse());
148
+ }
149
+ - lang: PHP
150
+ label: Custom
151
+ source: |
152
+ $form = new \PetStore\Entities\Pet();
153
+ $form->setPetType("Dog");
154
+ $form->setName("Rex");
155
+ // set other fields
156
+ try {
157
+ $pet = $client->pets()->create($form);
158
+ } catch (UnprocessableEntityException $e) {
159
+ var_dump($e->getErrors());
160
+ }
161
+ requestBody:
162
+ $ref: "#/components/requestBodies/Pet"
163
+ put:
164
+ tags:
165
+ - pet
166
+ summary: Update an existing pet
167
+ description: ""
168
+ operationId: updatePet
169
+ responses:
170
+ "400":
171
+ description: Invalid ID supplied
172
+ "404":
173
+ description: Pet not found
174
+ "405":
175
+ description: Validation exception
176
+ security:
177
+ - petstore_auth:
178
+ - "write:pets"
179
+ - "read:pets"
180
+ x-codeSamples:
181
+ - lang: PHP
182
+ source: |
183
+ $form = new \PetStore\Entities\Pet();
184
+ $form->setPetId(1);
185
+ $form->setPetType("Dog");
186
+ $form->setName("Rex");
187
+ // set other fields
188
+ try {
189
+ $pet = $client->pets()->update($form);
190
+ } catch (UnprocessableEntityException $e) {
191
+ var_dump($e->getErrors());
192
+ }
193
+ requestBody:
194
+ $ref: "#/components/requestBodies/Pet"
195
+ "/pet/{petId}":
196
+ get:
197
+ tags:
198
+ - pet
199
+ summary: Find pet by ID
200
+ description: Returns a single pet
201
+ operationId: getPetById
202
+ parameters:
203
+ - name: petId
204
+ in: path
205
+ description: ID of pet to return
206
+ required: true
207
+ deprecated: true
208
+ schema:
209
+ type: integer
210
+ format: int64
211
+ responses:
212
+ "200":
213
+ description: successful operation
214
+ content:
215
+ application/json:
216
+ schema:
217
+ $ref: "#/components/schemas/Pet"
218
+ application/xml:
219
+ schema:
220
+ $ref: "#/components/schemas/Pet"
221
+
222
+ "400":
223
+ description: Invalid ID supplied
224
+ "404":
225
+ description: Pet not found
226
+ security:
227
+ - api_key: []
228
+ post:
229
+ tags:
230
+ - pet
231
+ summary: Updates a pet in the store with form data
232
+ description: ""
233
+ operationId: updatePetWithForm
234
+ parameters:
235
+ - name: petId
236
+ in: path
237
+ description: ID of pet that needs to be updated
238
+ required: true
239
+ schema:
240
+ type: integer
241
+ format: int64
242
+ responses:
243
+ "405":
244
+ description: Invalid input
245
+ security:
246
+ - petstore_auth:
247
+ - "write:pets"
248
+ - "read:pets"
249
+ requestBody:
250
+ content:
251
+ application/x-www-form-urlencoded:
252
+ schema:
253
+ type: object
254
+ properties:
255
+ name:
256
+ description: Updated name of the pet
257
+ type: string
258
+ status:
259
+ description: Updated status of the pet
260
+ type: string
261
+ delete:
262
+ tags:
263
+ - pet
264
+ summary: Deletes a pet
265
+ description: ""
266
+ operationId: deletePet
267
+ parameters:
268
+ - name: api_key
269
+ in: header
270
+ required: false
271
+ schema:
272
+ type: string
273
+ example: "Bearer <TOKEN>"
274
+ - name: petId
275
+ in: path
276
+ description: Pet id to delete
277
+ required: true
278
+ schema:
279
+ type: integer
280
+ format: int64
281
+ responses:
282
+ "400":
283
+ description: Invalid pet value
284
+ security:
285
+ - petstore_auth:
286
+ - "write:pets"
287
+ - "read:pets"
288
+ "/pet/{petId}/uploadImage":
289
+ post:
290
+ tags:
291
+ - pet
292
+ summary: uploads an image
293
+ description: ""
294
+ operationId: uploadFile
295
+ parameters:
296
+ - name: petId
297
+ in: path
298
+ description: ID of pet to update
299
+ required: true
300
+ schema:
301
+ type: integer
302
+ format: int64
303
+ responses:
304
+ "200":
305
+ description: successful operation
306
+ content:
307
+ application/json:
308
+ schema:
309
+ $ref: "#/components/schemas/ApiResponse"
310
+ security:
311
+ - petstore_auth:
312
+ - "write:pets"
313
+ - "read:pets"
314
+ requestBody:
315
+ content:
316
+ application/octet-stream:
317
+ schema:
318
+ type: string
319
+ format: binary
320
+ /pet/findByStatus:
321
+ get:
322
+ tags:
323
+ - pet
324
+ summary: Finds Pets by status
325
+ description: Multiple status values can be provided with comma separated strings
326
+ operationId: findPetsByStatus
327
+ parameters:
328
+ - name: status
329
+ in: query
330
+ description: Status values that need to be considered for filter
331
+ required: true
332
+ style: form
333
+ schema:
334
+ type: array
335
+ minItems: 1
336
+ maxItems: 3
337
+ items:
338
+ type: string
339
+ enum:
340
+ - available
341
+ - pending
342
+ - sold
343
+ default: available
344
+ responses:
345
+ "200":
346
+ description: successful operation
347
+ content:
348
+ application/json:
349
+ schema:
350
+ type: array
351
+ items:
352
+ $ref: "#/components/schemas/Pet"
353
+ application/xml:
354
+ schema:
355
+ type: array
356
+ items:
357
+ $ref: "#/components/schemas/Pet"
358
+ "400":
359
+ description: Invalid status value
360
+ security:
361
+ - api_key: []
362
+ /pet/findByTags:
363
+ get:
364
+ tags:
365
+ - pet
366
+ summary: Finds Pets by tags
367
+ description: >-
368
+ Multiple tags can be provided with comma separated strings. Use tag1,
369
+ tag2, tag3 for testing.
370
+ operationId: findPetsByTags
371
+ deprecated: true
372
+ parameters:
373
+ - name: tags
374
+ in: query
375
+ description: Tags to filter by
376
+ required: true
377
+ style: form
378
+ schema:
379
+ type: array
380
+ items:
381
+ type: string
382
+ responses:
383
+ "200":
384
+ description: successful operation
385
+ content:
386
+ application/json:
387
+ schema:
388
+ type: array
389
+ items:
390
+ $ref: "#/components/schemas/Pet"
391
+ application/xml:
392
+ schema:
393
+ type: array
394
+ items:
395
+ $ref: "#/components/schemas/Pet"
396
+ "400":
397
+ description: Invalid tag value
398
+ security:
399
+ - petstore_auth:
400
+ - "write:pets"
401
+ - "read:pets"
402
+ /store/inventory:
403
+ get:
404
+ tags:
405
+ - store
406
+ summary: Returns pet inventories by status
407
+ description: Returns a map of status codes to quantities
408
+ operationId: getInventory
409
+ responses:
410
+ "200":
411
+ description: successful operation
412
+ content:
413
+ application/json:
414
+ schema:
415
+ type: object
416
+ additionalProperties:
417
+ type: integer
418
+ format: int32
419
+ security:
420
+ - api_key: []
421
+ /store/order:
422
+ post:
423
+ tags:
424
+ - store
425
+ summary: Place an order for a pet
426
+ description: ""
427
+ operationId: placeOrder
428
+ responses:
429
+ "200":
430
+ description: successful operation
431
+ content:
432
+ application/json:
433
+ schema:
434
+ $ref: "#/components/schemas/Order"
435
+ application/xml:
436
+ schema:
437
+ $ref: "#/components/schemas/Order"
438
+ "400":
439
+ description: Invalid Order
440
+ content:
441
+ application/json:
442
+ example:
443
+ status: 400
444
+ message: "Invalid Order"
445
+ requestBody:
446
+ content:
447
+ application/json:
448
+ schema:
449
+ $ref: "#/components/schemas/Order"
450
+ examples:
451
+ OrderDelivered:
452
+ summary: Order delivered
453
+ value:
454
+ quantity: 4
455
+ shipDate: 2022-10-12
456
+ status: delivered
457
+ requestId: 444-4444-444-4444
458
+ OrderPlaced:
459
+ summary: Order placed
460
+ value:
461
+ quantity: 10
462
+ shipDate: 2022-10-01
463
+ status: placed
464
+ requestId: 111-222-333-444
465
+ OrderApproved:
466
+ summary: Order approved
467
+ value:
468
+ quantity: 1000
469
+ shipDate: 2022-09-01
470
+ status: approved
471
+ requestId: 000-111-222-333
472
+ description: order placed for purchasing the pet
473
+ required: true
474
+ "/store/order/{orderId}":
475
+ get:
476
+ tags:
477
+ - store
478
+ summary: Find purchase order by ID
479
+ description: >-
480
+ For valid response try integer IDs with value <= 5 or > 10. Other values
481
+ will generated exceptions
482
+ operationId: getOrderById
483
+ parameters:
484
+ - name: orderId
485
+ in: path
486
+ description: ID of pet that needs to be fetched
487
+ required: true
488
+ schema:
489
+ type: integer
490
+ format: int64
491
+ minimum: 1
492
+ maximum: 5
493
+ responses:
494
+ "200":
495
+ description: successful operation
496
+ content:
497
+ application/json:
498
+ schema:
499
+ $ref: "#/components/schemas/Order"
500
+ application/xml:
501
+ schema:
502
+ $ref: "#/components/schemas/Order"
503
+ "400":
504
+ description: Invalid ID supplied
505
+ "404":
506
+ description: Order not found
507
+ delete:
508
+ tags:
509
+ - store
510
+ summary: Delete purchase order by ID
511
+ description: >-
512
+ For valid response try integer IDs with value < 1000. Anything above
513
+ 1000 or nonintegers will generate API errors
514
+ operationId: deleteOrder
515
+ parameters:
516
+ - name: orderId
517
+ in: path
518
+ description: ID of the order that needs to be deleted
519
+ required: true
520
+ schema:
521
+ type: string
522
+ minimum: 1
523
+ responses:
524
+ "400":
525
+ description: Invalid ID supplied
526
+ "404":
527
+ description: Order not found
528
+ /store/subscribe:
529
+ post:
530
+ tags:
531
+ - store
532
+ summary: Subscribe to the Store events
533
+ description: Add subscription for a store events
534
+ requestBody:
535
+ content:
536
+ application/json:
537
+ schema:
538
+ type: object
539
+ properties:
540
+ callbackUrl:
541
+ type: string
542
+ format: uri
543
+ description: This URL will be called by the server when the desired event will occur
544
+ example: https://myserver.com/send/callback/here
545
+ eventName:
546
+ type: string
547
+ description: Event name for the subscription
548
+ enum:
549
+ - orderInProgress
550
+ - orderShipped
551
+ - orderDelivered
552
+ example: orderInProgress
553
+ required:
554
+ - callbackUrl
555
+ - eventName
556
+ responses:
557
+ "201":
558
+ description: Subscription added
559
+ content:
560
+ application/json:
561
+ schema:
562
+ type: object
563
+ properties:
564
+ subscriptionId:
565
+ type: string
566
+ example: AAA-123-BBB-456
567
+ callbacks:
568
+ orderInProgress:
569
+ "{$request.body#/callbackUrl}?event={$request.body#/eventName}":
570
+ servers:
571
+ - url: //callback-url.path-level/v1
572
+ description: Path level server 1
573
+ - url: //callback-url.path-level/v2
574
+ description: Path level server 2
575
+ post:
576
+ summary: Order in Progress (Summary)
577
+ description: A callback triggered every time an Order is updated status to "inProgress" (Description)
578
+ externalDocs:
579
+ description: Find out more
580
+ url: "https://more-details.com/demo"
581
+ requestBody:
582
+ content:
583
+ application/json:
584
+ schema:
585
+ type: object
586
+ properties:
587
+ orderId:
588
+ type: string
589
+ example: "123"
590
+ timestamp:
591
+ type: string
592
+ format: date-time
593
+ example: "2018-10-19T16:46:45Z"
594
+ status:
595
+ type: string
596
+ example: "inProgress"
597
+ application/xml:
598
+ schema:
599
+ type: object
600
+ properties:
601
+ orderId:
602
+ type: string
603
+ example: "123"
604
+ example: |
605
+ <?xml version="1.0" encoding="UTF-8"?>
606
+ <root>
607
+ <orderId>123</orderId>
608
+ <status>inProgress</status>
609
+ <timestamp>2018-10-19T16:46:45Z</timestamp>
610
+ </root>
611
+ responses:
612
+ "200":
613
+ description: Callback successfully processed and no retries will be performed
614
+ content:
615
+ application/json:
616
+ schema:
617
+ type: object
618
+ properties:
619
+ someProp:
620
+ type: string
621
+ example: "123"
622
+ "299":
623
+ description: Response for cancelling subscription
624
+ "500":
625
+ description: Callback processing failed and retries will be performed
626
+ x-codeSamples:
627
+ - lang: "C#"
628
+ source: |
629
+ PetStore.v1.Pet pet = new PetStore.v1.Pet();
630
+ pet.setApiKey("your api key");
631
+ pet.petType = PetStore.v1.Pet.TYPE_DOG;
632
+ pet.name = "Rex";
633
+ // set other fields
634
+ PetStoreResponse response = pet.create();
635
+ if (response.statusCode == HttpStatusCode.Created)
636
+ {
637
+ // Successfully created
638
+ }
639
+ else
640
+ {
641
+ // Something wrong -- check response for errors
642
+ Console.WriteLine(response.getRawResponse());
643
+ }
644
+ - lang: PHP
645
+ source: |
646
+ $form = new \PetStore\Entities\Pet();
647
+ $form->setPetType("Dog");
648
+ $form->setName("Rex");
649
+ // set other fields
650
+ try {
651
+ $pet = $client->pets()->create($form);
652
+ } catch (UnprocessableEntityException $e) {
653
+ var_dump($e->getErrors());
654
+ }
655
+ put:
656
+ description: Order in Progress (Only Description)
657
+ servers:
658
+ - url: //callback-url.operation-level/v1
659
+ description: Operation level server 1 (Operation override)
660
+ - url: //callback-url.operation-level/v2
661
+ description: Operation level server 2 (Operation override)
662
+ requestBody:
663
+ content:
664
+ application/json:
665
+ schema:
666
+ type: object
667
+ properties:
668
+ orderId:
669
+ type: string
670
+ example: "123"
671
+ timestamp:
672
+ type: string
673
+ format: date-time
674
+ example: "2018-10-19T16:46:45Z"
675
+ status:
676
+ type: string
677
+ example: "inProgress"
678
+ application/xml:
679
+ schema:
680
+ type: object
681
+ properties:
682
+ orderId:
683
+ type: string
684
+ example: "123"
685
+ example: |
686
+ <?xml version="1.0" encoding="UTF-8"?>
687
+ <root>
688
+ <orderId>123</orderId>
689
+ <status>inProgress</status>
690
+ <timestamp>2018-10-19T16:46:45Z</timestamp>
691
+ </root>
692
+ responses:
693
+ "200":
694
+ description: Callback successfully processed and no retries will be performed
695
+ content:
696
+ application/json:
697
+ schema:
698
+ type: object
699
+ properties:
700
+ someProp:
701
+ type: string
702
+ example: "123"
703
+ orderShipped:
704
+ "{$request.body#/callbackUrl}?event={$request.body#/eventName}":
705
+ post:
706
+ description: A callback triggered every time an Order is shipped to the recipient
707
+ requestBody:
708
+ content:
709
+ application/json:
710
+ schema:
711
+ type: object
712
+ properties:
713
+ orderId:
714
+ type: string
715
+ example: "123"
716
+ timestamp:
717
+ type: string
718
+ format: date-time
719
+ example: "2018-10-19T16:46:45Z"
720
+ estimatedDeliveryDate:
721
+ type: string
722
+ format: date-time
723
+ example: "2018-11-11T16:00:00Z"
724
+ responses:
725
+ "200":
726
+ description: Callback successfully processed and no retries will be performed
727
+ orderDelivered:
728
+ "http://notificationServer.com?url={$request.body#/callbackUrl}&event={$request.body#/eventName}":
729
+ post:
730
+ deprecated: true
731
+ summary: Order delivered
732
+ description: A callback triggered every time an Order is delivered to the recipient
733
+ requestBody:
734
+ content:
735
+ application/json:
736
+ schema:
737
+ type: object
738
+ properties:
739
+ orderId:
740
+ type: string
741
+ example: "123"
742
+ timestamp:
743
+ type: string
744
+ format: date-time
745
+ example: "2018-10-19T16:46:45Z"
746
+ responses:
747
+ "200":
748
+ description: Callback successfully processed and no retries will be performed
749
+ /user:
750
+ post:
751
+ tags:
752
+ - user
753
+ summary: Create user
754
+ description: This can only be done by the logged in user.
755
+ operationId: createUser
756
+ responses:
757
+ default:
758
+ description: successful operation
759
+ requestBody:
760
+ content:
761
+ application/json:
762
+ schema:
763
+ $ref: "#/components/schemas/User"
764
+ description: Created user object
765
+ required: true
766
+ "/user/{username}":
767
+ get:
768
+ tags:
769
+ - user
770
+ summary: Get user by user name
771
+ description: ""
772
+ operationId: getUserByName
773
+ parameters:
774
+ - name: username
775
+ in: path
776
+ description: "The name that needs to be fetched. Use user1 for testing. "
777
+ required: true
778
+ schema:
779
+ type: string
780
+ responses:
781
+ "200":
782
+ description: successful operation
783
+ content:
784
+ application/json:
785
+ schema:
786
+ $ref: "#/components/schemas/User"
787
+ application/xml:
788
+ schema:
789
+ $ref: "#/components/schemas/User"
790
+ "400":
791
+ description: Invalid username supplied
792
+ "404":
793
+ description: User not found
794
+ put:
795
+ tags:
796
+ - user
797
+ summary: Updated user
798
+ description: This can only be done by the logged in user.
799
+ operationId: updateUser
800
+ parameters:
801
+ - name: username
802
+ in: path
803
+ description: name that need to be deleted
804
+ required: true
805
+ schema:
806
+ type: string
807
+ responses:
808
+ "400":
809
+ description: Invalid user supplied
810
+ "404":
811
+ description: User not found
812
+ requestBody:
813
+ content:
814
+ application/json:
815
+ schema:
816
+ $ref: "#/components/schemas/User"
817
+ description: Updated user object
818
+ required: true
819
+ delete:
820
+ tags:
821
+ - user
822
+ summary: Delete user
823
+ description: This can only be done by the logged in user.
824
+ operationId: deleteUser
825
+ parameters:
826
+ - name: username
827
+ in: path
828
+ description: The name that needs to be deleted
829
+ required: true
830
+ schema:
831
+ type: string
832
+ responses:
833
+ "400":
834
+ description: Invalid username supplied
835
+ "404":
836
+ description: User not found
837
+ /user/createWithArray:
838
+ post:
839
+ tags:
840
+ - user
841
+ summary: Creates list of users with given input array
842
+ description: ""
843
+ operationId: createUsersWithArrayInput
844
+ responses:
845
+ default:
846
+ description: successful operation
847
+ requestBody:
848
+ $ref: "#/components/requestBodies/UserArray"
849
+ /user/createWithList:
850
+ post:
851
+ tags:
852
+ - user
853
+ summary: Creates list of users with given input list
854
+ description: ""
855
+ operationId: createUsersWithListInput
856
+ responses:
857
+ default:
858
+ description: successful operation
859
+ requestBody:
860
+ $ref: "#/components/requestBodies/UserArray"
861
+ /user/login:
862
+ get:
863
+ tags:
864
+ - user
865
+ summary: Logs user into the system
866
+ description: ""
867
+ operationId: loginUser
868
+ parameters:
869
+ - name: username
870
+ in: query
871
+ description: The user name for login
872
+ required: true
873
+ schema:
874
+ type: string
875
+ - name: password
876
+ in: query
877
+ description: The password for login in clear text
878
+ required: true
879
+ schema:
880
+ type: string
881
+ responses:
882
+ "200":
883
+ description: successful operation
884
+ headers:
885
+ X-Rate-Limit:
886
+ description: calls per hour allowed by the user
887
+ schema:
888
+ type: integer
889
+ format: int32
890
+ X-Expires-After:
891
+ description: date in UTC when token expires
892
+ schema:
893
+ type: string
894
+ format: date-time
895
+ content:
896
+ application/json:
897
+ schema:
898
+ type: string
899
+ examples:
900
+ response:
901
+ value: OK
902
+ application/xml:
903
+ schema:
904
+ type: string
905
+ examples:
906
+ response:
907
+ value: <Message> OK </Message>
908
+ text/plain:
909
+ examples:
910
+ response:
911
+ value: OK
912
+ "400":
913
+ description: Invalid username/password supplied
914
+ /user/logout:
915
+ get:
916
+ tags:
917
+ - user
918
+ summary: Logs out current logged in user session
919
+ description: ""
920
+ operationId: logoutUser
921
+ responses:
922
+ default:
923
+ description: successful operation
924
+ components:
925
+ schemas:
926
+ ApiResponse:
927
+ type: object
928
+ properties:
929
+ code:
930
+ type: integer
931
+ format: int32
932
+ type:
933
+ type: string
934
+ message:
935
+ type: string
936
+ Cat:
937
+ x-tags:
938
+ - pet
939
+ description: A representation of a cat
940
+ allOf:
941
+ - $ref: "#/components/schemas/Pet"
942
+ - type: object
943
+ properties:
944
+ huntingSkill:
945
+ type: string
946
+ description: The measured skill for hunting
947
+ default: lazy
948
+ example: adventurous
949
+ enum:
950
+ - clueless
951
+ - lazy
952
+ - adventurous
953
+ - aggressive
954
+ required:
955
+ - huntingSkill
956
+ Category:
957
+ type: object
958
+ properties:
959
+ id:
960
+ description: Category ID
961
+ allOf:
962
+ - $ref: "#/components/schemas/Id"
963
+ name:
964
+ description: Category name
965
+ type: string
966
+ minLength: 1
967
+ sub:
968
+ description: Test Sub Category
969
+ type: object
970
+ properties:
971
+ prop1:
972
+ type: string
973
+ description: Dumb Property
974
+ xml:
975
+ name: Category
976
+ Dog:
977
+ description: A representation of a dog
978
+ allOf:
979
+ - $ref: "#/components/schemas/Pet"
980
+ - type: object
981
+ properties:
982
+ packSize:
983
+ type: integer
984
+ format: int32
985
+ description: The size of the pack the dog is from
986
+ default: 1
987
+ minimum: 1
988
+ required:
989
+ - packSize
990
+ HoneyBee:
991
+ description: A representation of a honey bee
992
+ allOf:
993
+ - $ref: "#/components/schemas/Pet"
994
+ - type: object
995
+ properties:
996
+ honeyPerDay:
997
+ type: number
998
+ description: Average amount of honey produced per day in ounces
999
+ example: 3.14
1000
+ multipleOf: .01
1001
+ default: 0
1002
+ required:
1003
+ - honeyPerDay
1004
+ Id:
1005
+ type: integer
1006
+ format: int64
1007
+ readOnly: true
1008
+ Order:
1009
+ type: object
1010
+ properties:
1011
+ id:
1012
+ description: Order ID
1013
+ allOf:
1014
+ - $ref: "#/components/schemas/Id"
1015
+ petId:
1016
+ description: Pet ID
1017
+ allOf:
1018
+ - $ref: "#/components/schemas/Id"
1019
+ quantity:
1020
+ type: integer
1021
+ format: int32
1022
+ minimum: 1
1023
+ default: 1
1024
+ shipDate:
1025
+ description: Estimated ship date
1026
+ type: string
1027
+ format: date-time
1028
+ status:
1029
+ type: string
1030
+ description: Order Status
1031
+ enum:
1032
+ - placed
1033
+ - approved
1034
+ - delivered
1035
+ complete:
1036
+ description: Indicates whenever order was completed or not
1037
+ type: boolean
1038
+ default: false
1039
+ readOnly: true
1040
+ requestId:
1041
+ description: Unique Request Id
1042
+ type: string
1043
+ writeOnly: true
1044
+ xml:
1045
+ name: Order
1046
+ Pet:
1047
+ type: object
1048
+ required:
1049
+ - name
1050
+ - photoUrls
1051
+ - tags
1052
+ discriminator:
1053
+ propertyName: petType
1054
+ mapping:
1055
+ cat: "#/components/schemas/Cat"
1056
+ dog: "#/components/schemas/Dog"
1057
+ bee: "#/components/schemas/HoneyBee"
1058
+ properties:
1059
+ id:
1060
+ externalDocs:
1061
+ description: "Find more info here"
1062
+ url: "https://example.com"
1063
+ description: Pet ID
1064
+ allOf:
1065
+ - $ref: "#/components/schemas/Id"
1066
+ category:
1067
+ description: Categories this pet belongs to
1068
+ allOf:
1069
+ - $ref: "#/components/schemas/Category"
1070
+ name:
1071
+ description: The name given to a pet
1072
+ type: string
1073
+ example: Guru
1074
+ photoUrls:
1075
+ description: The list of URL to a cute photos featuring pet
1076
+ type: array
1077
+ maxItems: 20
1078
+ xml:
1079
+ name: photoUrl
1080
+ wrapped: true
1081
+ items:
1082
+ type: string
1083
+ format: url
1084
+ friend:
1085
+ allOf:
1086
+ - $ref: "#/components/schemas/Pet"
1087
+ tags:
1088
+ description: Tags attached to the pet
1089
+ type: array
1090
+ minItems: 1
1091
+ xml:
1092
+ name: tag
1093
+ wrapped: true
1094
+ items:
1095
+ $ref: "#/components/schemas/Tag"
1096
+ status:
1097
+ type: string
1098
+ description: Pet status in the store
1099
+ enum:
1100
+ - available
1101
+ - pending
1102
+ - sold
1103
+ petType:
1104
+ description: Type of a pet
1105
+ type: string
1106
+ oneOf:
1107
+ - $ref: "#/components/schemas/Cat"
1108
+ - $ref: "#/components/schemas/Dog"
1109
+ - $ref: "#/components/schemas/HoneyBee"
1110
+ xml:
1111
+ name: Pet
1112
+ Tag:
1113
+ type: object
1114
+ properties:
1115
+ id:
1116
+ description: Tag ID
1117
+ allOf:
1118
+ - $ref: "#/components/schemas/Id"
1119
+ name:
1120
+ description: Tag name
1121
+ type: string
1122
+ minLength: 1
1123
+ xml:
1124
+ name: Tag
1125
+ User:
1126
+ type: object
1127
+ properties:
1128
+ id:
1129
+ $ref: "#/components/schemas/Id"
1130
+ pet:
1131
+ oneOf:
1132
+ - $ref: "#/components/schemas/Pet"
1133
+ - $ref: "#/components/schemas/Tag"
1134
+ username:
1135
+ description: User supplied username
1136
+ type: string
1137
+ minLength: 4
1138
+ example: John78
1139
+ firstName:
1140
+ description: User first name
1141
+ type: string
1142
+ minLength: 1
1143
+ example: John
1144
+ lastName:
1145
+ description: User last name
1146
+ type: string
1147
+ minLength: 1
1148
+ example: Smith
1149
+ email:
1150
+ description: User email address
1151
+ type: string
1152
+ format: email
1153
+ example: john.smith@example.com
1154
+ password:
1155
+ type: string
1156
+ description: >-
1157
+ User password, MUST contain a mix of upper and lower case letters,
1158
+ as well as digits
1159
+ format: password
1160
+ minLength: 8
1161
+ pattern: "/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/"
1162
+ example: drowssaP123
1163
+ phone:
1164
+ description: User phone number in international format
1165
+ type: string
1166
+ pattern: '/^\+(?:[0-9]-?){6,14}[0-9]$/'
1167
+ example: +1-202-555-0192
1168
+ userStatus:
1169
+ description: User status
1170
+ type: integer
1171
+ format: int32
1172
+ xml:
1173
+ name: User
1174
+ requestBodies:
1175
+ Pet:
1176
+ content:
1177
+ application/json:
1178
+ schema:
1179
+ allOf:
1180
+ - description: My Pet
1181
+ title: Pettie
1182
+ - $ref: "#/components/schemas/Pet"
1183
+ example:
1184
+ category:
1185
+ name: Great Dane
1186
+ sub:
1187
+ prop1: Just a test property
1188
+ name: Pepper
1189
+ photoUrls:
1190
+ - https://assets.orvis.com/is/image/orvisprd/great-dane
1191
+ tags:
1192
+ - name: Great Danes
1193
+ status: pending
1194
+ petType:
1195
+ huntingSkill: lazy
1196
+ application/xml:
1197
+ schema:
1198
+ type: "object"
1199
+ properties:
1200
+ name:
1201
+ type: string
1202
+ description: hooray
1203
+ description: Pet object that needs to be added to the store
1204
+ required: true
1205
+ UserArray:
1206
+ content:
1207
+ application/json:
1208
+ schema:
1209
+ type: array
1210
+ items:
1211
+ $ref: "#/components/schemas/User"
1212
+ description: List of user object
1213
+ required: true
1214
+ securitySchemes:
1215
+ petstore_auth:
1216
+ description: |
1217
+ Get access to data while protecting your account credentials.
1218
+ OAuth2 is also a safer and more secure way to give you access.
1219
+ type: oauth2
1220
+ flows:
1221
+ implicit:
1222
+ authorizationUrl: "http://petstore.swagger.io/api/oauth/dialog"
1223
+ scopes:
1224
+ "write:pets": modify pets in your account
1225
+ "read:pets": read your pets
1226
+ api_key:
1227
+ description: >
1228
+ For this sample, you can use the api key `special-key` to test the
1229
+ authorization filters.
1230
+ type: apiKey
1231
+ name: api_key
1232
+ in: header
1233
+ BasicAuth:
1234
+ type: http
1235
+ scheme: basic
1236
+ BearerAuth:
1237
+ type: http
1238
+ scheme: bearer
1239
+ ApiKeyAuth:
1240
+ type: apiKey
1241
+ in: header
1242
+ name: X-API-Key
1243
+ OpenID:
1244
+ type: openIdConnect
1245
+ openIdConnectUrl: https://example.com/.well-known/openid-configuration
1246
+ OAuth2:
1247
+ type: oauth2
1248
+ flows:
1249
+ authorizationCode:
1250
+ authorizationUrl: https://example.com/oauth/authorize
1251
+ tokenUrl: https://example.com/oauth/token
1252
+ scopes:
1253
+ read: Grants read access
1254
+ write: Grants write access
1255
+ admin: Grants access to admin operations
1256
+ x-webhooks:
1257
+ newPet:
1258
+ post:
1259
+ summary: New pet
1260
+ description: Information about a new pet in the systems
1261
+ operationId: newPet
1262
+ tags:
1263
+ - pet
1264
+ requestBody:
1265
+ content:
1266
+ application/json:
1267
+ schema:
1268
+ $ref: "#/components/schemas/Pet"
1269
+ responses:
1270
+ "200":
1271
+ description: Return a 200 status to indicate that the data was received successfully