Advertisement
Guest User

Untitled

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