Advertisement
Guest User

Untitled

a guest
Mar 7th, 2018
257
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.84 KB | None | 0 0
  1. swagger: "2.0"
  2. info:
  3. description: "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters."
  4. version: "1.0.0"
  5. title: "Swagger Petstore"
  6. termsOfService: "http://swagger.io/terms/"
  7. contact:
  8. email: "apiteam@swagger.io"
  9. license:
  10. name: "Apache 2.0"
  11. url: "http://www.apache.org/licenses/LICENSE-2.0.html"
  12. host: "petstore.swagger.io"
  13. basePath: "/v2"
  14. tags:
  15. - name: "DataSet"
  16. description: "Everything about your DataSet"
  17. externalDocs:
  18. description: "Find out more"
  19. url: "http://swagger.io"
  20. - name: "store"
  21. description: "Access to Petstore orders"
  22. - name: "user"
  23. description: "Operations about user"
  24. externalDocs:
  25. description: "Find out more about our store"
  26. url: "http://swagger.io"
  27. schemes:
  28. - "http"
  29. paths:
  30. /DataSet:
  31. post:
  32. tags:
  33. - "DataSet"
  34. summary: "Add a new dataset to the store"
  35. description: ""
  36. operationId: "addPet"
  37. consumes:
  38. - "application/json"
  39. - "application/xml"
  40. produces:
  41. - "application/xml"
  42. - "application/json"
  43. parameters:
  44. - in: "body"
  45. name: "body"
  46. description: "Dataset object that needs to be added to the store"
  47. required: true
  48. schema:
  49. $ref: "#/definitions/Pet"
  50. responses:
  51. 405:
  52. description: "Invalid input"
  53. security:
  54. - petstore_auth:
  55. - "write:pets"
  56. - "read:pets"
  57. put:
  58. tags:
  59. - "DataSet"
  60. summary: "Update an existing dataset"
  61. description: ""
  62. operationId: "updatePet"
  63. consumes:
  64. - "application/json"
  65. - "application/xml"
  66. produces:
  67. - "application/xml"
  68. - "application/json"
  69. parameters:
  70. - in: "body"
  71. name: "body"
  72. description: "Dataset object that needs to be added to the store"
  73. required: true
  74. schema:
  75. $ref: "#/definitions/Pet"
  76. responses:
  77. 400:
  78. description: "Invalid ID supplied"
  79. 404:
  80. description: "Pet not found"
  81. 405:
  82. description: "Validation exception"
  83. security:
  84. - petstore_auth:
  85. - "write:pets"
  86. - "read:pets"
  87. /api/action/datastore_search/{resource_id}:
  88. get:
  89. tags:
  90. - "DataSet"
  91. summary: "Finds datasets by UFRN"
  92. description: "Multiple status values can be provided with comma separated strings"
  93. operationId: "findPetsByStatus"
  94. produces:
  95. - "application/xml"
  96. - "application/json"
  97. parameters:
  98. - name: "resource_id"
  99. in: "path"
  100. description: "ID of dateSet"
  101. required: true
  102. type: "string"
  103. format: "int64"
  104. responses:
  105. 200:
  106. description: "successful operation"
  107. schema:
  108. type: "array"
  109. items:
  110. $ref: "#/definitions/DataSet"
  111. 400:
  112. description: "Invalid status value"
  113. 404:
  114. description: "Invalid resource_id"
  115. security:
  116. - petstore_auth:
  117. - "write:pets"
  118. - "read:pets"
  119. /pet/findByTags:
  120. get:
  121. tags:
  122. - "pet"
  123. summary: "Finds Pets by tags"
  124. description: "Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing."
  125. operationId: "findPetsByTags"
  126. produces:
  127. - "application/xml"
  128. - "application/json"
  129. parameters:
  130. - name: "tags"
  131. in: "query"
  132. description: "Tags to filter by"
  133. required: true
  134. type: "array"
  135. items:
  136. type: "string"
  137. collectionFormat: "multi"
  138. responses:
  139. 200:
  140. description: "successful operation"
  141. schema:
  142. type: "array"
  143. items:
  144. $ref: "#/definitions/Pet"
  145. 400:
  146. description: "Invalid tag value"
  147. security:
  148. - petstore_auth:
  149. - "write:pets"
  150. - "read:pets"
  151. deprecated: true
  152. /pet/{petId}:
  153. get:
  154. tags:
  155. - "pet"
  156. summary: "Find pet by ID"
  157. description: "Returns a single pet"
  158. operationId: "getPetById"
  159. produces:
  160. - "application/xml"
  161. - "application/json"
  162. parameters:
  163. - name: "petId"
  164. in: "path"
  165. description: "ID of pet to return"
  166. required: true
  167. type: "integer"
  168. format: "int64"
  169. responses:
  170. 200:
  171. description: "successful operation"
  172. schema:
  173. $ref: "#/definitions/Pet"
  174. 400:
  175. description: "Invalid ID supplied"
  176. 404:
  177. description: "Pet not found"
  178. security:
  179. - api_key: []
  180. post:
  181. tags:
  182. - "pet"
  183. summary: "Updates a pet in the store with form data"
  184. description: ""
  185. operationId: "updatePetWithForm"
  186. consumes:
  187. - "application/x-www-form-urlencoded"
  188. produces:
  189. - "application/xml"
  190. - "application/json"
  191. parameters:
  192. - name: "petId"
  193. in: "path"
  194. description: "ID of pet that needs to be updated"
  195. required: true
  196. type: "integer"
  197. format: "int64"
  198. - name: "name"
  199. in: "formData"
  200. description: "Updated name of the pet"
  201. required: false
  202. type: "string"
  203. - name: "status"
  204. in: "formData"
  205. description: "Updated status of the pet"
  206. required: false
  207. type: "string"
  208. responses:
  209. 405:
  210. description: "Invalid input"
  211. security:
  212. - petstore_auth:
  213. - "write:pets"
  214. - "read:pets"
  215. delete:
  216. tags:
  217. - "pet"
  218. summary: "Deletes a pet"
  219. description: ""
  220. operationId: "deletePet"
  221. produces:
  222. - "application/xml"
  223. - "application/json"
  224. parameters:
  225. - name: "api_key"
  226. in: "header"
  227. required: false
  228. type: "string"
  229. - name: "petId"
  230. in: "path"
  231. description: "Pet id to delete"
  232. required: true
  233. type: "integer"
  234. format: "int64"
  235. responses:
  236. 400:
  237. description: "Invalid ID supplied"
  238. 404:
  239. description: "Pet not found"
  240. security:
  241. - petstore_auth:
  242. - "write:pets"
  243. - "read:pets"
  244. /pet/{petId}/uploadImage:
  245. post:
  246. tags:
  247. - "pet"
  248. summary: "uploads an image"
  249. description: ""
  250. operationId: "uploadFile"
  251. consumes:
  252. - "multipart/form-data"
  253. produces:
  254. - "application/json"
  255. parameters:
  256. - name: "petId"
  257. in: "path"
  258. description: "ID of pet to update"
  259. required: true
  260. type: "integer"
  261. format: "int64"
  262. - name: "additionalMetadata"
  263. in: "formData"
  264. description: "Additional data to pass to server"
  265. required: false
  266. type: "string"
  267. - name: "file"
  268. in: "formData"
  269. description: "file to upload"
  270. required: false
  271. type: "file"
  272. responses:
  273. 200:
  274. description: "successful operation"
  275. schema:
  276. $ref: "#/definitions/ApiResponse"
  277. security:
  278. - petstore_auth:
  279. - "write:pets"
  280. - "read:pets"
  281. /store/inventory:
  282. get:
  283. tags:
  284. - "store"
  285. summary: "Returns pet inventories by status"
  286. description: "Returns a map of status codes to quantities"
  287. operationId: "getInventory"
  288. produces:
  289. - "application/json"
  290. parameters: []
  291. responses:
  292. 200:
  293. description: "successful operation"
  294. schema:
  295. type: "object"
  296. additionalProperties:
  297. type: "integer"
  298. format: "int32"
  299. security:
  300. - api_key: []
  301. /store/order:
  302. post:
  303. tags:
  304. - "store"
  305. summary: "Place an order for a pet"
  306. description: ""
  307. operationId: "placeOrder"
  308. produces:
  309. - "application/xml"
  310. - "application/json"
  311. parameters:
  312. - in: "body"
  313. name: "body"
  314. description: "order placed for purchasing the pet"
  315. required: true
  316. schema:
  317. $ref: "#/definitions/Order"
  318. responses:
  319. 200:
  320. description: "successful operation"
  321. schema:
  322. $ref: "#/definitions/Order"
  323. 400:
  324. description: "Invalid Order"
  325. /store/order/{orderId}:
  326. get:
  327. tags:
  328. - "store"
  329. summary: "Find purchase order by ID"
  330. description: "For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions"
  331. operationId: "getOrderById"
  332. produces:
  333. - "application/xml"
  334. - "application/json"
  335. parameters:
  336. - name: "orderId"
  337. in: "path"
  338. description: "ID of pet that needs to be fetched"
  339. required: true
  340. type: "integer"
  341. maximum: 10.0
  342. minimum: 1.0
  343. format: "int64"
  344. responses:
  345. 200:
  346. description: "successful operation"
  347. schema:
  348. $ref: "#/definitions/Order"
  349. 400:
  350. description: "Invalid ID supplied"
  351. 404:
  352. description: "Order not found"
  353. delete:
  354. tags:
  355. - "store"
  356. summary: "Delete purchase order by ID"
  357. description: "For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors"
  358. operationId: "deleteOrder"
  359. produces:
  360. - "application/xml"
  361. - "application/json"
  362. parameters:
  363. - name: "orderId"
  364. in: "path"
  365. description: "ID of the order that needs to be deleted"
  366. required: true
  367. type: "integer"
  368. minimum: 1.0
  369. format: "int64"
  370. responses:
  371. 400:
  372. description: "Invalid ID supplied"
  373. 404:
  374. description: "Order not found"
  375. /user:
  376. post:
  377. tags:
  378. - "user"
  379. summary: "Create user"
  380. description: "This can only be done by the logged in user."
  381. operationId: "createUser"
  382. produces:
  383. - "application/xml"
  384. - "application/json"
  385. parameters:
  386. - in: "body"
  387. name: "body"
  388. description: "Created user object"
  389. required: true
  390. schema:
  391. $ref: "#/definitions/User"
  392. responses:
  393. default:
  394. description: "successful operation"
  395. /user/createWithArray:
  396. post:
  397. tags:
  398. - "user"
  399. summary: "Creates list of users with given input array"
  400. description: ""
  401. operationId: "createUsersWithArrayInput"
  402. produces:
  403. - "application/xml"
  404. - "application/json"
  405. parameters:
  406. - in: "body"
  407. name: "body"
  408. description: "List of user object"
  409. required: true
  410. schema:
  411. type: "array"
  412. items:
  413. $ref: "#/definitions/User"
  414. responses:
  415. default:
  416. description: "successful operation"
  417. /user/createWithList:
  418. post:
  419. tags:
  420. - "user"
  421. summary: "Creates list of users with given input array"
  422. description: ""
  423. operationId: "createUsersWithListInput"
  424. produces:
  425. - "application/xml"
  426. - "application/json"
  427. parameters:
  428. - in: "body"
  429. name: "body"
  430. description: "List of user object"
  431. required: true
  432. schema:
  433. type: "array"
  434. items:
  435. $ref: "#/definitions/User"
  436. responses:
  437. default:
  438. description: "successful operation"
  439. /user/login:
  440. get:
  441. tags:
  442. - "user"
  443. summary: "Logs user into the system"
  444. description: ""
  445. operationId: "loginUser"
  446. produces:
  447. - "application/xml"
  448. - "application/json"
  449. parameters:
  450. - name: "username"
  451. in: "query"
  452. description: "The user name for login"
  453. required: true
  454. type: "string"
  455. - name: "password"
  456. in: "query"
  457. description: "The password for login in clear text"
  458. required: true
  459. type: "string"
  460. responses:
  461. 200:
  462. description: "successful operation"
  463. schema:
  464. type: "string"
  465. headers:
  466. X-Rate-Limit:
  467. type: "integer"
  468. format: "int32"
  469. description: "calls per hour allowed by the user"
  470. X-Expires-After:
  471. type: "string"
  472. format: "date-time"
  473. description: "date in UTC when token expires"
  474. 400:
  475. description: "Invalid username/password supplied"
  476. /user/logout:
  477. get:
  478. tags:
  479. - "user"
  480. summary: "Logs out current logged in user session"
  481. description: ""
  482. operationId: "logoutUser"
  483. produces:
  484. - "application/xml"
  485. - "application/json"
  486. parameters: []
  487. responses:
  488. default:
  489. description: "successful operation"
  490. /user/{username}:
  491. get:
  492. tags:
  493. - "user"
  494. summary: "Get user by user name"
  495. description: ""
  496. operationId: "getUserByName"
  497. produces:
  498. - "application/xml"
  499. - "application/json"
  500. parameters:
  501. - name: "username"
  502. in: "path"
  503. description: "The name that needs to be fetched. Use user1 for testing. "
  504. required: true
  505. type: "string"
  506. responses:
  507. 200:
  508. description: "successful operation"
  509. schema:
  510. $ref: "#/definitions/User"
  511. 400:
  512. description: "Invalid username supplied"
  513. 404:
  514. description: "User not found"
  515. put:
  516. tags:
  517. - "user"
  518. summary: "Updated user"
  519. description: "This can only be done by the logged in user."
  520. operationId: "updateUser"
  521. produces:
  522. - "application/xml"
  523. - "application/json"
  524. parameters:
  525. - name: "username"
  526. in: "path"
  527. description: "name that need to be updated"
  528. required: true
  529. type: "string"
  530. - in: "body"
  531. name: "body"
  532. description: "Updated user object"
  533. required: true
  534. schema:
  535. $ref: "#/definitions/User"
  536. responses:
  537. 400:
  538. description: "Invalid user supplied"
  539. 404:
  540. description: "User not found"
  541. delete:
  542. tags:
  543. - "user"
  544. summary: "Delete user"
  545. description: "This can only be done by the logged in user."
  546. operationId: "deleteUser"
  547. produces:
  548. - "application/xml"
  549. - "application/json"
  550. parameters:
  551. - name: "username"
  552. in: "path"
  553. description: "The name that needs to be deleted"
  554. required: true
  555. type: "string"
  556. responses:
  557. 400:
  558. description: "Invalid username supplied"
  559. 404:
  560. description: "User not found"
  561. securityDefinitions:
  562. petstore_auth:
  563. type: "oauth2"
  564. authorizationUrl: "http://petstore.swagger.io/oauth/dialog"
  565. flow: "implicit"
  566. scopes:
  567. write:pets: "modify pets in your account"
  568. read:pets: "read your pets"
  569. api_key:
  570. type: "apiKey"
  571. name: "api_key"
  572. in: "header"
  573. definitions:
  574. Order:
  575. type: "object"
  576. properties:
  577. id:
  578. type: "integer"
  579. format: "int64"
  580. petId:
  581. type: "integer"
  582. format: "int64"
  583. quantity:
  584. type: "integer"
  585. format: "int32"
  586. shipDate:
  587. type: "string"
  588. format: "date-time"
  589. status:
  590. type: "string"
  591. description: "Order Status"
  592. enum:
  593. - "placed"
  594. - "approved"
  595. - "delivered"
  596. complete:
  597. type: "boolean"
  598. default: false
  599. xml:
  600. name: "Order"
  601. Category:
  602. type: "object"
  603. properties:
  604. id:
  605. type: "integer"
  606. format: "int64"
  607. name:
  608. type: "string"
  609. xml:
  610. name: "Category"
  611. User:
  612. type: "object"
  613. properties:
  614. id:
  615. type: "integer"
  616. format: "int64"
  617. username:
  618. type: "string"
  619. firstName:
  620. type: "string"
  621. lastName:
  622. type: "string"
  623. email:
  624. type: "string"
  625. password:
  626. type: "string"
  627. phone:
  628. type: "string"
  629. userStatus:
  630. type: "integer"
  631. format: "int32"
  632. description: "User Status"
  633. xml:
  634. name: "User"
  635. Tag:
  636. type: "object"
  637. properties:
  638. id:
  639. type: "integer"
  640. format: "int64"
  641. name:
  642. type: "string"
  643. xml:
  644. name: "Tag"
  645. DataSet:
  646. type: "object"
  647. required:
  648. - "name"
  649. - "photoUrls"
  650. properties:
  651. help:
  652. type: "string"
  653. example: "http://dados.ufrn.br/api/3/action/help_show?name=datastore_search"
  654. sucess:
  655. type: "boolean"
  656. fields:
  657. type: "array"
  658. items:
  659. $ref: "#/definitions/Tag"
  660. name:
  661. type: "string"
  662. example: "DataSet"
  663. photoUrls:
  664. type: "array"
  665. xml:
  666. name: "photoUrl"
  667. wrapped: true
  668. items:
  669. type: "string"
  670. tags:
  671. type: "array"
  672. xml:
  673. name: "tag"
  674. wrapped: true
  675. items:
  676. $ref: "#/definitions/Tag"
  677. status:
  678. type: "string"
  679. description: "pet status in the store"
  680. enum:
  681. - "available"
  682. - "pending"
  683. - "sold"
  684. xml:
  685. name: "Pet"
  686. ApiResponse:
  687. type: "object"
  688. properties:
  689. code:
  690. type: "integer"
  691. format: "int32"
  692. type:
  693. type: "string"
  694. message:
  695. type: "string"
  696. externalDocs:
  697. description: "Find out more about Swagger"
  698. url: "http://swagger.io"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement