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
The pipe I'm adding to my payload is not being executed:
protectedasynconBridgeRequest(
@RabbitPayload(ParsePayloadPipe)payload: Payload){console.log({ payload })// payload is just the raw, un-transformed data}
Pipes only execute if added with @UsePipes() at the handler, but then it applies the pipe to all deocrated arguments. I also use @RabbitHeader() to get a header value, and the pipe attempts to run on it as well (which I guess is expected):
So now I just add the pipe to the handler, and check in transform if the argument.metatype matches Payload then I execute the pipe logic, otherwise, I just send the data through as-is. It's very hacky, but the only way I can get this working as desired.
Not sure why the pipe(s) passed through that decorator don't work, as it's part of the NestJS contract with parameter decorators (first data, then pipe(s)).
The text was updated successfully, but these errors were encountered:
Hi,
The pipe I'm adding to my payload is not being executed:
Pipes only execute if added with
@UsePipes()
at the handler, but then it applies the pipe to all deocrated arguments. I also use@RabbitHeader()
to get a header value, and the pipe attempts to run on it as well (which I guess is expected):So now I just add the pipe to the handler, and check in
transform
if theargument.metatype
matchesPayload
then I execute the pipe logic, otherwise, I just send the data through as-is. It's very hacky, but the only way I can get this working as desired.Not sure why the pipe(s) passed through that decorator don't work, as it's part of the NestJS contract with parameter decorators (first data, then pipe(s)).
The text was updated successfully, but these errors were encountered: