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

swagger-config is loaded twice #688

Closed
lrozenblyum opened this issue May 26, 2020 · 3 comments
Closed

swagger-config is loaded twice #688

lrozenblyum opened this issue May 26, 2020 · 3 comments
Labels
duplicate This issue or pull request already exists

Comments

@lrozenblyum
Copy link

lrozenblyum commented May 26, 2020

Describe the bug
swagger-config url is loaded twice.
Thus onComplete callback is also called twice which makes it harder to customize the UI.

To Reproduce
springdoc-openapi 1.3.9

You may check the online demo:
https://springdoc-openapi-test-app1-exhausted-civet.eu-de.mybluemix.net/swagger-ui/index.html?configUrl=/v3/api-docs/swagger-config

Expected behavior

  • swagger-config should be loaded just once

Screenshots
image

@bnasslahsen
Copy link
Collaborator

@lrozenblyum,

Duplicate of #349, #545.
This is a bug on the swagger-ui, not in the springdoc-openapi:
swagger-api/swagger-ui#4825

@bnasslahsen
Copy link
Collaborator

@lrozenblyum,

Starting from v1.4.1, the following properties can be used to prevent the load of the swagger-config twice.
Please note this properties works only in the case where there is no groups (no multiple urls and no configUrl set on the swagger-ui):

  • If your REST APIs, are not using OAuth2:
springdoc.swagger-ui.display-query-params-without-oauth2=true
  • If your REST APIs, are using OAuth2:
springdoc.swagger-ui.display-query-params=true

@lrozenblyum
Copy link
Author

Thanks for sharing! @bnasslahsen
As a matter of fact we're using groups (for versioning of API)...

@bnasslahsen bnasslahsen added bug Something isn't working duplicate This issue or pull request already exists and removed bug Something isn't working labels Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants