Skip to content

Generate empty scopes object #893

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

Closed
bks71 opened this issue Oct 7, 2020 · 1 comment
Closed

Generate empty scopes object #893

bks71 opened this issue Oct 7, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@bks71
Copy link

bks71 commented Oct 7, 2020

Is your feature request related to a problem? Please describe.

  • A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
  • What is the actual result using OpenAPI Description (yml or json)?
    I've defined an oauth2 security scheme with no scopes. The generated OAS doc does not contain a scopes object - but according to https://swagger.io/docs/specification/authentication/oauth2/, an empty scopes object should be defined (See the "No Scopes" section on that page.) This has never been an issue before, but I am using a tool that doesn't like that.

Describe the solution you'd like

  • A clear and concise description of what you want to happen.
  • What is the expected result using OpenAPI Description (yml or json)?
    For a no-scope security scheme, define an empty scopes object, e.g.
    components: securitySchemes: oAuthNoScopes: type: oauth2 flows: implicit: authorizationUrl: https://api.example.com/oauth2/authorize scopes: {}

Describe alternatives you've considered

  • A clear and concise description of any alternative solutions or features you've considered.
    I tried to force this using an empty OAuthScope object, but that did not work.

Additional context

  • Add any other context or screenshots about the feature request here.
@bnasslahsen bnasslahsen added the bug Something isn't working label Jan 10, 2022
@dmitry-weirdo
Copy link

dmitry-weirdo commented Jan 26, 2023

Yes, we're facing the same problem when trying to generate client classes with OpenAPI Generator.

Unfortunately, io.swagger.v3.oas.models.security.SecurityScheme has no scopes overall, so we cannot define it either empty or non-empty :'(

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

3 participants