Skip to content

routingControllersToSpec fails to import directory when controllers contains string #81

Open
@rdfedor

Description

@rdfedor

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions