felixmosh / bull-board

🎯 Queue background jobs inspector
MIT License
2.14k stars 343 forks source link

Hide bull routes from schema/openAPI generation #762

Closed bcomnes closed 1 month ago

bcomnes commented 1 month ago

This hides the bullboard routes from openAPI schema generation. These routes don't have a schema defined, so they aren't useful in that context.

felixmosh commented 1 month ago

Hi @bcomnes do you think that it is a good idea to add schema or just hide them?

bcomnes commented 1 month ago

I think it's better to just hide them. It seems unlikely any fastify server exposing a published openAPI spec based on its schema would also want to include unreleated bull-board routes in that spec. It seems much more likely of a scenario that someone has created an API with fastify, and wants to add bullboard as a backend management tool and not expose that detail to their public API docs via openAPI.

If there does happen to be someone out there who does want it exposed, perhaps we could leave that option/schema as an open contribution task for them. Either way, it should default to being hidden.

bcomnes commented 1 month ago

Thanks for the quick turnaround! Enjoying bullboard so far.

felixmosh commented 1 month ago

Hi, this PR breaks the build, looks like fastify schema doesn't have this hide: boolean prop.

image

I will revert this PR, in order to allow publishing other PR's. Can you check this?

bcomnes commented 1 month ago

Its supplemented in when you add the first party openapi plugin. Otherwise its ignored.

https://github.com/fastify/fastify-swagger/blob/e01cd7ba3f0972cf3ba75f87bd3f35b2d5c1683a/index.d.ts#L34-L48

You could safely ts-ignore this, or perhaps accept a schema option in registerPlugin(). That would match the supplemented FastifySchema during development for users. Preferences?

felixmosh commented 1 month ago

Just ignore it, if someone will need the abillity to pass a schema, he/she will make a PR for it :]

Thanx

bcomnes commented 1 month ago

Retrying here: https://github.com/felixmosh/bull-board/pull/764/files

Sorry about that.