Advertisement
Guest User

Untitled

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