Skip to content

Conversation

@rozzilla
Copy link
Contributor

Skip routes when websocket: true

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a lot of spurious changes - I think from prettier.

@rozzilla rozzilla requested a review from mcollina May 16, 2025 12:51
rozzilla added 3 commits May 16, 2025 16:25
Signed-off-by: Roberto Bianchi <roberto.bianchi@spendesk.com>
Signed-off-by: Roberto Bianchi <roberto.bianchi@spendesk.com>
Signed-off-by: Roberto Bianchi <roberto.bianchi@spendesk.com>
@rozzilla rozzilla force-pushed the feat/swagger/skip-websocket-routes branch from c83ac4a to 670ad57 Compare May 16, 2025 14:25
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Member

@gurgunday gurgunday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Uzlopak
Copy link
Contributor

Uzlopak commented May 18, 2025

I somehow wonder, why the websocket Attribute is so special. Are you setting it manually? Or is it because a Plugin is setting it?

@rozzilla
Copy link
Contributor Author

I somehow wonder, why the websocket Attribute is so special. Are you setting it manually? Or is it because a Plugin is setting it?

@Uzlopak it comes from fastify-websocket

@rozzilla rozzilla requested a review from Uzlopak May 18, 2025 16:49
@Uzlopak
Copy link
Contributor

Uzlopak commented May 18, 2025

Can we consider implementing it differently?

Maybe creating a Symbol. Like Symbol.for("@fastify/swagger-hideRoute")?

And in fastify websocket we set the route additionally to websocket true also that Symbol to true. And then we have a generic way to hide Routes. Without implementing for every possible plugin an exception. Also with that Symbol.for we loosely "bind" the plugins.

I would prefer this tbh..

@Uzlopak
Copy link
Contributor

Uzlopak commented May 18, 2025

@mcollina

What do you think about my proposal?

@mcollina
Copy link
Member

We already have the known hide: true property as documented in the README. If you prefer that could be automatically added in https://github.com/fastify/fastify-websocket/blob/d6348f0c04a73fb27c932d842168a894ea075cca/index.js#L155.

@rozzilla
Copy link
Contributor Author

We already have the known hide: true property as documented in the README. If you prefer that could be automatically added in https://github.com/fastify/fastify-websocket/blob/d6348f0c04a73fb27c932d842168a894ea075cca/index.js#L155.

@mcollina @Uzlopak here is the PR

@rozzilla
Copy link
Contributor Author

Since this has been merged, should I close the current PR? cc @mcollina @Uzlopak

@mcollina mcollina closed this May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants