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

Codegen operation scopes inconsistency #1610

Closed
dmolnarqu opened this issue Dec 4, 2018 · 1 comment · Fixed by #3495
Closed

Codegen operation scopes inconsistency #1610

dmolnarqu opened this issue Dec 4, 2018 · 1 comment · Fixed by #3495
Assignees

Comments

@dmolnarqu
Copy link

Description

Operation auth method scopes in template currently hold all defined scopes for specific security definition.
Swagger 2.* populates the list only with scopes defined for that particular operation.

Example:
If operation1 requires scope:op1, but there's also scope:op2 defined globally, then

-- operation1 context
...{{#authMethods}}{{#scopes}}{{scope}}, {{/scopes}}{{/authMethods}}..

swagger codegen produces

scope:op1, 

openapi generator produces

scope:op1, scope:op2, 

This issue was mentioned before in #1043.

Is this change intended? It's neven been questioned in that issue.
I could find that ada server generator fixes it at higher level (#1044), but shouldn't it be responsibility of base codegen?
Is there a more direct way for a template to access scopes required only by operation itself?

openapi-generator version

3.3.4

@stcarrez
Copy link
Contributor

stcarrez commented Dec 9, 2018

Yes, I agree with you that fixing this in the base codegen would be better, but I guess it has an impact on all code generators if you do it.

What I did for the Ada server code generator was a simple work around to give access to specific variables that give the template the required information.

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

Successfully merging a pull request may close this issue.

3 participants