inversify-express-example icon indicating copy to clipboard operation
inversify-express-example copied to clipboard

inversify-express-utils: BaseHttpController's method generic return types

Open tgiardina opened this issue 5 years ago • 0 comments

This is a feature request for inversify-express-utils. I would like this.created and related methods to return an object that takes a generic.

Expected Behavior

I expect this.created to return an interface with a generic (e.g., IHttpResponse<T>).

Current Behavior

this.created returns OkNegotiatedContentResult, which does not take a generic.

Context

I have a controller that extend BaseHttpController and have written a post method. In this method I return the result of this.created(...). I was hoping the return type would include a generic (e.g., IHttpResponse<T>) so that I could use type checking to validate whatever argument I passed to this.created.

tgiardina avatar Aug 06 '20 17:08 tgiardina