Advertisement
Guest User

Untitled

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