Advertisement
Guest User

Untitled

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