[Bug] WebSocketRoute method cannot be called connection
Bug Report
I spent a lot of time on this strange bug :)))
WebSocketRoute method cannot be called connection. if you change the name to any other the error disappears
@WebSocketRoute('events/connect') public async connection(
SDK genratad
export async function connection(
connection: IConnection<connection.Header>,
provider: connection.Provider,
): Promise<connection.Output> {
const connector: WebSocketConnector<
connection.Header,
connection.Provider,
connection.Listener
> = new WebSocketConnector(connection.headers ?? ({} as any), provider);
await connector.connect(
`${connection.host.endsWith("/") ? connection.host.substring(0, connection.host.length - 1) : connection.host}${connection.path()}`,
);
error
../../nestia-api/functional/calculate/events/connect/index.ts:28:128 - error TS2339: Property 'path' does not exist on type 'IConnection
28 ${connection.host.endsWith("/") ? connection.host.substring(0, connection.host.length - 1) : connection.host}${connection.path()},
~~~~
Found 1 error in ../../nestia-api/functional/calculate/events/connect/index.ts:28
This is due to connection: IConnection parameter.
If there's a function named connection, I'll rename the connection parameter to be _connection