Skip to content
This repository has been archived by the owner on Jul 30, 2022. It is now read-only.

swagger-sails with multiple controller directories #6

Open
ukoester opened this issue Aug 23, 2016 · 1 comment
Open

swagger-sails with multiple controller directories #6

ukoester opened this issue Aug 23, 2016 · 1 comment

Comments

@ukoester
Copy link

Hi,
i have done the following steps with sails v0.12:

  1. Create new sails project: sails create testProject
  2. Install module swagger-sails-hook: npm install --save swagger-sails-hook
  3. Create a directory called api/mocks in your app
  4. Create a directory called api/swagger in your app
  5. Copy your swagger.yaml file to the api/swagger directory
  6. install (for example) module sails-hook-jwt-auth: npm install --save sails-hook-jwt-auth
  7. Start sails. sails lift

When sails try to start i get the following error:

error: TypeError: Path must be a string. Received [ '/projects/research/sails/testProject/api/controllers',
  '/projects/research/sails/testProject/node_modules/sails-hook-jwt-auth/api/controllers' ]
    at assertPath (path.js:8:11)
    at Object.posix.resolve (path.js:426:5)
    at Hook.initialize (/projects/research/sails/testProject/node_modules/swagger-sails-hook/lib/index.js:22:36)
    at Hook.wrapper [as initialize](/usr/lib/node_modules/sails/node_modules/lodash/index.js:3095:19)
    at /usr/lib/node_modules/sails/lib/hooks/index.js:88:16
    at /usr/lib/node_modules/sails/node_modules/async/lib/async.js:52:16
    at /usr/lib/node_modules/sails/node_modules/async/lib/async.js:548:17
    at /usr/lib/node_modules/sails/node_modules/async/lib/async.js:542:17
    at _arrayEach (/usr/lib/node_modules/sails/node_modules/async/lib/async.js:85:13)
    at Immediate.taskComplete (/usr/lib/node_modules/sails/node_modules/async/lib/async.js:541:13)
    at processImmediate [as _immediateCallback](timers.js:383:17)

```

At this time sails delivers an array of string in the variable 'sails.config.paths.controllers'
```
@praveen4554
Copy link

Hi,

I had a same situation did you find any solution for that it will helps me a lot

Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants