Advertisement
Guest User

Untitled

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