Advertisement
Guest User

Untitled

a guest
Oct 9th, 2018
311
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. email: apiteam@swagger.io
  13. license:
  14. name: Apache 2.0
  15. url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
  16. tags:
  17. - name: pet
  18. description: Everything about your Pets
  19. externalDocs:
  20. description: Find out more
  21. url: 'http://swagger.io'
  22. - name: store
  23. description: Access to Petstore orders
  24. - name: user
  25. description: Operations about user
  26. externalDocs:
  27. description: Find out more about our store
  28. url: 'http://swagger.io'
  29. paths:
  30. /pet:
  31. post:
  32. tags:
  33. - pet
  34. summary: Add a new pet to the store
  35. description: ''
  36. operationId: addPet
  37. responses:
  38. '405':
  39. description: Invalid input
  40. security:
  41. - petstore_auth:
  42. - 'write:pets'
  43. - 'read:pets'
  44. requestBody:
  45. $ref: '#/components/requestBodies/Pet'
  46. put:
  47. tags:
  48. - pet
  49. summary: Update an existing pet
  50. description: ''
  51. operationId: updatePet
  52. responses:
  53. '400':
  54. description: Invalid ID supplied
  55. '404':
  56. description: Pet not found
  57. '405':
  58. description: Validation exception
  59. security:
  60. - petstore_auth:
  61. - 'write:pets'
  62. - 'read:pets'
  63. requestBody:
  64. $ref: '#/components/requestBodies/Pet'
  65. /pet/findByStatus:
  66. get:
  67. tags:
  68. - pet
  69. summary: Finds Pets by status
  70. description: Multiple status values can be provided with comma separated strings
  71. operationId: findPetsByStatus
  72. parameters:
  73. - name: status
  74. in: query
  75. description: Status values that need to be considered for filter
  76. required: true
  77. explode: true
  78. schema:
  79. type: array
  80. items:
  81. type: string
  82. enum:
  83. - available
  84. - pending
  85. - sold
  86. default: available
  87. responses:
  88. '200':
  89. description: successful operation
  90. content:
  91. application/xml:
  92. schema:
  93. type: array
  94. items:
  95. $ref: '#/components/schemas/Pet'
  96. application/json:
  97. schema:
  98. type: array
  99. items:
  100. $ref: '#/components/schemas/Pet'
  101. '400':
  102. description: Invalid status value
  103. security:
  104. - petstore_auth:
  105. - 'write:pets'
  106. - 'read:pets'
  107. /pet/findByTags:
  108. get:
  109. tags:
  110. - pet
  111. summary: Finds Pets by tags
  112. description: >-
  113. 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. multipart/form-data:
  268. schema:
  269. type: object
  270. properties:
  271. additionalMetadata:
  272. description: Additional data to pass to server
  273. type: string
  274. file:
  275. description: file to upload
  276. type: string
  277. format: binary
  278. /store/inventory:
  279. get:
  280. tags:
  281. - store
  282. summary: Returns pet inventories by status
  283. description: Returns a map of status codes to quantities
  284. operationId: getInventory
  285. responses:
  286. '200':
  287. description: successful operation
  288. content:
  289. application/json:
  290. schema:
  291. type: object
  292. additionalProperties:
  293. type: integer
  294. format: int32
  295. security:
  296. - api_key: []
  297. /store/order:
  298. post:
  299. tags:
  300. - store
  301. summary: Place an order for a pet
  302. description: ''
  303. operationId: placeOrder
  304. responses:
  305. '200':
  306. description: successful operation
  307. content:
  308. application/xml:
  309. schema:
  310. $ref: '#/components/schemas/Order'
  311. application/json:
  312. schema:
  313. $ref: '#/components/schemas/Order'
  314. '400':
  315. description: Invalid Order
  316. requestBody:
  317. content:
  318. application/json:
  319. schema:
  320. $ref: '#/components/schemas/Order'
  321. description: order placed for purchasing the pet
  322. required: true
  323. '/store/order/{orderId}':
  324. get:
  325. tags:
  326. - store
  327. summary: Find purchase order by ID
  328. description: >-
  329. For valid response try integer IDs with value >= 1 and <= 10.
  330. Other values will generated exceptions
  331. operationId: getOrderById
  332. parameters:
  333. - name: orderId
  334. in: path
  335. description: ID of pet that needs to be fetched
  336. required: true
  337. schema:
  338. type: integer
  339. format: int64
  340. minimum: 1
  341. maximum: 10
  342. responses:
  343. '200':
  344. description: successful operation
  345. content:
  346. application/xml:
  347. schema:
  348. $ref: '#/components/schemas/Order'
  349. application/json:
  350. schema:
  351. $ref: '#/components/schemas/Order'
  352. '400':
  353. description: Invalid ID supplied
  354. '404':
  355. description: Order not found
  356. delete:
  357. tags:
  358. - store
  359. summary: Delete purchase order by ID
  360. description: >-
  361. For valid response try integer IDs with positive integer value.
  362. Negative or non-integer values will generate API errors
  363. operationId: deleteOrder
  364. parameters:
  365. - name: orderId
  366. in: path
  367. description: ID of the order that needs to be deleted
  368. required: true
  369. schema:
  370. type: integer
  371. format: int64
  372. minimum: 1
  373. responses:
  374. '400':
  375. description: Invalid ID supplied
  376. '404':
  377. description: Order not found
  378. /user:
  379. post:
  380. tags:
  381. - user
  382. summary: Create user
  383. description: This can only be done by the logged in user.
  384. operationId: createUser
  385. responses:
  386. default:
  387. description: successful operation
  388. requestBody:
  389. content:
  390. application/json:
  391. schema:
  392. $ref: '#/components/schemas/User'
  393. description: Created user object
  394. required: true
  395. /user/createWithArray:
  396. post:
  397. tags:
  398. - user
  399. summary: Creates list of users with given input array
  400. description: ''
  401. operationId: createUsersWithArrayInput
  402. responses:
  403. default:
  404. description: successful operation
  405. requestBody:
  406. $ref: '#/components/requestBodies/UserArray'
  407. /user/createWithList:
  408. post:
  409. tags:
  410. - user
  411. summary: Creates list of users with given input array
  412. description: ''
  413. operationId: createUsersWithListInput
  414. responses:
  415. default:
  416. description: successful operation
  417. requestBody:
  418. $ref: '#/components/requestBodies/UserArray'
  419. /user/login:
  420. get:
  421. tags:
  422. - user
  423. summary: Logs user into the system
  424. description: ''
  425. operationId: loginUser
  426. parameters:
  427. - name: username
  428. in: query
  429. description: The user name for login
  430. required: true
  431. schema:
  432. type: string
  433. - name: password
  434. in: query
  435. description: The password for login in clear text
  436. required: true
  437. schema:
  438. type: string
  439. responses:
  440. '200':
  441. description: successful operation
  442. headers:
  443. X-Rate-Limit:
  444. description: calls per hour allowed by the user
  445. schema:
  446. type: integer
  447. format: int32
  448. X-Expires-After:
  449. description: date in UTC when token expires
  450. schema:
  451. type: string
  452. format: date-time
  453. content:
  454. application/xml:
  455. schema:
  456. type: string
  457. application/json:
  458. schema:
  459. type: string
  460. '400':
  461. description: Invalid username/password supplied
  462. /user/logout:
  463. get:
  464. tags:
  465. - user
  466. summary: Logs out current logged in user session
  467. description: ''
  468. operationId: logoutUser
  469. responses:
  470. default:
  471. description: successful operation
  472. '/user/{username}':
  473. get:
  474. tags:
  475. - user
  476. summary: Get user by user name
  477. description: ''
  478. operationId: getUserByName
  479. parameters:
  480. - name: username
  481. in: path
  482. description: 'The name that needs to be fetched. Use user1 for testing. '
  483. required: true
  484. schema:
  485. type: string
  486. responses:
  487. '200':
  488. description: successful operation
  489. content:
  490. application/xml:
  491. schema:
  492. $ref: '#/components/schemas/User'
  493. application/json:
  494. schema:
  495. $ref: '#/components/schemas/User'
  496. '400':
  497. description: Invalid username supplied
  498. '404':
  499. description: User not found
  500. put:
  501. tags:
  502. - user
  503. summary: Updated user
  504. description: This can only be done by the logged in user.
  505. operationId: updateUser
  506. parameters:
  507. - name: username
  508. in: path
  509. description: name that need to be updated
  510. required: true
  511. schema:
  512. type: string
  513. responses:
  514. '400':
  515. description: Invalid user supplied
  516. '404':
  517. description: User not found
  518. requestBody:
  519. content:
  520. application/json:
  521. schema:
  522. $ref: '#/components/schemas/User'
  523. description: Updated user object
  524. required: true
  525. delete:
  526. tags:
  527. - user
  528. summary: Delete user
  529. description: This can only be done by the logged in user.
  530. operationId: deleteUser
  531. parameters:
  532. - name: username
  533. in: path
  534. description: The name that needs to be deleted
  535. required: true
  536. schema:
  537. type: string
  538. responses:
  539. '400':
  540. description: Invalid username supplied
  541. '404':
  542. description: User not found
  543. externalDocs:
  544. description: Find out more about Swagger
  545. url: 'http://swagger.io'
  546. servers:
  547. - url: 'https://petstore.swagger.io/v2'
  548. - url: 'http://petstore.swagger.io/v2'
  549. components:
  550. requestBodies:
  551. UserArray:
  552. content:
  553. application/json:
  554. schema:
  555. type: array
  556. items:
  557. $ref: '#/components/schemas/User'
  558. description: List of user object
  559. required: true
  560. Pet:
  561. content:
  562. application/json:
  563. schema:
  564. $ref: '#/components/schemas/Pet'
  565. application/xml:
  566. schema:
  567. $ref: '#/components/schemas/Pet'
  568. description: Pet object that needs to be added to the store
  569. required: true
  570. securitySchemes:
  571. petstore_auth:
  572. type: oauth2
  573. flows:
  574. implicit:
  575. authorizationUrl: 'http://petstore.swagger.io/oauth/dialog'
  576. scopes:
  577. 'write:pets': modify pets in your account
  578. 'read:pets': read your pets
  579. api_key:
  580. type: apiKey
  581. name: api_key
  582. in: header
  583. schemas:
  584. Order:
  585. type: object
  586. properties:
  587. id:
  588. type: integer
  589. format: int64
  590. petId:
  591. type: integer
  592. format: int64
  593. quantity:
  594. type: integer
  595. format: int32
  596. shipDate:
  597. type: string
  598. format: date-time
  599. status:
  600. type: string
  601. description: Order Status
  602. enum:
  603. - placed
  604. - approved
  605. - delivered
  606. complete:
  607. type: boolean
  608. default: false
  609. xml:
  610. name: Order
  611. Category:
  612. type: object
  613. properties:
  614. id:
  615. type: integer
  616. format: int64
  617. name:
  618. type: string
  619. xml:
  620. name: Category
  621. ExtendedCategory:
  622. allOf:
  623. - $ref: '#/components/schemas/Category'
  624. - type: object
  625. properties:
  626. extendedId:
  627. type: integer
  628. format: int64
  629. extendedName:
  630. type: string
  631. xml:
  632. name: ExtendedCategory
  633. User:
  634. type: object
  635. properties:
  636. id:
  637. type: integer
  638. format: int64
  639. username:
  640. type: string
  641. firstName:
  642. type: string
  643. lastName:
  644. type: string
  645. email:
  646. type: string
  647. password:
  648. type: string
  649. phone:
  650. type: string
  651. userStatus:
  652. type: integer
  653. format: int32
  654. description: User Status
  655. xml:
  656. name: User
  657. Tag:
  658. type: object
  659. properties:
  660. id:
  661. type: integer
  662. format: int64
  663. name:
  664. type: string
  665. xml:
  666. name: Tag
  667. Pet:
  668. type: object
  669. required:
  670. - name
  671. - photoUrls
  672. properties:
  673. id:
  674. type: integer
  675. format: int64
  676. category:
  677. $ref: '#/components/schemas/ExtendedCategory'
  678. name:
  679. type: string
  680. example: doggie
  681. photoUrls:
  682. type: array
  683. xml:
  684. name: photoUrl
  685. wrapped: true
  686. items:
  687. type: string
  688. tags:
  689. type: array
  690. xml:
  691. name: tag
  692. wrapped: true
  693. items:
  694. $ref: '#/components/schemas/Tag'
  695. status:
  696. type: string
  697. description: pet status in the store
  698. enum:
  699. - available
  700. - pending
  701. - sold
  702. xml:
  703. name: Pet
  704. ApiResponse:
  705. type: object
  706. properties:
  707. code:
  708. type: integer
  709. format: int32
  710. type:
  711. type: string
  712. message:
  713. type: string
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement