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

Wrong type for springdoc.swagger-ui.oauth.useBasicAuthenticationWithAccessCodeGrant configuration property #1911

Closed
hkinder opened this issue Oct 24, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@hkinder
Copy link

hkinder commented Oct 24, 2022

Today "springdoc.swagger-ui.oauth.useBasicAuthenticationWithAccessCodeGrant" is a String in the Properties for Springdoc.
According to the documentation of swagger-ui this entry should be a Boolean :
https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/oauth2.md (look for useBasicAuthenticationWithAccessCodeGrant entry)

This result to a bug as soon as the value "false" is set for example to that property in springdoc.
It will result to a string in swagger-ui configuration :
ui.initOAuth({"useBasicAuthenticationWithAccessCodeGrant":"false"})
And then swagger-ui will consider the value as true in their javascript code :
https://github.com/swagger-api/swagger-ui/blob/8f63462f9eb634b9319a8be7cfe7090fbe8e304c/src/core/oauth2-authorize.js#L119

If changing the type to Boolean, then the code will be fine in swagger-ui configuration :
ui.initOAuth({"useBasicAuthenticationWithAccessCodeGrant":false})
Resulting in the right interpretation by swagger-ui.

@bnasslahsen
Copy link
Contributor

@hkinder,

Are you willing to propose a PR for it?

bnasslahsen added a commit that referenced this issue Nov 14, 2022
@bnasslahsen bnasslahsen added the bug Something isn't working label Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants