Advertisement
Guest User

Untitled

a guest
Oct 13th, 2016
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.75 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 key
  7. `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. - http
  33. paths:
  34. /pet:
  35. post:
  36. tags:
  37. - pet
  38. summary: Add a new pet to the store
  39. description: ''
  40. operationId: addPet
  41. consumes:
  42. - application/json
  43. - application/xml
  44. produces:
  45. - application/xml
  46. - application/json
  47. parameters:
  48. - in: body
  49. name: body
  50. description: Pet object that needs to be added to the store
  51. required: true
  52. schema:
  53. $ref: '#/definitions/Pet'
  54. responses:
  55. '405':
  56. description: Invalid input
  57. security:
  58. - petstore_auth:
  59. - 'write:pets'
  60. - 'read:pets'
  61. put:
  62. tags:
  63. - pet
  64. summary: Update an existing pet
  65. description: ''
  66. operationId: updatePet
  67. consumes:
  68. - application/json
  69. - application/xml
  70. produces:
  71. - application/xml
  72. - application/json
  73. parameters:
  74. - in: body
  75. name: body
  76. description: Pet object that needs to be added to the store
  77. required: true
  78. schema:
  79. $ref: '#/definitions/Pet'
  80. responses:
  81. '400':
  82. description: Invalid ID supplied
  83. '404':
  84. description: Pet not found
  85. '405':
  86. description: Validation exception
  87. security:
  88. - petstore_auth:
  89. - 'write:pets'
  90. - 'read:pets'
  91. /pet/findByStatus:
  92. get:
  93. tags:
  94. - pet
  95. summary: Finds Pets by status
  96. description: Multiple status values can be provided with comma separated strings
  97. operationId: findPetsByStatus
  98. produces:
  99. - application/xml
  100. - application/json
  101. parameters:
  102. - name: status
  103. in: query
  104. description: Status values that need to be considered for filter
  105. required: true
  106. type: array
  107. items:
  108. type: string
  109. enum:
  110. - available
  111. - pending
  112. - sold
  113. default: available
  114. collectionFormat: multi
  115. responses:
  116. '200':
  117. description: successful operation
  118. schema:
  119. type: array
  120. items:
  121. $ref: '#/definitions/Pet'
  122. '400':
  123. description: Invalid status value
  124. security:
  125. - petstore_auth:
  126. - 'write:pets'
  127. - 'read:pets'
  128. /pet/findByTags:
  129. get:
  130. tags:
  131. - pet
  132. summary: Finds Pets by tags
  133. description: >-
  134. Muliple tags can be provided with comma separated strings. Use tag1,
  135. 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: >-
  342. For valid response try integer IDs with value >= 1 and <= 10. Other
  343. values will generated exceptions
  344. operationId: getOrderById
  345. produces:
  346. - application/xml
  347. - application/json
  348. parameters:
  349. - name: orderId
  350. in: path
  351. description: ID of pet that needs to be fetched
  352. required: true
  353. type: integer
  354. maximum: 10
  355. minimum: 1
  356. format: int64
  357. responses:
  358. '200':
  359. description: successful operation
  360. schema:
  361. $ref: '#/definitions/Order'
  362. '400':
  363. description: Invalid ID supplied
  364. '404':
  365. description: Order not found
  366. delete:
  367. tags:
  368. - store
  369. summary: Delete purchase order by ID
  370. description: >-
  371. For valid response try integer IDs with positive integer value. Negative
  372. or non-integer values will generate API errors
  373. operationId: deleteOrder
  374. produces:
  375. - application/xml
  376. - application/json
  377. parameters:
  378. - name: orderId
  379. in: path
  380. description: ID of the order that needs to be deleted
  381. required: true
  382. type: integer
  383. minimum: 1
  384. format: int64
  385. responses:
  386. '400':
  387. description: Invalid ID supplied
  388. '404':
  389. description: Order not found
  390. /user:
  391. post:
  392. tags:
  393. - user
  394. summary: Create user
  395. description: This can only be done by the logged in user.
  396. operationId: createUser
  397. produces:
  398. - application/xml
  399. - application/json
  400. parameters:
  401. - in: body
  402. name: body
  403. description: Created user object
  404. required: true
  405. schema:
  406. $ref: '#/definitions/User'
  407. responses:
  408. default:
  409. description: successful operation
  410. /user/createWithArray:
  411. post:
  412. tags:
  413. - user
  414. summary: Creates list of users with given input array
  415. description: ''
  416. operationId: createUsersWithArrayInput
  417. produces:
  418. - application/xml
  419. - application/json
  420. parameters:
  421. - in: body
  422. name: body
  423. description: List of user object
  424. required: true
  425. schema:
  426. type: array
  427. items:
  428. $ref: '#/definitions/User'
  429. responses:
  430. default:
  431. description: successful operation
  432. /user/createWithList:
  433. post:
  434. tags:
  435. - user
  436. summary: Creates list of users with given input array
  437. description: ''
  438. operationId: createUsersWithListInput
  439. produces:
  440. - application/xml
  441. - application/json
  442. parameters:
  443. - in: body
  444. name: body
  445. description: List of user object
  446. required: true
  447. schema:
  448. type: array
  449. items:
  450. $ref: '#/definitions/User'
  451. responses:
  452. default:
  453. description: successful operation
  454. /user/login:
  455. get:
  456. tags:
  457. - user
  458. summary: Logs user into the system
  459. description: ''
  460. operationId: loginUser
  461. produces:
  462. - application/xml
  463. - application/json
  464. parameters:
  465. - name: username
  466. in: query
  467. description: The user name for login
  468. required: true
  469. type: string
  470. - name: password
  471. in: query
  472. description: The password for login in clear text
  473. required: true
  474. type: string
  475. responses:
  476. '200':
  477. description: successful operation
  478. schema:
  479. type: string
  480. headers:
  481. X-Rate-Limit:
  482. type: integer
  483. format: int32
  484. description: calls per hour allowed by the user
  485. X-Expires-After:
  486. type: string
  487. format: date-time
  488. description: date in UTC when token expires
  489. '400':
  490. description: Invalid username/password supplied
  491. /user/logout:
  492. get:
  493. tags:
  494. - user
  495. summary: Logs out current logged in user session
  496. description: ''
  497. operationId: logoutUser
  498. produces:
  499. - application/xml
  500. - application/json
  501. parameters: []
  502. responses:
  503. default:
  504. description: successful operation
  505. '/user/{username}':
  506. get:
  507. tags:
  508. - user
  509. summary: Get user by user name
  510. description: ''
  511. operationId: getUserByName
  512. produces:
  513. - application/xml
  514. - application/json
  515. parameters:
  516. - name: username
  517. in: path
  518. description: 'The name that needs to be fetched. Use user1 for testing. '
  519. required: true
  520. type: string
  521. responses:
  522. '200':
  523. description: successful operation
  524. schema:
  525. $ref: '#/definitions/User'
  526. '400':
  527. description: Invalid username supplied
  528. '404':
  529. description: User not found
  530. put:
  531. tags:
  532. - user
  533. summary: Updated user
  534. description: This can only be done by the logged in user.
  535. operationId: updateUser
  536. produces:
  537. - application/xml
  538. - application/json
  539. parameters:
  540. - name: username
  541. in: path
  542. description: name that need to be updated
  543. required: true
  544. type: string
  545. - in: body
  546. name: body
  547. description: Updated user object
  548. required: true
  549. schema:
  550. $ref: '#/definitions/User'
  551. responses:
  552. '400':
  553. description: Invalid user supplied
  554. '404':
  555. description: User not found
  556. delete:
  557. tags:
  558. - user
  559. summary: Delete user
  560. description: This can only be done by the logged in user.
  561. operationId: deleteUser
  562. produces:
  563. - application/xml
  564. - application/json
  565. parameters:
  566. - name: username
  567. in: path
  568. description: The name that needs to be deleted
  569. required: true
  570. type: string
  571. responses:
  572. '400':
  573. description: Invalid username supplied
  574. '404':
  575. description: User not found
  576. securityDefinitions:
  577. petstore_auth:
  578. type: oauth2
  579. authorizationUrl: 'http://petstore.swagger.io/oauth/dialog'
  580. flow: implicit
  581. scopes:
  582. 'write:pets': modify pets in your account
  583. 'read:pets': read your pets
  584. api_key:
  585. type: apiKey
  586. name: api_key
  587. in: header
  588. definitions:
  589. Order:
  590. type: object
  591. properties:
  592. id:
  593. type: integer
  594. format: int64
  595. petId:
  596. type: integer
  597. format: int64
  598. quantity:
  599. type: integer
  600. format: int32
  601. shipDate:
  602. type: string
  603. format: date-time
  604. status:
  605. type: string
  606. description: Order Status
  607. enum:
  608. - placed
  609. - approved
  610. - delivered
  611. complete:
  612. type: boolean
  613. default: false
  614. xml:
  615. name: Order
  616. Category:
  617. type: object
  618. properties:
  619. id:
  620. type: integer
  621. format: int64
  622. name:
  623. type: string
  624. xml:
  625. name: Category
  626. User:
  627. type: object
  628. properties:
  629. id:
  630. type: integer
  631. format: int64
  632. username:
  633. type: string
  634. firstName:
  635. type: string
  636. lastName:
  637. type: string
  638. email:
  639. type: string
  640. password:
  641. type: string
  642. phone:
  643. type: string
  644. userStatus:
  645. type: integer
  646. format: int32
  647. description: User Status
  648. xml:
  649. name: User
  650. Tag:
  651. type: object
  652. properties:
  653. id:
  654. type: integer
  655. format: int64
  656. name:
  657. type: string
  658. xml:
  659. name: Tag
  660. Pet:
  661. type: object
  662. required:
  663. - name
  664. - photoUrls
  665. properties:
  666. id:
  667. type: integer
  668. format: int64
  669. category:
  670. $ref: '#/definitions/Category'
  671. name:
  672. type: string
  673. example: doggie
  674. photoUrls:
  675. type: array
  676. xml:
  677. name: photoUrl
  678. wrapped: true
  679. items:
  680. type: string
  681. tags:
  682. type: array
  683. xml:
  684. name: tag
  685. wrapped: true
  686. items:
  687. $ref: '#/definitions/Tag'
  688. status:
  689. type: string
  690. description: pet status in the store
  691. enum:
  692. - available
  693. - pending
  694. - sold
  695. xml:
  696. name: Pet
  697. ApiResponse:
  698. type: object
  699. properties:
  700. code:
  701. type: integer
  702. format: int32
  703. type:
  704. type: string
  705. message:
  706. type: string
  707. externalDocs:
  708. description: Find out more about Swagger
  709. url: 'http://swagger.io'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement