Advertisement
Guest User

Untitled

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