Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

routingControllersToSpec fails to import directory when controllers contains string #81

Open
rdfedor opened this issue May 22, 2021 · 0 comments

Comments

@rdfedor
Copy link

rdfedor commented May 22, 2021

In the current release of routing-controllers it allows you to define the controllers like this,

useExpressServer(app, { controllers: ['./controller/**/*.ts'] })

Their code will detect whether classes or a string is passed. If a string is passed, then the values are passed to importClassesFromDirectories where it imports all the classes in the directory.

When the same configuration is passed to routingControllersToSpec it fails to find any controllers unless I implement the importClassesFromDirectories outside of the library and pass the return values to routingControllersToSpec.

Here's a link in their code where they add this logic,
https://github.com/typestack/routing-controllers/blob/develop/src/index.ts#L161

rdfedor pushed a commit to rdfedor/routing-controllers-openapi that referenced this issue May 22, 2021
rdfedor pushed a commit to rdfedor/routing-controllers-openapi that referenced this issue May 22, 2021
…o controllers can be imported using string path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant