-
-
Notifications
You must be signed in to change notification settings - Fork 942
fix(symfony): disable Swagger UI and keep openapi.json #7549
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
Open
+245
−6
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Maxcastel
Maxcastel
force-pushed
the
fix/disable-swagger-ui
branch
from
November 20, 2025 15:37
ff9332d to
d4e182e
Compare
Member
soyuka
commented
Nov 21, 2025
would you be able to add a functional test as well?
@Maxcastel
Maxcastel
force-pushed
the
fix/disable-swagger-ui
branch
from
November 21, 2025 09:34
aa681c2 to
bbfa764
Compare
@Maxcastel
Maxcastel
changed the title
(削除) fix(swagger): disable Swagger UI and keep openapi.json (削除ここまで)
(追記) fix(symfony): disable Swagger UI and keep openapi.json (追記ここまで)
Nov 23, 2025
@Maxcastel
Maxcastel
force-pushed
the
fix/disable-swagger-ui
branch
2 times, most recently
from
November 24, 2025 12:53
0b808c1 to
cf6078d
Compare
@Maxcastel
Maxcastel
force-pushed
the
fix/disable-swagger-ui
branch
from
November 24, 2025 13:39
cf6078d to
620ddc3
Compare
Author
Maxcastel
commented
Nov 24, 2025
done @soyuka
I will squash commits.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
Descripton
This PR fixes an issue where
enable_swagger_ui: falsedid not actually disable the Swagger UI HTML interface.Currently, when configuring
enable_swagger: trueandenable_swagger_ui: false, accessing the documentation route (/api/docs), still displays the Swagger UI HTML interface, ignoring the configuration (enable_swagger_ui: false) to disable it.The goal is to fully disable the Swagger UI HTML interface while keeping the JSON documentation (
/api/docs.jsonopenapi) accessible.Changes
ApiPlatformExtensionto load Swagger UI services (definitions, listeners, providers) only ifenable_swagger_uiistrue.src/Symfony/Action/DocumentationAction.phpto throw aNotFoundHttpExceptionwhen Swagger UI is disabled.src/Laravel/Controller/DocumentationController::getOpenApiDocumentation():src/Symfony/Action/DocumentationAction::getOpenApiDocumentation():src/Symfony/Action/DocumentationAction.phpto checkenable_swagger_ui, aligning the logic withsrc/Laravel/Controller/DocumentationController.php:Before
/api/docs→ still HTML Swagger UI accessible (not expected)/api/docs.jsonopenapi→ accessible (expected)After
/api/docs→ returns 404/api/docs.jsonopenapi→ still accessible (expected)