petstore.json 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. {
  2. "openapi": "3.0",
  3. "info": {
  4. "version": "1.0.0",
  5. "title": "OpenAPI Petstore",
  6. "license": {
  7. "name": "MIT"
  8. }
  9. },
  10. "servers": [
  11. {
  12. "url": "https://petstore.openapis.org/v1",
  13. "description": "Development server"
  14. }
  15. ],
  16. "paths": {
  17. "/pets": {
  18. "get": {
  19. "summary": "List all pets",
  20. "operationId": "listPets",
  21. "tags": [
  22. "pets"
  23. ],
  24. "parameters": [
  25. {
  26. "name": "limit",
  27. "in": "query",
  28. "description": "How many items to return at one time (max 100)",
  29. "required": false,
  30. "schema": {
  31. "type": "integer",
  32. "format": "int32"
  33. }
  34. }
  35. ],
  36. "responses": {
  37. "200": {
  38. "description": "An paged array of pets",
  39. "headers": {
  40. "x-next": {
  41. "schema": {
  42. "type": "string"
  43. },
  44. "description": "A link to the next page of responses"
  45. }
  46. },
  47. "content": {
  48. "application/json": {
  49. "schema": {
  50. "$ref": "#/components/schemas/Pets"
  51. }
  52. }
  53. }
  54. },
  55. "default": {
  56. "description": "unexpected error",
  57. "content": {
  58. "application/json": {
  59. "schema": {
  60. "$ref": "#/components/schemas/Error"
  61. }
  62. }
  63. }
  64. }
  65. }
  66. },
  67. "post": {
  68. "summary": "Create a pet",
  69. "operationId": "createPets",
  70. "tags": [
  71. "pets"
  72. ],
  73. "responses": {
  74. "201": {
  75. "description": "Null response"
  76. },
  77. "default": {
  78. "description": "unexpected error",
  79. "content": {
  80. "application/json": {
  81. "schema": {
  82. "$ref": "#/components/schemas/Error"
  83. }
  84. }
  85. }
  86. }
  87. }
  88. }
  89. },
  90. "/pets/{petId}": {
  91. "get": {
  92. "summary": "Info for a specific pet",
  93. "operationId": "showPetById",
  94. "tags": [
  95. "pets"
  96. ],
  97. "parameters": [
  98. {
  99. "name": "petId",
  100. "in": "path",
  101. "required": true,
  102. "description": "The id of the pet to retrieve",
  103. "schema": {
  104. "type": "string"
  105. }
  106. }
  107. ],
  108. "responses": {
  109. "200": {
  110. "description": "Expected response to a valid request",
  111. "content": {
  112. "application/json": {
  113. "schema": {
  114. "$ref": "#/components/schemas/Pets"
  115. }
  116. }
  117. }
  118. },
  119. "default": {
  120. "description": "unexpected error",
  121. "content": {
  122. "application/json": {
  123. "schema": {
  124. "$ref": "#/components/schemas/Error"
  125. }
  126. }
  127. }
  128. }
  129. }
  130. }
  131. }
  132. },
  133. "components": {
  134. "schemas": {
  135. "Pet": {
  136. "required": [
  137. "id",
  138. "name"
  139. ],
  140. "properties": {
  141. "id": {
  142. "type": "integer",
  143. "format": "int64"
  144. },
  145. "name": {
  146. "type": "string"
  147. },
  148. "tag": {
  149. "type": "string"
  150. }
  151. }
  152. },
  153. "Pets": {
  154. "type": "array",
  155. "items": {
  156. "$ref": "#/components/schemas/Pet"
  157. }
  158. },
  159. "Error": {
  160. "required": [
  161. "code",
  162. "message"
  163. ],
  164. "properties": {
  165. "code": {
  166. "type": "integer",
  167. "format": "int32"
  168. },
  169. "message": {
  170. "type": "string"
  171. }
  172. }
  173. }
  174. }
  175. }
  176. }