Closed talamaska closed 8 years ago
similar problem:
error: The bootstrap function threw an error after its callback was called :: ReferenceError: Symbol is not defined
at Object.getPathControllerTag (/home/dati/Sorgenti/Node/d/node_modules/sails-swagger/dist/lib/xfmr.js:226:51)
at Object.getPathTags (/home/dati/Sorgenti/Node/d/node_modules/sails-swagger/dist/lib/xfmr.js:211:129)
at Object.getOperation (/home/dati/Sorgenti/Node/d/node_modules/sails-swagger/dist/lib/xfmr.js:200:25)
at /home/dati/Sorgenti/Node/d/node_modules/sails-swagger/dist/lib/xfmr.js:186:26
at /home/dati/Sorgenti/Node/d/node_modules/sails-swagger/node_modules/lodash/index.js:3395:24
at /home/dati/Sorgenti/Node/d/node_modules/sails-swagger/node_modules/lodash/index.js:3073:15
at baseForOwn (/home/dati/Sorgenti/Node/d/node_modules/sails-swagger/node_modules/lodash/index.js:2046:14)
at Function.mapValues (/home/dati/Sorgenti/Node/d/node_modules/sails-swagger/node_modules/lodash/index.js:3394:9)
at Object.getPathItem (/home/dati/Sorgenti/Node/d/node_modules/sails-swagger/dist/lib/xfmr.js:185:32)
at /home/dati/Sorgenti/Node/d/node_modules/sails-swagger/dist/lib/xfmr.js:142:26
at /home/dati/Sorgenti/Node/d/node_modules/sails-swagger/node_modules/lodash/index.js:3395:24
at /home/dati/Sorgenti/Node/d/node_modules/sails-swagger/node_modules/lodash/index.js:3073:15
at baseForOwn (/home/dati/Sorgenti/Node/d/node_modules/sails-swagger/node_modules/lodash/index.js:2046:14)
at Function.mapValues (/home/dati/Sorgenti/Node/d/node_modules/sails-swagger/node_modules/lodash/index.js:3394:9)
at Object.getPaths (/home/dati/Sorgenti/Node/d/node_modules/sails-swagger/dist/lib/xfmr.js:141:32)
at Object.getSwagger (/home/dati/Sorgenti/Node/d/node_modules/sails-swagger/dist/lib/xfmr.js:66:26)
at /home/dati/Sorgenti/Node/d/node_modules/sails-swagger/dist/api/hooks/swagger/index.js:77:41
at /home/dati/Sorgenti/Node/d/node_modules/sails/lib/app/private/after.js:91:14
at /home/dati/Sorgenti/Node/d/node_modules/sails/node_modules/async/lib/async.js:251:17
at done (/home/dati/Sorgenti/Node/d/node_modules/sails/node_modules/async/lib/async.js:132:19)
at /home/dati/Sorgenti/Node/d/node_modules/sails/node_modules/async/lib/async.js:32:16
at /home/dati/Sorgenti/Node/d/node_modules/sails/node_modules/async/lib/async.js:248:21 [ReferenceError: Symbol is not defined]
This happens when controller
property in route config don't match pattern here https://github.com/tjwebb/sails-swagger/blob/v0.5.1/lib/xfmr.js#L188.
Well, so we must name our controllers properly. But interesting is on https://github.com/tjwebb/sails-swagger/blob/v0.5.1/lib/xfmr.js#L193 that this pattern variable is never used.
Yes, variable pattern
is never used, but the same pattern /(.+)Controller/
is used here: https://github.com/tjwebb/sails-swagger/blob/v0.5.1/lib/xfmr.js#L193
You're right but this logic doesn't correspond to the Sails docs about custom routes http://sailsjs.org/documentation/concepts/routes/custom-routes
'GET /foo/go': 'FooController.myGoAction',
'GET /foo/go': 'Foo.myGoAction',
'GET /foo/go': {controller: "Foo", action: "myGoAction"},
'GET /foo/go': {controller: "FooController", action:"myGoAction"},
so this plugin will detect only the last route?
It seems that yes: only controllers specified by globalId
(i.e. controller: "FooController"
) in route configuration are detected properly.
Same problem, I had to add "Controller" suffix on controller property to make it working.
What I'm doing wrong?