You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ ] Regression
[x] Bug report
[] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
Custom Decorators not being treated in the same fashion as built in ones
Expected behavior
Custom Decorators be treated in the same fashion as built in ones https://docs.nestjs.com/custom-decorators Nest treats a custom param decorators in the same fashion as the built-in ones (@Body(), @Param() and @Query()). It means that pipes are executed for the custom annotated parameters as well (in this case, for the user argument). Moreover, you can apply the pipe directly to the custom decorator:
makes it sound like they are treaded the same but arent
Minimal reproduction of the problem with instructions
Create a custom Decorator, Create a Pipe, try to get the Pipe to be instantiated and dependency injected.
export declare function Param(): any;
export declare function Param(...pipes: (Type<PipeTransform> | PipeTransform)[]): any;
export declare function Param(property: string, ...pipes: (Type<PipeTransform> | PipeTransform)[]): any;
Environment
[System Information]
OS Version : macOS Sierra
NodeJS Version : v9.11.1
NPM Version : 6.1.0
[Nest Information]
microservices version : 5.0.0
websockets version : 5.0.0
swagger version : 2.0.0
testing version : 5.0.0
common version : 5.0.0
core version : 5.0.0
The text was updated successfully, but these errors were encountered:
I'm submitting a...
Current behavior
Custom Decorators not being treated in the same fashion as built in ones
Expected behavior
Custom Decorators be treated in the same fashion as built in ones
https://docs.nestjs.com/custom-decorators
Nest treats a custom param decorators in the same fashion as the built-in ones (@Body(), @Param() and @Query()). It means that pipes are executed for the custom annotated parameters as well (in this case, for the user argument). Moreover, you can apply the pipe directly to the custom decorator:
makes it sound like they are treaded the same but arent
Minimal reproduction of the problem with instructions
Create a custom Decorator, Create a Pipe, try to get the Pipe to be instantiated and dependency injected.
it wont run the pipe
or
it throws compilation errors
What is the motivation / use case for changing the behavior?
It is a reasonable expectation for that to work, but when you dig into the signatures you can see that it wont do the dependency injection for you
Environment
The text was updated successfully, but these errors were encountered: