Guest User

Untitled

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