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
I was about to pull the trigger to replace my entire validation with Nestia/Typia but didn't because I saw there was no gateway @MessageBody decorator replacement.
Would it be possible to add one ?
The text was updated successfully, but these errors were encountered:
I'm referring to this: NestJS Gateway
In brief, WebSockets in Nest.js utilize Gateways, marked with @WebSocketGateway(), to facilitate real-time communication. Gateways manage incoming messages using decorators such as @SubscribeMessage(). The @MessageBody() decorator extracts data from incoming messages. These gateways can respond in sync or asynchronously, while lifecycle hooks oversee initialization, connections, and disconnections.
Considering that Nestia Core provides access to essential decorators for safeguarding and validating data within controller routes, could it also potentially introduce a new decorator dedicated to NestJS Gateways? Specifically, a decorator that replaces the existing @MessageBody()? @MessageBody
The logic might resemble the TypedBody decorator, but adjusted to throw a WSException instead of the standard HTTP bad request error. Moreover, it would require utilizing something like context.switchToWs().getData() to retrieve and validate the client's message.
A decorator for NestJS Gateways
I was about to pull the trigger to replace my entire validation with Nestia/Typia but didn't because I saw there was no gateway @MessageBody decorator replacement.
Would it be possible to add one ?
The text was updated successfully, but these errors were encountered: