Guest User

Untitled

a guest
Mar 23rd, 2018
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.22 KB | None | 0 0
  1. swagger: "2.0"
  2. info:
  3. description: "Sample server that handles the bowling center alley managment"
  4. version: "1.0.0"
  5. title: "Bowling alley center managment system"
  6. termsOfService: "http://swagger.io/terms/"
  7. contact:
  8. license:
  9. name: "Apache 2.0"
  10. url: "http://www.apache.org/licenses/LICENSE-2.0.html"
  11. host: "bowlingalley.swagger.io"
  12. basePath: "/v2"
  13. tags:
  14. - name: "reservation"
  15. - name: "user"
  16. paths:
  17. /center/reservation:
  18. get:
  19. tags:
  20. - "reservation"
  21. summary: "Get all the reservations "
  22. description: "returns reservations"
  23. operationId: "getReservations"
  24. produces:
  25. - "application/json"
  26. parameters:
  27. - in: "body"
  28. name: "body"
  29. description: "get list of reservations"
  30. required: true
  31. schema:
  32. type: "array"
  33. items:
  34. $ref: "#/definitions/Reservation"
  35. responses:
  36. default:
  37. description: "successful operation"
  38. post:
  39. tags:
  40. - "reservation"
  41. summary: "Add a new reservation"
  42. description: ""
  43. operationId: "addReservation"
  44. consumes:
  45. - "application/json"
  46. - "application/xml"
  47. produces:
  48. - "application/xml"
  49. - "application/json"
  50. parameters:
  51. - in: "body"
  52. name: "body"
  53. description: "Reservation that has to be added to list of reservations"
  54. required: true
  55. schema:
  56. $ref: "#/definitions/Reservation"
  57. responses:
  58. 405:
  59. description: "Invalid input"
  60. security:
  61. - reservation_auth:
  62. - "write:reservations"
  63. - "read:reservations"
  64. put:
  65. tags:
  66. - "reservation"
  67. summary: "Update an existing reservation"
  68. description: ""
  69. operationId: "updateReservation"
  70. consumes:
  71. - "application/json"
  72. - "application/xml"
  73. produces:
  74. - "application/xml"
  75. - "application/json"
  76. parameters:
  77. - in: "body"
  78. name: "body"
  79. description: "Reservation that has to be updated"
  80. required: true
  81. schema:
  82. $ref: "#/definitions/Reservation"
  83. responses:
  84. 400:
  85. description: "Invalid ID supplied"
  86. 404:
  87. description: "Reservation not found"
  88. 405:
  89. description: "Validation exception"
  90. security:
  91. - reservation_auth:
  92. - "write:reservations"
  93. - "read:reservations"
  94. /center/reservation/{userId}:
  95. get:
  96. tags:
  97. - "reservation"
  98. summary: "Find all reservations for certain user"
  99. description: "insert user id to find all reservations assigned to it"
  100. operationId: "getReservationByUser"
  101. produces:
  102. - "application/xml"
  103. - "application/json"
  104. parameters:
  105. - name: "userId"
  106. in: "path"
  107. description: "user ID that we want to get reservations for"
  108. required: true
  109. type: "integer"
  110. maximum: 10.0
  111. minimum: 1.0
  112. format: "int64"
  113. responses:
  114. 200:
  115. description: "successful operation"
  116. schema:
  117. $ref: "#/definitions/Reservation"
  118. 400:
  119. description: "Invalid ID supplied"
  120. 404:
  121. description: "User not found"
  122. /center/reservation/track/{trackId}:
  123. get:
  124. tags:
  125. - "reservation"
  126. summary: "Find all reservations for certain track"
  127. description: "insert track id to find all reservations assigned to it"
  128. operationId: "getReservationByTrack"
  129. produces:
  130. - "application/xml"
  131. - "application/json"
  132. parameters:
  133. - name: "trackId"
  134. in: "path"
  135. description: "track ID that we want to get reservations for"
  136. required: true
  137. type: "integer"
  138. maximum: 10.0
  139. minimum: 1.0
  140. format: "int64"
  141. responses:
  142. 200:
  143. description: "successful operation"
  144. schema:
  145. $ref: "#/definitions/Reservation"
  146. 400:
  147. description: "Invalid ID supplied"
  148. 404:
  149. description: "Track not found"
  150. delete:
  151. tags:
  152. - "reservation"
  153. summary: "Deletes a reservation"
  154. description: ""
  155. operationId: "deleteReservation"
  156. produces:
  157. - "application/xml"
  158. - "application/json"
  159. parameters:
  160. - name: "trackId"
  161. in: "path"
  162. description: "reservation id to delete"
  163. required: true
  164. type: "integer"
  165. format: "int64"
  166. responses:
  167. 400:
  168. description: "Invalid ID supplied"
  169. 404:
  170. description: "reservation not found"
  171. security:
  172. - reservation_auth:
  173. - "write:reservations"
  174. - "read:reservations"
  175. /user:
  176. post:
  177. tags:
  178. - "user"
  179. summary: "Create user"
  180. description: "This can only be done by the logged in user."
  181. operationId: "createUser"
  182. produces:
  183. - "application/xml"
  184. - "application/json"
  185. parameters:
  186. - in: "body"
  187. name: "body"
  188. description: "Created user object"
  189. required: true
  190. schema:
  191. $ref: "#/definitions/User"
  192. responses:
  193. default:
  194. description: "successful operation"
  195. /user/createWithArray:
  196. post:
  197. tags:
  198. - "user"
  199. summary: "Creates list of users with given input array"
  200. description: ""
  201. operationId: "createUsersWithArrayInput"
  202. produces:
  203. - "application/xml"
  204. - "application/json"
  205. parameters:
  206. - in: "body"
  207. name: "body"
  208. description: "List of user object"
  209. required: true
  210. schema:
  211. type: "array"
  212. items:
  213. $ref: "#/definitions/User"
  214. responses:
  215. default:
  216. description: "successful operation"
  217. /user/createWithList:
  218. post:
  219. tags:
  220. - "user"
  221. summary: "Creates list of users with given input array"
  222. description: ""
  223. operationId: "createUsersWithListInput"
  224. produces:
  225. - "application/xml"
  226. - "application/json"
  227. parameters:
  228. - in: "body"
  229. name: "body"
  230. description: "List of user object"
  231. required: true
  232. schema:
  233. type: "array"
  234. items:
  235. $ref: "#/definitions/User"
  236. responses:
  237. default:
  238. description: "successful operation"
  239. /user/login:
  240. get:
  241. tags:
  242. - "user"
  243. summary: "Logs user into the system"
  244. description: ""
  245. operationId: "loginUser"
  246. produces:
  247. - "application/xml"
  248. - "application/json"
  249. parameters:
  250. - name: "username"
  251. in: "query"
  252. description: "The user name for login"
  253. required: true
  254. type: "string"
  255. - name: "password"
  256. in: "query"
  257. description: "The password for login in clear text"
  258. required: true
  259. type: "string"
  260. responses:
  261. 200:
  262. description: "successful operation"
  263. schema:
  264. type: "string"
  265. headers:
  266. X-Rate-Limit:
  267. type: "integer"
  268. format: "int32"
  269. description: "calls per hour allowed by the user"
  270. X-Expires-After:
  271. type: "string"
  272. format: "date-time"
  273. description: "date in UTC when token expires"
  274. 400:
  275. description: "Invalid username/password supplied"
  276. /user/logout:
  277. get:
  278. tags:
  279. - "user"
  280. summary: "Logs out current logged in user session"
  281. description: ""
  282. operationId: "logoutUser"
  283. produces:
  284. - "application/xml"
  285. - "application/json"
  286. parameters: []
  287. responses:
  288. default:
  289. description: "successful operation"
  290. /user/{username}:
  291. get:
  292. tags:
  293. - "user"
  294. summary: "Get user by user name"
  295. description: ""
  296. operationId: "getUserByName"
  297. produces:
  298. - "application/xml"
  299. - "application/json"
  300. parameters:
  301. - name: "username"
  302. in: "path"
  303. description: "The name that needs to be fetched. Use user1 for testing. "
  304. required: true
  305. type: "string"
  306. responses:
  307. 200:
  308. description: "successful operation"
  309. schema:
  310. $ref: "#/definitions/User"
  311. 400:
  312. description: "Invalid username supplied"
  313. 404:
  314. description: "User not found"
  315. put:
  316. tags:
  317. - "user"
  318. summary: "Updated user"
  319. description: "This can only be done by the logged in user."
  320. operationId: "updateUser"
  321. produces:
  322. - "application/xml"
  323. - "application/json"
  324. parameters:
  325. - name: "username"
  326. in: "path"
  327. description: "name that need to be updated"
  328. required: true
  329. type: "string"
  330. - in: "body"
  331. name: "body"
  332. description: "Updated user object"
  333. required: true
  334. schema:
  335. $ref: "#/definitions/User"
  336. responses:
  337. 400:
  338. description: "Invalid user supplied"
  339. 404:
  340. description: "User not found"
  341. delete:
  342. tags:
  343. - "user"
  344. summary: "Delete user"
  345. description: "This can only be done by the logged in user."
  346. operationId: "deleteUser"
  347. produces:
  348. - "application/xml"
  349. - "application/json"
  350. parameters:
  351. - name: "username"
  352. in: "path"
  353. description: "The name that needs to be deleted"
  354. required: true
  355. type: "string"
  356. responses:
  357. 400:
  358. description: "Invalid username supplied"
  359. 404:
  360. description: "User not found"
  361. securityDefinitions:
  362. reservation_auth:
  363. type: "oauth2"
  364. authorizationUrl: "http://bowlingalley.swagger.io/oauth/dialog"
  365. flow: "implicit"
  366. scopes:
  367. write:reservations: "modify reservations in your account"
  368. read:reservations: "read your reservations"
  369. api_key:
  370. type: "apiKey"
  371. name: "api_key"
  372. in: "header"
  373. definitions:
  374. User:
  375. type: "object"
  376. properties:
  377. id:
  378. type: "integer"
  379. format: "int64"
  380. name:
  381. type: "string"
  382. surname:
  383. type: "string"
  384. username:
  385. type: "string"
  386. email:
  387. type: "string"
  388. password:
  389. type: "string"
  390. userStatus:
  391. type: "string"
  392. description: "Indicator whether user is currently playing or not"
  393. enum:
  394. - "playing"
  395. - "not_playing"
  396. xml:
  397. name: "User"
  398. Reservation:
  399. type: "object"
  400. properties:
  401. id:
  402. type: "integer"
  403. format: "int64"
  404. used_track_id:
  405. type: "integer"
  406. format: "int64"
  407. time_started:
  408. type: "string"
  409. time_ending:
  410. type: "string"
  411. playing_user_id:
  412. type: "integer"
  413. format: "int64"
  414. xml:
  415. name: "Tag"
  416. ApiResponse:
  417. type: "object"
  418. properties:
  419. code:
  420. type: "integer"
  421. format: "int32"
  422. type:
  423. type: "string"
  424. message:
  425. type: "string"
  426. externalDocs:
  427. description: "Find out more about Swagger"
  428. url: "http://swagger.io"
Advertisement
Add Comment
Please, Sign In to add comment