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

OAuth security scheme: empty scopes element is still rendered #1968

Closed
meden opened this issue Apr 25, 2022 · 0 comments · Fixed by #1975
Closed

OAuth security scheme: empty scopes element is still rendered #1968

meden opened this issue Apr 25, 2022 · 0 comments · Fixed by #1975
Assignees
Milestone

Comments

@meden
Copy link

meden commented Apr 25, 2022

Describe the bug
When defining an oauth2 security scheme, if no scopes are used the scopes element still gets rendered (as empty) in the resulting page.

Expected behavior
scopes information should be hidden (just like refreshUrl).

Minimal reproducible OpenAPI snippet(if possible)

openapi: 3.0.3
info:
  title: OAuth2 API
  version: '1.0'
  description: This is an API.

paths:
  '/res':
    get:
      operationId: get
      description: Returns something.
      responses:
        '200':
          description: Some resource.
          content:
            application/json: { }

components:
  securitySchemes:
    OAuth2:
      type: oauth2
      description: You know it.
      flows:
        clientCredentials:
          tokenUrl: /auth
          scopes: { }

security:
  - OAuth2: [ ]

Screenshots
image

Additional context
A similar issue (#1044) was already solved, but allowing a definition against OpenAPI specifications.

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

Successfully merging a pull request may close this issue.

2 participants