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

Fix duplicate variable name with multiple oauth2 security schemes #1304

Merged
merged 2 commits into from
Sep 5, 2024

Conversation

johnrutherford
Copy link
Contributor

If you have an OpenAPI spec that defines more than one oauth2 security scheme, the will each generate an oauth2Scopes variable in oas_security_gen.go, and the duplicate variable names will not compile.

This fixes the issue by appending the unique name of the security scheme to the variable name so there will not be a conflict.

Copy link

codecov bot commented Sep 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.92%. Comparing base (12fe015) to head (b603d86).
Report is 24 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1304   +/-   ##
=======================================
  Coverage   73.92%   73.92%           
=======================================
  Files         189      189           
  Lines       12855    12855           
=======================================
  Hits         9503     9503           
  Misses       2804     2804           
  Partials      548      548           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@tdakkota tdakkota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Could you rebase, please? I've disabled false-positive linter check.

@johnrutherford johnrutherford force-pushed the multiple-oauth2-schemes branch from 7456a9a to b603d86 Compare September 5, 2024 13:49
@tdakkota tdakkota merged commit 8e1b908 into ogen-go:main Sep 5, 2024
14 checks passed
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 this pull request may close these issues.

2 participants