Advertisement
Guest User

Untitled

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