-
-
Notifications
You must be signed in to change notification settings - Fork 251
BE: Integrate Swagger UI for API documentation #631 #1607
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Rupa-421! 👋
Welcome, and thank you for opening your first PR in the repo!
Please wait for triaging by our maintainers.
Please take a look at our contributing guide.
|
I have updated the PR to disable Swagger UI by default. It can now be toggled via the AUTH_OPENAPI_ENABLED environment variable. I also added the documentation for this variable in the README.md |
|
@Rupa-421 have you tried running this with any kind of auth enabled? login_form should work fine, but I fear oauth might be tricky here |
|
@Haarolean ,I have tried with auth enabled for both the login form and also Github Oauth. They are working fine. |


What changes did you make? (Give an overview)
This PR integrates Swagger UI into the application using springdoc-openapi and automates the API contract delivery.
Key changes include:
Version Catalog Migration: Moved springdoc and related dependencies to libs.versions.toml for centralized management.
Build Automation: Created a new Gradle task copyOpenApiSpecForSwagger that automatically pulls the latest OpenAPI YAML from the contract-typespec module and places it in the static web resources.
Security Configuration: Updated the Security Filter Chain to permit access to Swagger UI endpoints (/swagger-ui/, /v3/api-docs/, etc.).
Application Properties: Configured springdoc to point to the local static OpenAPI spec instead of the default generated one to ensure consistency with the TypeSpec definition.
Resource Management: Linked processResources to the spec-copying task to ensure the UI is always up-to-date during development and packaging.
Fixes #631
Is there anything you'd like reviewers to focus on?
How Has This Been Tested? (put an "x" (case-sensitive!) next to an item)
Checklist (put an "x" (case-sensitive!) next to all the items, otherwise the build will fail)
Check out Contributing and Code of Conduct
A picture of a cute animal (not mandatory but encouraged)