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

Allow disabling the Swagger/GraphQL/Health/OpenAPI UIs at Runtime #13016

Merged
merged 1 commit into from
Nov 5, 2020
Merged

Allow disabling the Swagger/GraphQL/Health/OpenAPI UIs at Runtime #13016

merged 1 commit into from
Nov 5, 2020

Conversation

phillip-kruger
Copy link
Member

@phillip-kruger phillip-kruger commented Oct 29, 2020

Fix #12942

This PR adds a Runtime config option to deactivate the

  • Swagger UI (if the UI is included)
  • GraphQL UI (if the UI is included) and GraphQL Schema
  • Health UI (if the UI is included)
  • OpenAPI Schema

As a example, if you build a REST Application with Swagger UI and you do a quarkus.swagger-ui.always-include=true, meaning that the UI will be included in the jar artefact, you can still disable the ui by starting the app:

java -jar -Dquarkus.swagger-ui.enable=false target/yourapp-1.0.0-SNAPSHOT-runner.jar

Signed-off-by:Phillip Kruger [email protected]

Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

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

Added some suggestions/ideas.

Read all of them first as I'm contradicting myself.

@phillip-kruger phillip-kruger requested a review from gsmet October 29, 2020 14:43
@phillip-kruger phillip-kruger changed the title Allow deactivating the UIs in Runtime. Allow disabling the UIs in Runtime. Nov 1, 2020
@phillip-kruger
Copy link
Member Author

phillip-kruger commented Nov 1, 2020

@gastaldi @gsmet @machi1990 Thanks for the review. I made the changes as requested. The enable flag is now a runtime config.
You can totally remove swagger ui by setting alwaysInclude=false. You can always include it by setting it to true. By default it will be included in dev and test but not in prod. When included, you can disable it by setting enable=false (in runtime) Let me know.

Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

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

I added some questions and suggestions inline. Happy to discuss it on Zulip!

@phillip-kruger
Copy link
Member Author

@gsmet - I made all changes (except Optional<Boolean> alwaysInclude) as requested.

@gsmet gsmet added this to the 1.10 - master milestone Nov 3, 2020
@gsmet gsmet changed the title Allow disabling the UIs in Runtime. Allow disabling the UIs in Runtime Nov 5, 2020
@gsmet gsmet merged commit d26b9d1 into quarkusio:master Nov 5, 2020
@gsmet
Copy link
Member

gsmet commented Nov 5, 2020

@phillip-kruger thanks!

@gsmet gsmet changed the title Allow disabling the UIs in Runtime Allow disabling the Swagger/GraphQL/Health/OpenAPI UIs at Runtime Nov 5, 2020
@phillip-kruger phillip-kruger deleted the openapi-runtime-disable branch November 19, 2020 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the ability to enable/disable Swagger UI and OpenAPI at runtime
5 participants