With the release of inversify-express-utils (5.2.2), decorators like @requestBody do not take in parameters anymore.
As per the documentation here, these decorators should accept a parameter name and behave according to the said documentation.
@requestBody(name) returns the full request body during runtime, even when the name is passed in.
During build with TypeScript, existing codebases get the following build error (if enabled):
error TS2554: Expected 0 arguments, but got 1.
This points to the location in code where @requestBody is used.
I'm not familiar with the codebase myself, but reverting back to the earlier implementation seems like a possible solution.
The file in question seems to be this.
@requestBody decorator in one of the controllers with name as a parameterinversify-express-utils version in package.json to 5.2.2This issue was caused by a patch version upgrade. In our case, it worked perfectly fine in one environment but not in the other. This caused havoc during the release. Please mention breaking changes like these in the release notes. Also, please do not release breaking changes like this in the form of a patch.
TypeScript Build Output:
error TS2554: Expected 0 arguments, but got 1.
@ashraymehta You are correct. This should not have been released as a patch and the docs were not updated. My fault. I am sorry for all the trouble
@ashraymehta @AltekkeE I have released 6.0.0. You can rollback to 5.2.1 or upgrade to 6.0.0. Sorry for any inconvenience caused.
Upgrading to 6.0.0 doesn't seem to solve the problem. requestBody implementation doesn't change from 5.2.2 to 6.0.0. Is the decision to get rid of 'name' parameter intentional/permanent?
Most helpful comment
@ashraymehta You are correct. This should not have been released as a patch and the docs were not updated. My fault. I am sorry for all the trouble