Advertisement
Guest User

Untitled

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