Skip to content

Inversify Express controller inheritance fail if inheriting from more than 1 controller #358

@aescarcha

Description

@aescarcha

After updating to the latest version of inversify and inversify-express-utils, I can't have controller inheritance working with more than 1 base controller, like BaseController -> BaseApiController -> PostController, URLs from BaseController return 404

Expected Behavior

You should be able to extend as many base controllers as you like and keep the methods and URLs

Current Behavior

The base endpoints return 404

Steps to Reproduce (for bugs)

  1. Get a fresh copy of https://github.com/inversify/inversify-express-utils and npm install
  2. Replace controller_inheritance.test.ts with my gist https://gist.github.com/aescarcha/341db9d36ccff444b8ad1368e2c834c2
  3. npm run test should fail

Context

I like splitting my controllers and using a lot of inheritances, like having a base controller, then a query controller, and a paginateable controller all inheriting the previous one

Your Environment

I'm on macOS Catalina, node 14.5.0, using all other deps from inversify-express-utils

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions