Advertisement
Guest User

Untitled

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