Skip to content
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

Hide bull routes from schema/openAPI generation #762

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

bcomnes
Copy link
Contributor

@bcomnes bcomnes commented Jun 5, 2024

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.

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
Copy link
Owner

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

@bcomnes
Copy link
Contributor Author

bcomnes commented Jun 5, 2024

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.

@felixmosh felixmosh merged commit 3568146 into felixmosh:master Jun 5, 2024
@bcomnes bcomnes deleted the patch-1 branch June 5, 2024 16:09
@bcomnes
Copy link
Contributor Author

bcomnes commented Jun 5, 2024

Thanks for the quick turnaround! Enjoying bullboard so far.

@felixmosh
Copy link
Owner

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?

felixmosh added a commit that referenced this pull request Jun 5, 2024
@bcomnes
Copy link
Contributor Author

bcomnes commented Jun 5, 2024

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
Copy link
Owner

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

Thanx

bcomnes added a commit to bcomnes/bull-board that referenced this pull request Jun 5, 2024
Reattempting felixmosh#762 with the typescript error ignored for this special case.
@bcomnes
Copy link
Contributor Author

bcomnes commented Jun 5, 2024

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

Sorry about that.

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.

2 participants