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

JavaJAXRSSpecServerCodegen never add security scopes to @Operation annotations #776

Open
RaphC opened this issue Oct 13, 2020 · 1 comment

Comments

@RaphC
Copy link

RaphC commented Oct 13, 2020

Hi,

the generator JavaJAXRSSpecServerCodegen uses a template apiInterface.mustache when interfaceOnly is set to true. Unluckily, if I set oauth2 security scheme and security tag I obtain a beautiful Java interface annotated with @operation but no scope refered because processed as a list whereas it is a Map.

@Operation(summary = "blabla.....", description = "", security = { @SecurityRequirement(name = "my_auth", scopes = { "", }) }, tags={ "atag" })

I can fix this by override apiInterface.mustache and replace

scopes = { {{#scopes}}"{{scope}}"{{#hasMore}}, {{/hasMore}}{{/scopes}} ....

by

scopes = { {{#each scopes}}"{{@key}}"{{^@last}},{{/@last}}{{/each}}

How can I provide A Pull Request ?

@cazacugmihai
Copy link

Hi,

Is there any progress on this?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants