Advertisement
Guest User

Untitled

a guest
Feb 28th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.99 KB | None | 0 0
  1. swagger: '2.0'
  2. info:
  3. version: 1.0.0
  4. title: Swagger
  5. termsOfService: 'http://swagger.io/terms/'
  6. contact:
  7. email: apiteam@swagger.io
  8. license:
  9. name: Apache 2.0
  10. url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
  11. tags:
  12. - name: medication
  13. description: Operations about medication
  14. - name: user
  15. description: Operations about user
  16. externalDocs:
  17. description: Find out more about our store
  18. url: 'http://swagger.io'
  19. schemes:
  20. - http
  21. paths:
  22.  
  23. /medications:
  24. post:
  25. tags:
  26. - medication
  27. summary: Create medication
  28. description: Create medication
  29. operationId: createMedication
  30. produces:
  31. - application/json
  32. parameters:
  33. - in: body
  34. name: body
  35. description: Medication object
  36. required: true
  37. schema:
  38. $ref: '#/definitions/CreateMedicationModel'
  39. responses:
  40. '201':
  41. description: successfully added
  42. schema:
  43. $ref: '#/definitions/MedicationModel'
  44. '4XX':
  45. schema:
  46. type: array
  47. items:
  48. $ref: '#/definitions/ErrorModel'
  49. get:
  50. tags:
  51. - medication
  52. summary: Get user's medications
  53. description: Get user's meeications
  54. operationId: getMedications
  55. produces:
  56. - application/json
  57. responses:
  58. '200':
  59. description: successful operation
  60. schema:
  61. type: array
  62. items:
  63. $ref: '#/definitions/MedicationModel'
  64. '4XX':
  65. schema:
  66. type: array
  67. items:
  68. $ref: '#/definitions/ErrorModel'
  69. /orders:
  70. get:
  71. tags:
  72. - order
  73. summary: Get user's orders
  74. description: Get user's orders
  75. operationId: getOrders
  76. produces:
  77. - application/json
  78. responses:
  79. '200':
  80. description: successful operation
  81. schema:
  82. type: array
  83. items:
  84. $ref: '#/definitions/OrderModel'
  85. '4XX':
  86. schema:
  87. type: array
  88. items:
  89. $ref: '#/definitions/ErrorModel'
  90. put:
  91. tags:
  92. - order
  93. summary: Create order
  94. description: Create order
  95. operationId: createOrder
  96. produces:
  97. - appolica/json
  98. response:
  99. '200'
  100. description: successful operation
  101. schema:
  102. '4XX':
  103. schema:
  104. type: array
  105. items:
  106. $ref: '#/definitions/ErrorModel'
  107.  
  108.  
  109. /users:
  110. post:
  111. security: []
  112. tags:
  113. - user
  114. summary: Create user
  115. description: Register
  116. operationId: createUser
  117. produces:
  118. - application/json
  119. parameters:
  120. - in: body
  121. name: body
  122. description: User object
  123. required: true
  124. schema:
  125. $ref: '#/definitions/CreateUserModel'
  126. responses:
  127. '4XX':
  128. schema:
  129. type: array
  130. items:
  131. $ref: '#/definitions/ErrorModel'
  132. '201':
  133. description: successful operation
  134. schema:
  135. $ref: '#/definitions/CreateUserModel'
  136. put:
  137. tags:
  138. - user
  139. summary: Updated user
  140. description: This can only be done by the logged in user.
  141. operationId: updateUser
  142. produces:
  143. - application/json
  144. parameters:
  145. - in: body
  146. name: body
  147. description: Updated user object
  148. required: false
  149. schema:
  150. $ref: '#/definitions/CreateUserModel'
  151. responses:
  152. '4XX':
  153. schema:
  154. $ref: '#/definitions/ErrorModel'
  155. '202':
  156. description: accepted
  157. schema:
  158. $ref: '#/definitions/User'
  159. /users/me:
  160. get:
  161. tags:
  162. - user
  163. summary: Gets current user
  164. description: ""
  165. produces:
  166. - application/json
  167. responses:
  168. '200':
  169. description: successful operation
  170. schema:
  171. $ref: '#/definitions/User'
  172. '4XX':
  173. schema:
  174. type: array
  175. items:
  176. $ref: '#/definitions/ErrorModel'
  177.  
  178. /users/sessions:
  179. post:
  180. security: []
  181. tags:
  182. - user
  183. summary: Logs user into the system
  184. description: Login
  185. operationId: loginUser
  186. produces:
  187. - application/json
  188. parameters:
  189. - in: body
  190. name: body
  191. description: User object
  192. required: true
  193. schema:
  194. $ref: '#/definitions/LoginUserModel'
  195. responses:
  196. '200':
  197. description: successful operation
  198. schema:
  199. $ref: '#/definitions/SessionTokenModel'
  200. '4XX':
  201. schema:
  202. type: array
  203. items:
  204. $ref: '#/definitions/ErrorModel'
  205. /user/validateAccount: # Every field of the user's model should be validated and return what is missing
  206. put:
  207. security: []
  208. tags:
  209. - user
  210. summary: Checks users information
  211. operationId: validateAccount
  212. produces:
  213. - application/json
  214. parameters:
  215. - in: body
  216. name: body
  217. description: Updated user object
  218. required: false
  219. schema:
  220. $ref: '#/definitions/CreateUserModel'
  221. responses:
  222. '200':
  223. description: successful operation
  224. '4XX':
  225. schema:
  226. type: array
  227. items:
  228. $ref: '#/definitions/ErrorModel'
  229. /services:
  230. get:
  231. tags:
  232. - service
  233. summary: Gets all services
  234. operationId: getServices
  235. produces:
  236. - application/json
  237. responses:
  238. '200':
  239. description: successful operation
  240. schema:
  241. $ref: '#/definitions/ServiceModel'
  242. '4XX':
  243. schema:
  244. type: array
  245. items:
  246. $ref: '#/definitions/ErrorModel'
  247.  
  248. /services/{id}:
  249. get:
  250. tags:
  251. - service
  252. summary: Represents a service model
  253. description: Represents a single service model
  254. operationId: getServiceById
  255. produces:
  256. - application/json
  257. parameters:
  258. - in: path
  259. name: id
  260. description: Service ID
  261. required: true
  262. schema:
  263. type: integer
  264. format: int64
  265. responses:
  266. '200':
  267. description: successful operation
  268. schema:
  269. $ref: '#/definitions/SingleServiceModel'
  270. '4XX':
  271. schema:
  272. type: array
  273. items:
  274. $ref: '#/definitions/ErrorModel'
  275. /pharmacies:
  276. get:
  277. tags:
  278. - pharmacies
  279. summary: Get all pharmacies
  280. description: Get all pharmacies
  281. operationId: getPharmacies
  282. produces:
  283. - application/json
  284. parameters:
  285. - in: path
  286. name: name
  287. description: pharmacy's name
  288. required: false
  289. schema:
  290. type: string
  291. responses:
  292. '200':
  293. description: successful operation
  294. schema:
  295. $ref: '#/definitions/PharmacyModel'
  296. '4XX':
  297. schema:
  298. type: array
  299. items:
  300. $ref: '#/definitions/ErrorModel'
  301. /contact:
  302. get:
  303. tags:
  304. - contact
  305. summary: Get user's current pharmacy
  306. description: Get user's current pharmacy
  307. operationId: getPharmacy
  308. produces:
  309. - application/json
  310. responses:
  311. '200':
  312. description: successful operation
  313. schema:
  314. $ref: '#/definitions/PharmacyModel'
  315. '4XX':
  316. schema:
  317. type: array
  318. items:
  319. $ref: '#/definitions/ErrorModel'
  320.  
  321.  
  322. components:
  323. securitySchemes:
  324. bearerAuth:
  325. type: http
  326. scheme: bearer
  327. bearerFormat: JWT
  328. security:
  329. - bearerAuth: []
  330. definitions:
  331. CreateMedicationModel:
  332. type: object
  333. properties:
  334. name:
  335. type: string
  336. reminder:
  337. type: string
  338. description: Reminder Status
  339. enum:
  340. - morning
  341. - noon
  342. - evening
  343. - night
  344. quantity:
  345. type: string
  346. MedicationModel:
  347. type: object
  348. properties:
  349. id:
  350. type: integer
  351. name:
  352. type: string
  353. reminder:
  354. type: string
  355. description: Reminder Status
  356. enum:
  357. - morning
  358. - noon
  359. - evening
  360. - night
  361. quantity:
  362. type: string
  363. AddressModel:
  364. type: object
  365. properties:
  366. latitude:
  367. type: number
  368. longitude:
  369. type: number
  370. name:
  371. type: string
  372. ContactModel:
  373. type: object
  374. properties:
  375. address:
  376. $ref: '#/definitions/AddressModel'
  377. phone:
  378. type: string
  379. email:
  380. type: string
  381. SessionTokenModel:
  382. type: object
  383. properties:
  384. sessionToken:
  385. type: string
  386. LoginUserModel:
  387. type: object
  388. properties:
  389. username:
  390. type: string
  391. password:
  392. type: string
  393. CreateUserModel:
  394. type: object
  395. properties:
  396. phapharmacyId:
  397. type: integer
  398. format: int64
  399. name:
  400. type: string
  401. password:
  402. type: string
  403. dateOfBirth:
  404. type: string
  405. phone:
  406. type: string
  407. email:
  408. type: string
  409. address:
  410. $ref: '#/definitions/AddressModel'
  411. insuranceCardNumber:
  412. type: integer
  413. format: int64
  414. xml:
  415. name: User
  416. PriceModel:
  417. type: object
  418. properties:
  419. currency:
  420. type: string
  421. value:
  422. type: number
  423.  
  424. OrderModel:
  425. type: object
  426. properties:
  427. id:
  428. type: integer
  429. format: int64
  430. status:
  431. type: string
  432. enum:
  433. - active
  434. - on-hold
  435. - cancelled
  436. - completed
  437. - entered-in-error
  438. - stopped
  439. - draft
  440. - unknown
  441. images:
  442. items:
  443. type: string
  444.  
  445. date:
  446. type: string
  447. pharmacy:
  448. $ref: '#/definitions/PharmacyModel'
  449. price:
  450. $ref: '#/definitions/PriceModel'
  451. ServiceModel:
  452. type: object
  453. properties:
  454. id:
  455. type: integer
  456. format: int64
  457. title:
  458. type: string
  459. format: int64
  460. SingleServiceModel:
  461. type: object
  462. properties:
  463. id:
  464. type: integer
  465. format: int64
  466. imageURL:
  467. type: string
  468. title:
  469. type: string
  470. description:
  471. type: string
  472. linkURL:
  473. type: string
  474. PharmacyModel:
  475. type: object
  476. properties:
  477. id:
  478. type: integer
  479. format: int64
  480. name:
  481. type: string
  482. addresses:
  483. items:
  484. $ref: '#/definitions/AddressModel'
  485. contacts:
  486. items:
  487. $ref: '#/definitions/ContactModel'
  488. User:
  489. type: object
  490. properties:
  491. id:
  492. type: integer
  493. format: int64
  494. phapharmacy:
  495. $ref: '#/definitions/PharmacyModel'
  496. name:
  497. type: string
  498. dateOfBirth:
  499. type: string
  500. address:
  501. $ref: '#/definitions/AddressModel'
  502. phone:
  503. type: string
  504. email:
  505. type: string
  506. insuranceCardNumber:
  507. type: integer
  508. format: int64
  509. xml:
  510. name: User
  511. ErrorModel:
  512. type: object
  513. properties:
  514. code:
  515. type: integer
  516. enum:
  517. - 400
  518. - 401
  519. - 403
  520. - 404
  521. messageKey:
  522. type: string
  523. messageValue:
  524. type: string
  525. externalDocs:
  526. description: Find out more about Swagger
  527. url: 'http://swagger.io'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement