-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validation fails in RPC context for MqttContext #13350
Comments
cc @tolgap 👀 |
Same issue for RPC. |
The type coercion here is the culprit nest/packages/core/pipes/pipes-consumer.ts Lines 13 to 15 in df37ea1
|
Wasn't aware that the position was this important for this. @kamilmysliwiec do we revert in the meantime then come back to this? |
@tolgap it shouldn't matter, but it was abused :-( I suggest a diffrent thing: export enum RpcParamtype {
PAYLOAD = RouteParamtypes.BODY,
CONTEXT = RouteParamtypes.HEADERS,
GRPC_CALL = RouteParamtypes.FILES,
} Working on a PR now. |
Did you read the migration guide?
Is there an existing issue that is already proposing this?
Potential Commit/PR that introduced the regression
#13225
NestJS version
10.3.3 -> 10.3.4
Describe the regression
I use ValidationPipe as a global pipe, even in MQTT microservices.
After the update the MqttContext cannot be successfully validated, so any controller using the
@Ctx() context: MqttContext
way of accessing the message's topic fails.I have digged a lot in the release changes, and found that the issue is adding the
RouteParamTypes.RAW_BODY
in between other types. This causes the key "6" to be exchanged for aRouteParamTypes.PARAM
, which applies thetype: 'param'
to the metadata, instead oftype: 'custom'
.Minimum reproduction code
No response
Input code
Expected behavior
The MqttContext passes validation without issues.
Other
No response
The text was updated successfully, but these errors were encountered: