Advertisement
Guest User

Untitled

a guest
Jan 18th, 2019
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.93 KB | None | 0 0
  1. swagger: "2.0"
  2. info:
  3. title: "altoroJRest"
  4. version: "1.0.2"
  5. host: "appscanvm:8080"
  6. basePath: "/AltoroJ/api"
  7. tags:
  8. - name: "1. Login"
  9. description: "Login mechanism"
  10. - name: "2. Account"
  11. description: "View account information"
  12. - name: "3. Transfer"
  13. description: "Transfer funds between accounts"
  14. - name: "4. Feedback"
  15. description: "Submit and review feedback"
  16. - name: "5. Admin"
  17. description: "Add and change user details"
  18. - name: "6. Logout"
  19. description: "Logout mechanism"
  20. paths:
  21. /login:
  22. get:
  23. tags:
  24. - "1. Login"
  25. summary: "Check if any user is logged in"
  26. description: "If a user is loggedin the username will be returned"
  27. operationId: "checkLogin"
  28. produces:
  29. - "application/json"
  30. parameters: []
  31. responses:
  32. '200':
  33. description: "Status on whether the user is logged in or not"
  34. post:
  35. tags:
  36. - "1. Login"
  37. summary: "Login method"
  38. description: "After a login is successful a success message will be returned"
  39. operationId: "login"
  40. consumes:
  41. - "application/json"
  42. produces:
  43. - "application/json"
  44. parameters:
  45. - in: "body"
  46. name: "body"
  47. description: 'Username and password combination to allow users to log-in'
  48. required: true
  49. schema:
  50. $ref: "#/definitions/login"
  51. responses:
  52. '200':
  53. description: "Success message when login is complete"
  54. '400':
  55. description: "User error message"
  56. '500':
  57. description: "Server error message"
  58. /account:
  59. get:
  60. tags:
  61. - "2. Account"
  62. operationId: "getAccount"
  63. produces:
  64. - "application/json"
  65. description: "Returns a list of all the accounts owned by the user"
  66. parameters: []
  67. responses:
  68. '200':
  69. description: "Successful operation"
  70. '401':
  71. description: "Unauthorized request"
  72. '500':
  73. description: "Internal server error"
  74. /account/{accountNo}:
  75. get:
  76. tags:
  77. - "2. Account"
  78. operationId: "getAccountBalance"
  79. produces:
  80. - "application/json"
  81. description: "Returns details about a specific account"
  82. parameters:
  83. - name: "accountNo"
  84. in: "path"
  85. required: true
  86. description: 'Account id'
  87. type: "string"
  88. responses:
  89. '200':
  90. description: "Successful operation"
  91. '401':
  92. description: "Unauthorized request"
  93. '500':
  94. description: "Internal server error"
  95. /account/{accountNo}/transactions:
  96. get:
  97. tags:
  98. - "2. Account"
  99. operationId: "showLastTenTransactions"
  100. description: "Returns the last 10 transactions attached to an account"
  101. produces:
  102. - "application/json"
  103. parameters:
  104. - name: "accountNo"
  105. in: "path"
  106. required: true
  107. description: "Account id"
  108. type: "string"
  109. responses:
  110. '200':
  111. description: "Successful operation"
  112. '401':
  113. description: "Unauthorized request"
  114. '500':
  115. description: "Internal server error"
  116. post:
  117. tags:
  118. - "2. Account"
  119. description: "Return transactions between 2 specific dates"
  120. operationId: "getTransactions"
  121. consumes:
  122. - "application/json"
  123. produces:
  124. - "application/json"
  125. parameters:
  126. - name: "accountNo"
  127. in: "path"
  128. required: true
  129. description: "Account id"
  130. type: "string"
  131. - in: "body"
  132. name: "body"
  133. description: 'A start date and an end date'
  134. required: true
  135. schema:
  136. $ref: "#/definitions/dates"
  137. responses:
  138. '200':
  139. description: "Successful operation"
  140. '401':
  141. description: "Unauthorized request"
  142. '501':
  143. description: "Internal server error"
  144. /transfer:
  145. post:
  146. tags:
  147. - "3. Transfer"
  148. description: "Transfer money between two accounts"
  149. operationId: "trasnfer"
  150. consumes:
  151. - "application/json"
  152. produces:
  153. - "application/json"
  154. parameters:
  155. - in: "body"
  156. name: "body"
  157. description: "Transfer details including ammount, sender and receiver"
  158. required: true
  159. schema:
  160. $ref: "#/definitions/transfer"
  161. responses:
  162. '200':
  163. description: "Successful operation"
  164. '501':
  165. description: "Internal server error"
  166. /feedback/submit:
  167. post:
  168. tags:
  169. - "4. Feedback"
  170. description: "Submit feedback for the bank"
  171. operationId: "sendFeedback"
  172. consumes:
  173. - "application/json"
  174. produces:
  175. - "application/json"
  176. responses:
  177. '200':
  178. description: "Successful operation"
  179. '401':
  180. description: "Unauthorized request"
  181. '500':
  182. description: "Internal server error"
  183. parameters:
  184. - in: "body"
  185. name: "body"
  186. description: "Feedback details including name, email the subject and complete message"
  187. required: true
  188. schema:
  189. $ref: "#/definitions/feedback"
  190. /feedback/{feedbackId}:
  191. get:
  192. tags:
  193. - "4. Feedback"
  194. description: "Retrieve feedback"
  195. operationId: "getFeedback"
  196. produces:
  197. - "application/json"
  198. responses:
  199. '200':
  200. description: "Successful operation"
  201. '401':
  202. description: "Unauthorized request"
  203. '500':
  204. description: "Internal server error"
  205. parameters:
  206. - name: "feedbackId"
  207. in: "path"
  208. required: true
  209. type: "string"
  210. /admin/addUser:
  211. post:
  212. tags:
  213. - "5. Admin"
  214. description: "Add new user"
  215. operationId: "addUser"
  216. consumes:
  217. - "application/json"
  218. produces:
  219. - "application/json"
  220. responses:
  221. '200':
  222. description: "Successful operation"
  223. '400':
  224. description: "Unauthorized request"
  225. '500':
  226. description: "Error creating user"
  227. parameters:
  228. - in: "body"
  229. name: "body"
  230. description: "Details of a new user including first name, last name, desired username and a password"
  231. required: true
  232. schema:
  233. $ref: "#/definitions/newUser"
  234. /admin/changePassword:
  235. post:
  236. tags:
  237. - "5. Admin"
  238. description: "Change user password"
  239. consumes:
  240. - "application/json"
  241. produces:
  242. - "application/json"
  243. operationId: "changePassword"
  244. responses:
  245. '200':
  246. description: "Successful operation"
  247. '400':
  248. description: "Unauthorized request"
  249. '500':
  250. description: "Error in changing the username password"
  251. parameters:
  252. - in: "body"
  253. name: "body"
  254. description: "Information about the user password to be changed including id and new password"
  255. required: true
  256. schema:
  257. $ref: "#/definitions/changePassword"
  258. /logout:
  259. get:
  260. tags:
  261. - "6. Logout"
  262. description: "Logout from the bank"
  263. operationId: "doLogOut"
  264. produces:
  265. - "application/json"
  266. parameters: []
  267. responses:
  268. '200':
  269. description: "Successful operation"
  270. '500':
  271. description: 'Unauthorized request '
  272.  
  273. definitions:
  274. login:
  275. type: "object"
  276. required:
  277. - "username"
  278. - "password"
  279. properties:
  280. username:
  281. type: "string"
  282. example: "jsmith"
  283. password:
  284. type: "string"
  285. example: "demo1234"
  286. dates:
  287. type: "object"
  288. required:
  289. - "startDate"
  290. - "endDate"
  291. properties:
  292. startDate:
  293. type: "string"
  294. format: "date"
  295. example: "2012-03-12"
  296. endDate:
  297. type: "string"
  298. format: "date"
  299. example: "2012-03-17"
  300. transfer:
  301. type: "object"
  302. required:
  303. - "toAccount"
  304. - "fromAccount"
  305. - "transferAmount"
  306. properties:
  307. toAccount:
  308. type: "string"
  309. example: "800002"
  310. fromAccount:
  311. type: "string"
  312. example: "800003"
  313. transferAmount:
  314. type: "string"
  315. example: "200"
  316. feedback:
  317. type: "object"
  318. required:
  319. - "name"
  320. - "email"
  321. - "subject"
  322. - "message"
  323. properties:
  324. name:
  325. type: "string"
  326. example: "J Smith"
  327. email:
  328. type: "string"
  329. format: "email"
  330. example: "jsmtih@altoromutual.com"
  331. subject:
  332. type: "string"
  333. example: "Amazing web design"
  334. message:
  335. type: "string"
  336. example: "I like the new look of your applicaiton"
  337. newUser:
  338. type: "object"
  339. required:
  340. - "firstname"
  341. - "lastname"
  342. - "username"
  343. - "password1"
  344. - "password2"
  345. properties:
  346. firstname:
  347. type: "string"
  348. example: "Bilbo"
  349. lastname:
  350. type: "string"
  351. example: "Baggins"
  352. username:
  353. type: "string"
  354. example: "bilbob"
  355. password1:
  356. type: "string"
  357. format: "password"
  358. example: "S3l3ctS0methingStr0ng5AsP@ssword"
  359. password2:
  360. type: "string"
  361. format: "password"
  362. example: "S3l3ctS0methingStr0ng5AsP@ssword"
  363. changePassword:
  364. type: "object"
  365. required:
  366. - "username"
  367. - "password1"
  368. - "password2"
  369. properties:
  370. username:
  371. type: "string"
  372. example: "jdoe"
  373. password1:
  374. type: "string"
  375. format: "password"
  376. example: "Th1s!sz3nu3Passv0rd"
  377. password2:
  378. type: "string"
  379. format: "password"
  380. example: "Th1s!sz3nu3Passv0rd"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement