Advertisement
Guest User

Untitled

a guest
Feb 27th, 2018
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.30 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. /medication:
  30. post:
  31. security:
  32. - bearerAuth: []
  33. tags:
  34. - medication
  35. summary: Create medication
  36. description: Create medication
  37. operationId: createMedication
  38. produces:
  39. - application/json
  40. parameters:
  41. - in: body
  42. name: body
  43. description: Medication object
  44. required: true
  45. schema:
  46. $ref: '#/definitions/CreateMedicationModel'
  47. responses:
  48. default:
  49. description: successful operation
  50. /medications:
  51. get:
  52. security:
  53. - bearerAuth: []
  54. tags:
  55. - medication
  56. summary: Get user's medications
  57. description: Get user's meeications
  58. operationId: getMedications
  59. produces:
  60. - application/json
  61. responses:
  62. '200':
  63. description: successful operation
  64. schema:
  65. type: array
  66. items:
  67. $ref: '#/definitions/MedicationModel'
  68. '400':
  69. description: Invalid status value
  70.  
  71. /user:
  72. post:
  73. tags:
  74. - user
  75. summary: Create user
  76. description: Register
  77. operationId: createUser
  78. produces:
  79. - application/xml
  80. - application/json
  81. parameters:
  82. - in: body
  83. name: body
  84. description: User object
  85. required: true
  86. schema:
  87. $ref: '#/definitions/CreateUserModel'
  88. responses:
  89. default:
  90. description: successful operation
  91. put:
  92. security:
  93. - bearerAuth: []
  94. tags:
  95. - user
  96. summary: Updated user
  97. description: This can only be done by the logged in user.
  98. operationId: updateUser
  99. produces:
  100. - application/xml
  101. - application/json
  102. parameters:
  103. - in: body
  104. name: body
  105. description: Updated user object
  106. required: true
  107. schema:
  108. $ref: '#/definitions/CreateUserModel'
  109. responses:
  110. '400':
  111. description: Invalid user supplied
  112. '404':
  113. description: User not found
  114. get:
  115. security:
  116. - bearerAuth: []
  117. tags:
  118. - user
  119. summary: Gets current user
  120. description: ""
  121. produces:
  122. - application/xml
  123. - application/json
  124. responses:
  125. default:
  126. description: successful operation
  127. schema:
  128. $ref: '#/definitions/User'
  129. /user/sessions:
  130. post:
  131. tags:
  132. - user
  133. summary: Logs user into the system
  134. description: Login
  135. operationId: loginUser
  136. produces:
  137. - application/xml
  138. - application/json
  139. parameters:
  140. - in: body
  141. name: body
  142. description: User object
  143. required: true
  144. schema:
  145. $ref: '#/definitions/LoginUserModel'
  146. responses:
  147. '200':
  148. description: successful operation
  149. schema:
  150. $ref: '#/definitions/SessionTokenModel'
  151. '400':
  152. description: Invalid username/password supplied
  153. components:
  154. securitySchemes:
  155. bearerAuth:
  156. type: http
  157. scheme: bearer
  158. bearerFormat: JWT
  159. definitions:
  160. Order:
  161. type: object
  162. properties:
  163. id:
  164. type: integer
  165. format: int64
  166. petId:
  167. type: integer
  168. format: int64
  169. quantity:
  170. type: integer
  171. format: int32
  172. shipDate:
  173. type: string
  174. format: date-time
  175. status:
  176. type: string
  177. description: Order Status
  178. enum:
  179. - placed
  180. - approved
  181. - delivered
  182. complete:
  183. type: boolean
  184. default: false
  185. xml:
  186. name: Order
  187. CreateMedicationModel:
  188. type: object
  189. properties:
  190. name:
  191. type: string
  192. reminder:
  193. type: string
  194. description: Reminder Status
  195. enum:
  196. - morning
  197. - noon
  198. - evening
  199. - night
  200. quantity:
  201. type: number
  202. MedicationModel:
  203. type: object
  204. properties:
  205. id:
  206. type: integer
  207. name:
  208. type: string
  209. reminder:
  210. type: string
  211. description: Reminder Status
  212. enum:
  213. - morning
  214. - noon
  215. - evening
  216. - night
  217. quantity:
  218. type: number
  219. AddressModel:
  220. type: object
  221. properties:
  222. latitude:
  223. type: number
  224. longitude:
  225. type: number
  226. name:
  227. type: string
  228. ContactModel:
  229. type: object
  230. properties:
  231. address:
  232. $ref: '#/definitions/AddressModel'
  233. phone:
  234. type: string
  235. email:
  236. type: string
  237. SessionTokenModel:
  238. type: object
  239. properties:
  240. sessionToken:
  241. type: string
  242. LoginUserModel:
  243. type: object
  244. properties:
  245. username:
  246. type: string
  247. password:
  248. type: string
  249. CreateUserModel:
  250. type: object
  251. properties:
  252. phapharmacyId:
  253. type: integer
  254. format: int64
  255. name:
  256. type: string
  257. password:
  258. type: string
  259. dateOfBirth:
  260. type: string
  261. phone:
  262. type: string
  263. email:
  264. type: string
  265. address:
  266. $ref: '#/definitions/AddressModel'
  267. insuranceCardNumber:
  268. type: integer
  269. format: int64
  270. xml:
  271. name: User
  272.  
  273. Pharmacy:
  274. type: object
  275. properties:
  276. id:
  277. type: integer
  278. format: int64
  279. name:
  280. type: string
  281. addresses:
  282. items:
  283. $ref: '#/definitions/AddressModel'
  284. contacts:
  285. items:
  286. $ref: '#/definitions/ContactModel'
  287. User:
  288. type: object
  289. properties:
  290. id:
  291. type: integer
  292. format: int64
  293. phapharmacy:
  294. $ref: '#/definitions/Pharmacy'
  295. name:
  296. type: string
  297. dateOfBirth:
  298. type: string
  299. address:
  300. $ref: '#/definitions/AddressModel'
  301. phone:
  302. type: string
  303. email:
  304. type: string
  305. insuranceCardNumber:
  306. type: integer
  307. format: int64
  308. xml:
  309. name: User
  310. UserLoginMode:
  311. type: object
  312. properties:
  313. username:
  314. type: string
  315. password:
  316. type: string
  317. Tag:
  318. type: object
  319. properties:
  320. id:
  321. type: integer
  322. format: int64
  323. name:
  324. type: string
  325. xml:
  326. name: Tag
  327. Pet:
  328. type: object
  329. required:
  330. - name
  331. - photoUrls
  332. properties:
  333. id:
  334. type: integer
  335. format: int64
  336. category:
  337. $ref: '#/definitions/Category'
  338. name:
  339. type: string
  340. example: doggie
  341. photoUrls:
  342. type: array
  343. xml:
  344. name: photoUrl
  345. wrapped: true
  346. items:
  347. type: string
  348. tags:
  349. type: array
  350. xml:
  351. name: tag
  352. wrapped: true
  353. items:
  354. $ref: '#/definitions/Tag'
  355. status:
  356. type: string
  357. description: pet status in the store
  358. enum:
  359. - available
  360. - pending
  361. - sold
  362. xml:
  363. name: Pet
  364. ApiResponse:
  365. type: object
  366. properties:
  367. code:
  368. type: integer
  369. format: int32
  370. type:
  371. type: string
  372. message:
  373. type: string
  374. externalDocs:
  375. description: Find out more about Swagger
  376. url: 'http://swagger.io'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement