No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 

425 líneas
10 KiB

  1. {
  2. "apiVersion": "1.0.0",
  3. "swaggerVersion": "1.2",
  4. "basePath": "http://petstore.swagger.io/api",
  5. "resourcePath": "/pet",
  6. "produces": [
  7. "application/json",
  8. "application/xml",
  9. "text/plain",
  10. "text/html"
  11. ],
  12. "apis": [
  13. {
  14. "path": "/pet/{petId}",
  15. "operations": [
  16. {
  17. "method": "GET",
  18. "summary": "Find pet by ID",
  19. "notes": "Returns a pet based on ID",
  20. "type": "Pet",
  21. "nickname": "getPetById",
  22. "authorizations": {},
  23. "parameters": [
  24. {
  25. "name": "petId",
  26. "description": "ID of pet that needs to be fetched",
  27. "required": true,
  28. "type": "integer",
  29. "format": "int64",
  30. "paramType": "path",
  31. "minimum": "1.0",
  32. "maximum": "100000.0"
  33. }
  34. ],
  35. "responseMessages": [
  36. {
  37. "code": 400,
  38. "message": "Invalid ID supplied"
  39. },
  40. {
  41. "code": 404,
  42. "message": "Pet not found"
  43. }
  44. ]
  45. },
  46. {
  47. "method": "PATCH",
  48. "summary": "partial updates to a pet",
  49. "notes": "",
  50. "type": "array",
  51. "items": {
  52. "$ref": "Pet"
  53. },
  54. "nickname": "partialUpdate",
  55. "produces": [
  56. "application/json",
  57. "application/xml"
  58. ],
  59. "consumes": [
  60. "application/json",
  61. "application/xml"
  62. ],
  63. "authorizations": {
  64. "oauth2": [
  65. {
  66. "scope": "test:anything",
  67. "description": "anything"
  68. }
  69. ]
  70. },
  71. "parameters": [
  72. {
  73. "name": "petId",
  74. "description": "ID of pet that needs to be fetched",
  75. "required": true,
  76. "type": "string",
  77. "paramType": "path"
  78. },
  79. {
  80. "name": "body",
  81. "description": "Pet object that needs to be added to the store",
  82. "required": true,
  83. "type": "Pet",
  84. "paramType": "body"
  85. }
  86. ],
  87. "responseMessages": [
  88. {
  89. "code": 400,
  90. "message": "Invalid tag value"
  91. }
  92. ]
  93. },
  94. {
  95. "method": "POST",
  96. "summary": "Updates a pet in the store with form data",
  97. "notes": "",
  98. "type": "void",
  99. "nickname": "updatePetWithForm",
  100. "consumes": [
  101. "application/x-www-form-urlencoded"
  102. ],
  103. "authorizations": {
  104. "oauth2": [
  105. {
  106. "scope": "test:anything",
  107. "description": "anything"
  108. }
  109. ]
  110. },
  111. "parameters": [
  112. {
  113. "name": "petId",
  114. "description": "ID of pet that needs to be updated",
  115. "required": true,
  116. "type": "string",
  117. "paramType": "path"
  118. },
  119. {
  120. "name": "name",
  121. "description": "Updated name of the pet",
  122. "required": false,
  123. "type": "string",
  124. "paramType": "form"
  125. },
  126. {
  127. "name": "status",
  128. "description": "Updated status of the pet",
  129. "required": false,
  130. "type": "string",
  131. "paramType": "form"
  132. }
  133. ],
  134. "responseMessages": [
  135. {
  136. "code": 405,
  137. "message": "Invalid input"
  138. }
  139. ]
  140. },
  141. {
  142. "method": "DELETE",
  143. "summary": "Deletes a pet",
  144. "notes": "",
  145. "type": "void",
  146. "nickname": "deletePet",
  147. "authorizations": {
  148. "oauth2": [
  149. {
  150. "scope": "test:anything",
  151. "description": "anything"
  152. }
  153. ]
  154. },
  155. "parameters": [
  156. {
  157. "name": "petId",
  158. "description": "Pet id to delete",
  159. "required": true,
  160. "type": "string",
  161. "paramType": "path"
  162. }
  163. ],
  164. "responseMessages": [
  165. {
  166. "code": 400,
  167. "message": "Invalid pet value"
  168. }
  169. ]
  170. }
  171. ]
  172. },
  173. {
  174. "path": "/pet",
  175. "operations": [
  176. {
  177. "method": "PUT",
  178. "summary": "Update an existing pet",
  179. "notes": "",
  180. "type": "void",
  181. "nickname": "updatePet",
  182. "authorizations": {},
  183. "parameters": [
  184. {
  185. "name": "body",
  186. "description": "Pet object that needs to be updated in the store",
  187. "required": true,
  188. "type": "Pet",
  189. "paramType": "body"
  190. }
  191. ],
  192. "responseMessages": [
  193. {
  194. "code": 400,
  195. "message": "Invalid ID supplied"
  196. },
  197. {
  198. "code": 404,
  199. "message": "Pet not found"
  200. },
  201. {
  202. "code": 405,
  203. "message": "Validation exception"
  204. }
  205. ]
  206. },
  207. {
  208. "method": "POST",
  209. "summary": "Add a new pet to the store",
  210. "notes": "",
  211. "type": "void",
  212. "nickname": "addPet",
  213. "consumes": [
  214. "application/json",
  215. "application/xml"
  216. ],
  217. "authorizations": {
  218. "oauth2": [
  219. {
  220. "scope": "test:anything",
  221. "description": "anything"
  222. }
  223. ]
  224. },
  225. "parameters": [
  226. {
  227. "name": "body",
  228. "description": "Pet object that needs to be added to the store",
  229. "required": true,
  230. "type": "Pet",
  231. "paramType": "body"
  232. }
  233. ],
  234. "responseMessages": [
  235. {
  236. "code": 405,
  237. "message": "Invalid input"
  238. }
  239. ]
  240. }
  241. ]
  242. },
  243. {
  244. "path": "/pet/findByStatus",
  245. "operations": [
  246. {
  247. "method": "GET",
  248. "summary": "Finds Pets by status",
  249. "notes": "Multiple status values can be provided with comma seperated strings",
  250. "type": "array",
  251. "items": {
  252. "$ref": "Pet"
  253. },
  254. "nickname": "findPetsByStatus",
  255. "authorizations": {},
  256. "parameters": [
  257. {
  258. "name": "status",
  259. "description": "Status values that need to be considered for filter",
  260. "defaultValue": "available",
  261. "required": true,
  262. "type": "string",
  263. "paramType": "query",
  264. "enum": [
  265. "available",
  266. "pending",
  267. "sold"
  268. ]
  269. }
  270. ],
  271. "responseMessages": [
  272. {
  273. "code": 400,
  274. "message": "Invalid status value"
  275. }
  276. ]
  277. }
  278. ]
  279. },
  280. {
  281. "path": "/pet/findByTags",
  282. "operations": [
  283. {
  284. "method": "GET",
  285. "summary": "Finds Pets by tags",
  286. "notes": "Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.",
  287. "type": "array",
  288. "items": {
  289. "$ref": "Pet"
  290. },
  291. "nickname": "findPetsByTags",
  292. "authorizations": {},
  293. "parameters": [
  294. {
  295. "name": "tags",
  296. "description": "Tags to filter by",
  297. "required": true,
  298. "type": "string",
  299. "paramType": "query"
  300. }
  301. ],
  302. "responseMessages": [
  303. {
  304. "code": 400,
  305. "message": "Invalid tag value"
  306. }
  307. ],
  308. "deprecated": "true"
  309. }
  310. ]
  311. },
  312. {
  313. "path": "/pet/uploadImage",
  314. "operations": [
  315. {
  316. "method": "POST",
  317. "summary": "uploads an image",
  318. "notes": "",
  319. "type": "void",
  320. "nickname": "uploadFile",
  321. "consumes": [
  322. "multipart/form-data"
  323. ],
  324. "authorizations": {
  325. "oauth2": [
  326. {
  327. "scope": "test:anything",
  328. "description": "anything"
  329. },
  330. {
  331. "scope": "test:nothing",
  332. "description": "nothing"
  333. }
  334. ]
  335. },
  336. "parameters": [
  337. {
  338. "name": "additionalMetadata",
  339. "description": "Additional data to pass to server",
  340. "required": false,
  341. "type": "string",
  342. "paramType": "form"
  343. },
  344. {
  345. "name": "file",
  346. "description": "file to upload",
  347. "required": false,
  348. "type": "File",
  349. "paramType": "body"
  350. }
  351. ]
  352. }
  353. ]
  354. }
  355. ],
  356. "models": {
  357. "Tag": {
  358. "id": "Tag",
  359. "properties": {
  360. "id": {
  361. "type": "integer",
  362. "format": "int64"
  363. },
  364. "name": {
  365. "type": "string"
  366. }
  367. }
  368. },
  369. "Pet": {
  370. "id": "Pet",
  371. "required": [
  372. "id",
  373. "name"
  374. ],
  375. "properties": {
  376. "id": {
  377. "type": "integer",
  378. "format": "int64",
  379. "description": "unique identifier for the pet",
  380. "minimum": "0.0",
  381. "maximum": "100.0"
  382. },
  383. "category": {
  384. "$ref": "Category"
  385. },
  386. "name": {
  387. "type": "string"
  388. },
  389. "photoUrls": {
  390. "type": "array",
  391. "items": {
  392. "type": "string"
  393. }
  394. },
  395. "tags": {
  396. "type": "array",
  397. "items": {
  398. "$ref": "Tag"
  399. }
  400. },
  401. "status": {
  402. "type": "string",
  403. "description": "pet status in the store",
  404. "enum": [
  405. "available",
  406. "pending",
  407. "sold"
  408. ]
  409. }
  410. }
  411. },
  412. "Category": {
  413. "id": "Category",
  414. "properties": {
  415. "id": {
  416. "type": "integer",
  417. "format": "int64"
  418. },
  419. "name": {
  420. "type": "string"
  421. }
  422. }
  423. }
  424. }
  425. }