Guest User

Untitled

a guest
Jan 21st, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.32 KB | None | 0 0
  1. outfittr | 2019-01-21T13:51:37.150Z info: Valid specification file
  2. outfittr | 2019-01-21T13:51:37.162Z info: Specification file dereferenced
  3. outfittr | 2019-01-21T13:51:37.210Z info: No localhost or relative server found in spec file, added for testing in Swagger UI
  4. outfittr | 2019-01-21T13:51:37.210Z debug: Register: GET - /garments
  5. outfittr | 2019-01-21T13:51:37.211Z debug: GET - /garments
  6. outfittr | 2019-01-21T13:51:37.212Z debug: Spec-file does not have router property -> try generic controller name: garmentsController
  7. outfittr | 2019-01-21T13:51:37.212Z debug: Controller with generic controller name wasn't found either -> try Default one
  8. outfittr | 2019-01-21T13:51:37.212Z error: There is no controller for GET - /garments
  9. outfittr exited with code 0
  10.  
  11. openapi: 3.0.2
  12. info:
  13. version: "1.0.0"
  14. title: Outfittr API
  15.  
  16. paths:
  17.  
  18. /swagger:
  19. x-swagger-pipe: swagger_raw
  20.  
  21. ####################################### Garments ##############################################
  22.  
  23. /garments:
  24. x-router-controller: garmentsController
  25. get:
  26. description: Returns an array of garments.
  27. operationId: indexGarments
  28. responses:
  29. "200":
  30. $ref: '#/components/schemas/Garment'
  31. default:
  32. $ref: "#/components/schemas/ErrorResponse"
  33. post:
  34. summary: Creates a new garment
  35. operationId: newGarment
  36. description: Adds garment to the system
  37. responses:
  38. '200':
  39. $ref: '#/components/schemas/Garment'
  40. default:
  41. $ref: "#/components/schemas/ErrorResponse"
  42. requestBody:
  43. content:
  44. application/json:
  45. schema:
  46. $ref: '#/components/schemas/Garment'
  47. description: User that was created.
  48.  
  49. /garments/{_id}:
  50. x-router-controller: garmentsController
  51. get:
  52. description: Returns one garment
  53. operationId: viewGarment
  54. parameters:
  55. - in: path
  56. name: _id
  57. schema:
  58. type: string
  59. required: true
  60. description: Numeric ID of the user to get
  61. responses:
  62. "200":
  63. $ref: '#/components/schemas/Garment'
  64. default:
  65. $ref: "#/components/schemas/ErrorResponse"
  66.  
  67.  
  68. ######################################## Users ################################################
  69.  
  70. /users:
  71. x-router-controller: usersController
  72. get:
  73. description: Returns an array of users.
  74. operationId: indexUsers
  75. responses:
  76. "200":
  77. $ref: '#/components/schemas/User'
  78. default:
  79. $ref: "#/components/schemas/ErrorResponse"
  80. post:
  81. summary: Creates a new user
  82. operationId: newUser
  83. description: Adds user to the system
  84. responses:
  85. '200':
  86. $ref: '#/components/schemas/User'
  87. default:
  88. $ref: "#/components/schemas/ErrorResponse"
  89. requestBody:
  90. content:
  91. application/json:
  92. schema:
  93. $ref: '#/components/schemas/User'
  94. description: User that was created.
  95.  
  96. /users/{_id}:
  97. x-router-controller: usersController
  98. get:
  99. description: Returns one user
  100. operationId: viewUser
  101. parameters:
  102. - in: path
  103. name: _id
  104. schema:
  105. type: string
  106. required: true
  107. description: Numeric ID of the user to get
  108. responses:
  109. "200":
  110. $ref: '#/components/schemas/User'
  111. default:
  112. $ref: "#/components/schemas/ErrorResponse"
  113.  
  114. ####################################### Wardrobe ##############################################
  115.  
  116. /wardrobe:
  117. x-router-controller: wardrobeController
  118. get:
  119. description: Returns an array of garments in the user's wardrobe.
  120. operationId: indexWardrobeItems
  121. responses:
  122. "200":
  123. $ref: '#/components/schemas/WardrobeItem'
  124. default:
  125. $ref: "#/components/schemas/ErrorResponse"
  126. post:
  127. summary: Creates a new wardrobe item
  128. operationId: newWardrobeItem
  129. description: Adds garment to the user's wardrobe in the system
  130. responses:
  131. '200':
  132. $ref: '#/components/schemas/WardrobeItem'
  133. default:
  134. $ref: "#/components/schemas/ErrorResponse"
  135. requestBody:
  136. content:
  137. application/json:
  138. schema:
  139. $ref: '#/components/schemas/WardrobeItem'
  140. description: User that was created.
  141.  
  142. /wardrobeItem/{_id}:
  143. x-router-controller: wardrobeController
  144. get:
  145. description: Returns one wardrobe item
  146. operationId: viewWardrobeItem
  147. parameters:
  148. - in: path
  149. name: _id
  150. schema:
  151. type: string
  152. required: true
  153. description: Numeric ID of the user to get
  154. responses:
  155. "200":
  156. $ref: '#/components/schemas/WardrobeItem'
  157. default:
  158. $ref: "#/components/schemas/ErrorResponse"
  159.  
  160. ###################################### Components #############################################
  161.  
  162. servers:
  163. - url: outfittr.net
  164. - url: localhost:3000
  165. components:
  166. schemas:
  167. User:
  168. type: object
  169. required:
  170. - _id
  171. - email
  172. - username
  173. - password
  174. properties:
  175. _id:
  176. type: string
  177. description: unique ID given by Mongo.
  178. firstName:
  179. type: string
  180. description: First name of the user.
  181. lastName:
  182. type: string
  183. description: Last name of the user.
  184. email:
  185. type: string
  186. description: User's email address.
  187. username:
  188. type: string
  189. description: User's username (for login)
  190. password:
  191. type: string
  192. description: User's password (for login).
  193. create_date:
  194. type: string
  195. description: date that the user joined.
  196. __v:
  197. type: integer
  198. description: I have no idea.
  199.  
  200. Garment:
  201. type: object
  202. required:
  203. - _id
  204. - type
  205. - imageLink
  206. properties:
  207. _id:
  208. type: string
  209. description: unique ID given by Mongo.
  210. type:
  211. type: string
  212. description: type of garment
  213. imageLink:
  214. type: string
  215. description: primary color of garment
  216. __v:
  217. type: integer
  218. description: I have no idea.
  219.  
  220. WardrobeItem:
  221. type: object
  222. required:
  223. - _id
  224. - owner_id
  225. - garment_id
  226. properties:
  227. _id:
  228. type: string
  229. description: unique ID given by Mongo.
  230. unavailable:
  231. type: boolean
  232. description: Is the wardrobe item dirty, loaned out, or otherwise unavailable?
  233. owner_id:
  234. type: string
  235. description: foreign key linking this wardrobe item to its owner.
  236. garment_id:
  237. type: string
  238. description: foreign key linking this wadrobe item to the garment it is.
  239. torn:
  240. type: boolean
  241. description: Is the wardrobe item torn?
  242. reserveDate:
  243. type: string
  244. description: Optional - a date for which this wardrobe item must be worn
  245. reserveTilDate:
  246. type: string
  247. description: Optional - a date after which the wardrobe item cannot be worn until the reserveDate.
  248. __v:
  249. type: integer
  250. description: I have no idea.
  251.  
  252. ErrorResponse:
  253. required:
  254. - message
  255. properties:
  256. message:
  257. type: string
Add Comment
Please, Sign In to add comment