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.
 
 
 
 

690 line
17 KiB

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