-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
[spring]: Incorrect @AuthorizationScope #392
Comments
I have also looked at this, and assuming both @aanno2 and I are interpreting the spec correctly, the issue here is in the parser and not the templates. The parser appears to 'see' the The template is merely using the provided auths from the parsed objects. I haven't looked at the code to see how hard it would be to address this, but suspect it's not easy to address. Anyone with more experience on the parser available to investigate or even just comment on whether my assessment is accurate or not? |
Upon further investigation, the actual Swagger Parser correctly retrieves the information. It appears the Code Generator is incorrectly interpreting it, and passing it to the templates. I think the issue is in DefaultGenerator, so getting close to a PR for this. |
Same happened to me in 4.0.0-beta3 with JAXRS. Confirming fix in snapshot version. |
Description
When I generate spring (java) from this api.yml:
I've got the impression that the @AuthorizationScope generated are not appropriate.
openapi-generator version
3.0.2
Generated AccountApi.java
Suggest a fix/enhancement
As you can see, in both cases
is generated. However, I only expect this on the
/account/selfSecured
path (as it declare this scopes). On the/account/self
path this is wrong as there is an empty scope definition. Hence I expect the no @AuthorizationScope is generated for the/account/self
path.The text was updated successfully, but these errors were encountered: