Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix controller inheritance
Description
Controller inheritance at the moment does not work when multiple controllers inherit from the parent controller because the child controller metadata is stored on the parent controller. This means that each of the child controllers will have the endpoints from each of the other children. This PR fixes this by storing the parent controller metadata on the parent, and the child controller metadata on the child. When the controllers are added to express, the parent controller metadata is fetched from the parent and combined with the child controller metadata.
Related Issue
Fixes inversify/InversifyJS#854
Motivation and Context
This issue broke a CRUD generic controller on my project. I then found inversify/InversifyJS#854 and created a fix.
How Has This Been Tested?
The current unit test for controller inheritance has been extended to include multiple child controllers as well as the route info being printed to the console
Types of changes
Checklist: