You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

708 line
16 KiB

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