-
-
Notifications
You must be signed in to change notification settings - Fork 950
fix #804 - add a parameter to disable swagger ui when not needed #841
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
fix #804 - add a parameter to disable swagger ui when not needed #841
Conversation
92caa74 to
4435235
Compare
|
+1 this can be needed in correlation with #768 |
|
I suggest to not register |
134f1fc to
c75cc10
Compare
|
@dunglas I've made the change |
c75cc10 to
6c42e66
Compare
|
|
||
| if ($config['enable_swagger_ui']) { | ||
| $loader->load('swagger-ui.xml'); | ||
| $container->setParameter('api_platform.enable_swagger_ui', $config['enable_swagger_ui']); |
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.
And if $config['enable_swagger_ui'] is false?
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.
It does not load swagger-ui, I don't understand what you mean
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.
OH: We don't net to set it for the container if it's false anyway. Like we have done with enable_swagger.
|
Thank you @Simperfit |
|
Does this address the use case of having Swagger UI at |
|
@teohhanhui yes as long as you register yourself the Swagger UI controller: #804 (comment) |
|
That's not very nice for DX 😞 |
|
@teohhanhui I think it's okay, not alot of people use the html encoders and if they do we will have to add a doc part about this. What would be better ? |
|
Not many people use a HTML encoder, yes. But many people like myself would not want the hijacking (mostly just a marketing feature to me). It'd be much better if the hijacking can be disabled by configuration. I propose something like the following: swagger_ui:
# enabled: true
intercept_operations: true |
|
I made a swagger configuration node in #768 : swagger:
enabled: true
ui_enabled: true
ui_path: '%kernel.root_dir%/../web/swagger-ui'I'd propose: swagger:
enabled: true
ui:
enabled: true
path: '%kernel.root_dir%/../web/swagger-ui'
intercept_operations: true |
…ility-to-disable-swagger-ui fix api-platform#804 - add a parameter to disable swagger ui when not needed
This PR add a parameter to disable swagger ui