routing-controllers-openapi icon indicating copy to clipboard operation
routing-controllers-openapi copied to clipboard

routingControllersToSpec fails to import directory when controllers contains string

Open rdfedor opened this issue 3 years ago • 0 comments

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 avatar May 22 '21 03:05 rdfedor