petstore-expanded.openapi.yaml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. openapi: "3.0.0"
  2. info:
  3. version: 1.0.0
  4. title: Swagger Petstore
  5. description: A sample API that uses a petstore as an example to demonstrate features in the OpenAPI 3.0 specification
  6. termsOfService: http://swagger.io/terms/
  7. contact:
  8. name: Swagger API Team
  9. email: apiteam@swagger.io
  10. url: http://swagger.io
  11. license:
  12. name: Apache 2.0
  13. url: https://www.apache.org/licenses/LICENSE-2.0.html
  14. servers:
  15. - url: http://petstore.swagger.io/api
  16. security:
  17. - Petstore: []
  18. paths:
  19. /pets:
  20. get:
  21. description: |
  22. Returns all pets from the system that the user has access to
  23. Nam sed condimentum est. Maecenas tempor sagittis sapien, nec rhoncus sem sagittis sit amet. Aenean at gravida augue, ac iaculis sem. Curabitur odio lorem, ornare eget elementum nec, cursus id lectus. Duis mi turpis, pulvinar ac eros ac, tincidunt varius justo. In hac habitasse platea dictumst. Integer at adipiscing ante, a sagittis ligula. Aenean pharetra tempor ante molestie imperdiet. Vivamus id aliquam diam. Cras quis velit non tortor eleifend sagittis. Praesent at enim pharetra urna volutpat venenatis eget eget mauris. In eleifend fermentum facilisis. Praesent enim enim, gravida ac sodales sed, placerat id erat. Suspendisse lacus dolor, consectetur non augue vel, vehicula interdum libero. Morbi euismod sagittis libero sed lacinia.
  24. Sed tempus felis lobortis leo pulvinar rutrum. Nam mattis velit nisl, eu condimentum ligula luctus nec. Phasellus semper velit eget aliquet faucibus. In a mattis elit. Phasellus vel urna viverra, condimentum lorem id, rhoncus nibh. Ut pellentesque posuere elementum. Sed a varius odio. Morbi rhoncus ligula libero, vel eleifend nunc tristique vitae. Fusce et sem dui. Aenean nec scelerisque tortor. Fusce malesuada accumsan magna vel tempus. Quisque mollis felis eu dolor tristique, sit amet auctor felis gravida. Sed libero lorem, molestie sed nisl in, accumsan tempor nisi. Fusce sollicitudin massa ut lacinia mattis. Sed vel eleifend lorem. Pellentesque vitae felis pretium, pulvinar elit eu, euismod sapien.
  25. operationId: findPets
  26. parameters:
  27. - name: tags
  28. in: query
  29. description: tags to filter by
  30. required: false
  31. style: form
  32. schema:
  33. type: array
  34. items:
  35. type: string
  36. - name: limit
  37. in: query
  38. description: maximum number of results to return
  39. required: false
  40. schema:
  41. type: integer
  42. format: int32
  43. responses:
  44. '200':
  45. description: pet response
  46. content:
  47. application/json:
  48. schema:
  49. type: array
  50. items:
  51. $ref: '#/components/schemas/Pet'
  52. default:
  53. description: unexpected error
  54. content:
  55. application/json:
  56. schema:
  57. $ref: '#/components/schemas/Error'
  58. post:
  59. description: Creates a new pet in the store. Duplicates are allowed
  60. operationId: addPet
  61. requestBody:
  62. description: Pet to add to the store
  63. required: true
  64. content:
  65. application/json:
  66. schema:
  67. $ref: '#/components/schemas/NewPet'
  68. responses:
  69. '200':
  70. description: pet response
  71. content:
  72. application/json:
  73. schema:
  74. $ref: '#/components/schemas/Pet'
  75. default:
  76. description: unexpected error
  77. content:
  78. application/json:
  79. schema:
  80. $ref: '#/components/schemas/Error'
  81. /pets/{id}:
  82. get:
  83. description: Returns a user based on a single ID, if the user does not have access to the pet
  84. operationId: find pet by id
  85. parameters:
  86. - name: id
  87. in: path
  88. description: ID of pet to fetch
  89. required: true
  90. schema:
  91. type: integer
  92. format: int64
  93. responses:
  94. '200':
  95. description: pet response
  96. content:
  97. application/json:
  98. schema:
  99. $ref: '#/components/schemas/Pet'
  100. default:
  101. description: unexpected error
  102. content:
  103. application/json:
  104. schema:
  105. $ref: '#/components/schemas/Error'
  106. delete:
  107. description: deletes a single pet based on the ID supplied
  108. operationId: deletePet
  109. parameters:
  110. - name: id
  111. in: path
  112. description: ID of pet to delete
  113. required: true
  114. schema:
  115. type: integer
  116. format: int64
  117. responses:
  118. '204':
  119. description: pet deleted
  120. default:
  121. description: unexpected error
  122. content:
  123. application/json:
  124. schema:
  125. $ref: '#/components/schemas/Error'
  126. components:
  127. schemas:
  128. Pet:
  129. allOf:
  130. - $ref: '#/components/schemas/NewPet'
  131. - required:
  132. - id
  133. properties:
  134. id:
  135. type: integer
  136. format: int64
  137. NewPet:
  138. required:
  139. - name
  140. properties:
  141. name:
  142. type: string
  143. tag:
  144. type: string
  145. Error:
  146. required:
  147. - code
  148. - message
  149. properties:
  150. code:
  151. type: integer
  152. format: int32
  153. message:
  154. type: string
  155. securitySchemes:
  156. Petstore:
  157. type: oauth2
  158. flows:
  159. implicit:
  160. authorizationUrl: https://example.com/api/oauth/dialog
  161. scopes:
  162. write:pets: modify pets in your account
  163. read:pets: read your pets