Guest User

Untitled

a guest
May 2nd, 2017
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.56 KB | None | 0 0
  1. swagger: "2.0"
  2. info:
  3. description: |
  4. This is a sample server Petstore server.
  5.  
  6. [Learn about Swagger](http://swagger.io) or join the IRC channel `#swagger` on irc.freenode.net.
  7.  
  8. For this sample, you can use the api key `special-key` to test the authorization filters
  9. version: "1.0.0"
  10. title: Swagger Petstore
  11. termsOfService: http://helloreverb.com/terms/
  12. contact:
  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. schemes:
  19. - http
  20. paths:
  21. /pets:
  22. post:
  23. tags:
  24. - pet
  25. summary: Add a new pet to the store
  26. description: ""
  27. operationId: addPet
  28. consumes:
  29. - application/json
  30. - application/xml
  31. produces:
  32. - application/json
  33. - application/xml
  34. parameters:
  35. - in: body
  36. name: body
  37. description: Pet object that needs to be added to the store
  38. required: false
  39. schema:
  40. $ref: "#/definitions/Pet"
  41. responses:
  42. "405":
  43. description: Invalid input
  44. security:
  45. - petstore_auth:
  46. - write_pets
  47. - read_pets
  48. put:
  49. tags:
  50. - pet
  51. summary: Update an existing pet
  52. description: ""
  53. operationId: updatePet
  54. consumes:
  55. - application/json
  56. - application/xml
  57. produces:
  58. - application/json
  59. - application/xml
  60. parameters:
  61. - in: body
  62. name: body
  63. description: Pet object that needs to be added to the store
  64. required: false
  65. schema:
  66. $ref: "#/definitions/Pet"
  67. responses:
  68. "405":
  69. description: Validation exception
  70. "404":
  71. description: Pet not found
  72. "400":
  73. description: Invalid ID supplied
  74. security:
  75. - petstore_auth:
  76. - write_pets
  77. - read_pets
  78. /pets/findByStatus:
  79. get:
  80. tags:
  81. - pet
  82. summary: Finds Pets by status
  83. description: Multiple status values can be provided with comma seperated strings
  84. operationId: findPetsByStatus
  85. produces:
  86. - application/json
  87. - application/xml
  88. parameters:
  89. - in: query
  90. name: status
  91. description: Status values that need to be considered for filter
  92. required: false
  93. type: array
  94. items:
  95. type: string
  96. collectionFormat: multi
  97. responses:
  98. "200":
  99. description: successful operation
  100. schema:
  101. type: array
  102. items:
  103. $ref: "#/definitions/Pet"
  104. "400":
  105. description: Invalid status value
  106. security:
  107. - petstore_auth:
  108. - write_pets
  109. - read_pets
  110. /pets/findByTags:
  111. get:
  112. tags:
  113. - pet
  114. summary: Finds Pets by tags
  115. description: Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
  116. operationId: findPetsByTags
  117. produces:
  118. - application/json
  119. - application/xml
  120. parameters:
  121. - in: query
  122. name: tags
  123. description: Tags to filter by
  124. required: false
  125. type: array
  126. items:
  127. type: string
  128. collectionFormat: multi
  129. responses:
  130. "200":
  131. description: successful operation
  132. schema:
  133. type: array
  134. items:
  135. $ref: "#/definitions/Pet"
  136. "400":
  137. description: Invalid tag value
  138. security:
  139. - petstore_auth:
  140. - write_pets
  141. - read_pets
  142. /pets/{petId}:
  143. get:
  144. tags:
  145. - pet
  146. summary: Find pet by ID
  147. description: Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
  148. operationId: getPetById
  149. produces:
  150. - application/json
  151. - application/xml
  152. parameters:
  153. - in: path
  154. name: petId
  155. description: ID of pet that needs to be fetched
  156. required: true
  157. type: integer
  158. format: int64
  159. responses:
  160. "404":
  161. description: Pet not found
  162. "200":
  163. description: successful operation
  164. schema:
  165. $ref: "#/definitions/Pet"
  166. "400":
  167. description: Invalid ID supplied
  168. security:
  169. - api_key: []
  170. - petstore_auth:
  171. - write_pets
  172. - read_pets
  173. post:
  174. tags:
  175. - pet
  176. summary: Updates a pet in the store with form data
  177. description: ""
  178. operationId: updatePetWithForm
  179. consumes:
  180. - application/x-www-form-urlencoded
  181. produces:
  182. - application/json
  183. - application/xml
  184. parameters:
  185. - in: path
  186. name: petId
  187. description: ID of pet that needs to be updated
  188. required: true
  189. type: string
  190. - in: formData
  191. name: name
  192. description: Updated name of the pet
  193. required: true
  194. type: string
  195. - in: formData
  196. name: status
  197. description: Updated status of the pet
  198. required: true
  199. type: string
  200. responses:
  201. "405":
  202. description: Invalid input
  203. security:
  204. - petstore_auth:
  205. - write_pets
  206. - read_pets
  207. delete:
  208. tags:
  209. - pet
  210. summary: Deletes a pet
  211. description: ""
  212. operationId: deletePet
  213. produces:
  214. - application/json
  215. - application/xml
  216. parameters:
  217. - in: header
  218. name: api_key
  219. description: ""
  220. required: true
  221. type: string
  222. - in: path
  223. name: petId
  224. description: Pet id to delete
  225. required: true
  226. type: integer
  227. format: int64
  228. responses:
  229. "400":
  230. description: Invalid pet value
  231. security:
  232. - petstore_auth:
  233. - write_pets
  234. - read_pets
  235. /stores/order:
  236. post:
  237. tags:
  238. - store
  239. summary: Place an order for a pet
  240. description: ""
  241. operationId: placeOrder
  242. produces:
  243. - application/json
  244. - application/xml
  245. parameters:
  246. - in: body
  247. name: body
  248. description: order placed for purchasing the pet
  249. required: false
  250. schema:
  251. $ref: "#/definitions/Order"
  252. responses:
  253. "200":
  254. description: successful operation
  255. schema:
  256. $ref: "#/definitions/Order"
  257. "400":
  258. description: Invalid Order
  259. /stores/order/{orderId}:
  260. get:
  261. tags:
  262. - store
  263. summary: Find purchase order by ID
  264. description: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
  265. operationId: getOrderById
  266. produces:
  267. - application/json
  268. - application/xml
  269. parameters:
  270. - in: path
  271. name: orderId
  272. description: ID of pet that needs to be fetched
  273. required: true
  274. type: string
  275. responses:
  276. "404":
  277. description: Order not found
  278. "200":
  279. description: successful operation
  280. schema:
  281. $ref: "#/definitions/Order"
  282. "400":
  283. description: Invalid ID supplied
  284. delete:
  285. tags:
  286. - store
  287. summary: Delete purchase order by ID
  288. description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
  289. operationId: deleteOrder
  290. produces:
  291. - application/json
  292. - application/xml
  293. parameters:
  294. - in: path
  295. name: orderId
  296. description: ID of the order that needs to be deleted
  297. required: true
  298. type: string
  299. responses:
  300. "404":
  301. description: Order not found
  302. "400":
  303. description: Invalid ID supplied
  304. /users:
  305. post:
  306. tags:
  307. - user
  308. summary: Create user
  309. description: This can only be done by the logged in user.
  310. operationId: createUser
  311. produces:
  312. - application/json
  313. - application/xml
  314. parameters:
  315. - in: body
  316. name: body
  317. description: Created user object
  318. required: false
  319. schema:
  320. $ref: "#/definitions/User"
  321. responses:
  322. default:
  323. description: successful operation
  324. /users/createWithArray:
  325. post:
  326. tags:
  327. - user
  328. summary: Creates list of users with given input array
  329. description: ""
  330. operationId: createUsersWithArrayInput
  331. produces:
  332. - application/json
  333. - application/xml
  334. parameters:
  335. - in: body
  336. name: body
  337. description: List of user object
  338. required: false
  339. schema:
  340. type: array
  341. items:
  342. $ref: "#/definitions/User"
  343. responses:
  344. default:
  345. description: successful operation
  346. /users/createWithList:
  347. post:
  348. tags:
  349. - user
  350. summary: Creates list of users with given input array
  351. description: ""
  352. operationId: createUsersWithListInput
  353. produces:
  354. - application/json
  355. - application/xml
  356. parameters:
  357. - in: body
  358. name: body
  359. description: List of user object
  360. required: false
  361. schema:
  362. type: array
  363. items:
  364. $ref: "#/definitions/User"
  365. responses:
  366. default:
  367. description: successful operation
  368. /users/login:
  369. get:
  370. tags:
  371. - user
  372. summary: Logs user into the system
  373. description: ""
  374. operationId: loginUser
  375. produces:
  376. - application/json
  377. - application/xml
  378. parameters:
  379. - in: query
  380. name: username
  381. description: The user name for login
  382. required: false
  383. type: string
  384. - in: query
  385. name: password
  386. description: The password for login in clear text
  387. required: false
  388. type: string
  389. responses:
  390. "200":
  391. description: successful operation
  392. schema:
  393. type: string
  394. "400":
  395. description: Invalid username/password supplied
  396. /users/logout:
  397. get:
  398. tags:
  399. - user
  400. summary: Logs out current logged in user session
  401. description: ""
  402. operationId: logoutUser
  403. produces:
  404. - application/json
  405. - application/xml
  406. responses:
  407. default:
  408. description: successful operation
  409. /users/{username}:
  410. get:
  411. tags:
  412. - user
  413. summary: Get user by user name
  414. description: ""
  415. operationId: getUserByName
  416. produces:
  417. - application/json
  418. - application/xml
  419. parameters:
  420. - in: path
  421. name: username
  422. description: The name that needs to be fetched. Use user1 for testing.
  423. required: true
  424. type: string
  425. responses:
  426. "404":
  427. description: User not found
  428. "200":
  429. description: successful operation
  430. schema:
  431. $ref: "#/definitions/User"
  432. "400":
  433. description: Invalid username supplied
  434. put:
  435. tags:
  436. - user
  437. summary: Updated user
  438. description: This can only be done by the logged in user.
  439. operationId: updateUser
  440. produces:
  441. - application/json
  442. - application/xml
  443. parameters:
  444. - in: path
  445. name: username
  446. description: name that need to be deleted
  447. required: true
  448. type: string
  449. - in: body
  450. name: body
  451. description: Updated user object
  452. required: false
  453. schema:
  454. $ref: "#/definitions/User"
  455. responses:
  456. "404":
  457. description: User not found
  458. "400":
  459. description: Invalid user supplied
  460. delete:
  461. tags:
  462. - user
  463. summary: Delete user
  464. description: This can only be done by the logged in user.
  465. operationId: deleteUser
  466. produces:
  467. - application/json
  468. - application/xml
  469. parameters:
  470. - in: path
  471. name: username
  472. description: The name that needs to be deleted
  473. required: true
  474. type: string
  475. responses:
  476. "404":
  477. description: User not found
  478. "400":
  479. description: Invalid username supplied
  480. securityDefinitions:
  481. api_key:
  482. type: apiKey
  483. name: api_key
  484. in: header
  485. petstore_auth:
  486. type: oauth2
  487. authorizationUrl: http://petstore.swagger.io/api/oauth/dialog
  488. flow: implicit
  489. scopes:
  490. write_pets: modify pets in your account
  491. read_pets: read your pets
  492. definitions:
  493. User:
  494. type: object
  495. properties:
  496. id:
  497. type: integer
  498. format: int64
  499. username:
  500. type: string
  501. firstName:
  502. type: string
  503. lastName:
  504. type: string
  505. email:
  506. type: string
  507. password:
  508. type: string
  509. phone:
  510. type: string
  511. userStatus:
  512. type: integer
  513. format: int32
  514. description: User Status
  515. Category:
  516. type: object
  517. properties:
  518. id:
  519. type: integer
  520. format: int64
  521. name:
  522. type: string
  523. Pet:
  524. type: object
  525. required:
  526. - name
  527. - photoUrls
  528. properties:
  529. id:
  530. type: integer
  531. format: int64
  532. category:
  533. $ref: "#/definitions/Category"
  534. name:
  535. type: string
  536. example: doggie
  537. photoUrls:
  538. type: array
  539. items:
  540. type: string
  541. tags:
  542. type: array
  543. items:
  544. $ref: "#/definitions/Tag"
  545. status:
  546. type: string
  547. description: pet status in the store
  548. Tag:
  549. type: object
  550. properties:
  551. id:
  552. type: integer
  553. format: int64
  554. name:
  555. type: string
  556. Order:
  557. type: object
  558. properties:
  559. id:
  560. type: integer
  561. format: int64
  562. petId:
  563. type: integer
  564. format: int64
  565. quantity:
  566. type: integer
  567. format: int32
  568. shipDate:
  569. type: string
  570. format: date-time
  571. status:
  572. type: string
  573. description: Order Status
  574. complete:
  575. type: boolean
Add Comment
Please, Sign In to add comment