petstore.json 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. {
  2. "openapi": "3.0.0",
  3. "info": {
  4. "title": "Swagger Petstore",
  5. "license": {
  6. "name": "MIT"
  7. },
  8. "version": "1.0.0"
  9. },
  10. "servers": [
  11. {
  12. "url": "petstore.swagger.io",
  13. "description": "Api server"
  14. }
  15. ],
  16. "paths": {
  17. "/pets": {
  18. "get": {
  19. "tags": [
  20. "pets"
  21. ],
  22. "summary": "List all pets",
  23. "operationId": "listPets",
  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. "description": "A link to the next page of responses",
  42. "schema": {
  43. "type": "string"
  44. }
  45. }
  46. }
  47. },
  48. "default": {
  49. "description": "unexpected error"
  50. }
  51. }
  52. },
  53. "post": {
  54. "tags": [
  55. "pets"
  56. ],
  57. "summary": "Create a pet",
  58. "operationId": "createPets",
  59. "responses": {
  60. "201": {
  61. "description": "Null response"
  62. },
  63. "default": {
  64. "description": "unexpected error"
  65. }
  66. }
  67. }
  68. },
  69. "/pets/{petId}": {
  70. "get": {
  71. "tags": [
  72. "pets"
  73. ],
  74. "summary": "Info for a specific pet",
  75. "operationId": "showPetById",
  76. "parameters": [
  77. {
  78. "name": "petId",
  79. "in": "path",
  80. "description": "The id of the pet to retrieve",
  81. "required": true,
  82. "schema": {
  83. "type": "string"
  84. }
  85. }
  86. ],
  87. "responses": {
  88. "200": {
  89. "description": "Expected response to a valid request"
  90. },
  91. "default": {
  92. "description": "unexpected error"
  93. }
  94. }
  95. }
  96. }
  97. },
  98. "components": {
  99. "schemas": {
  100. "Pet": {
  101. "required": [
  102. "id",
  103. "name"
  104. ],
  105. "properties": {
  106. "id": {
  107. "type": "integer",
  108. "format": "int64"
  109. },
  110. "name": {
  111. "type": "string"
  112. },
  113. "tag": {
  114. "type": "string"
  115. }
  116. },
  117. "type": "object"
  118. },
  119. "Error": {
  120. "required": [
  121. "code",
  122. "message"
  123. ],
  124. "properties": {
  125. "code": {
  126. "type": "integer",
  127. "format": "int32"
  128. },
  129. "message": {
  130. "type": "string"
  131. }
  132. },
  133. "type": "object"
  134. },
  135. "Pets": {
  136. "type": "array",
  137. "items": {
  138. "$ref": "#/components/schemas/Pet"
  139. }
  140. }
  141. }
  142. }
  143. }