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

Error is generated if a securitySchemes entry in the Components Object is a reference #1166

Closed
elize-vdr opened this issue Feb 20, 2023 · 1 comment · Fixed by #1178
Closed
Assignees
Labels
type:bug A broken experience
Milestone

Comments

@elize-vdr
Copy link
Contributor

elize-vdr commented Feb 20, 2023

Description of the bug
When a securitySchemes entry is a $ref then an error is generated. According to the OpenApi V3.0.1 this is allowed.

Example
Here is the securitySchemes definition in the components object in our OpenApi spec:

components:
  securitySchemes:
    OAuth2:
      $ref: 'common-definitions_v4.yaml#/components/securitySchemes/OAuth2'
    PersonalAccessTokens:
      $ref: 'common-definitions_v4.yaml#/components/securitySchemes/PersonalAccessTokens'

The following 2 errors are generated:

$ref is not a valid property at #/components/securitySchemes/OAuth2
$ref is not a valid property at #/components/securitySchemes/PersonalAccessTokens

Expected behavior
The above securitySchemes definition with $ref should not generated the above error. According to OpenApi V3.0.1 spec this is allowed, quoting from the spec:

securitySchemes    |    Map[string, Security Scheme Object / Reference Object]     |     An object to hold reusable Security Scheme Objects.
@darrelmiller
Copy link
Member

Thank you for reporting this. I agree this is a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug A broken experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants