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

bug: security scheme name starting with X- not being added to SecuritySchemes map #54

Closed
TristanSpeakEasy opened this issue Dec 20, 2022 · 3 comments
Assignees

Comments

@TristanSpeakEasy
Copy link
Contributor

If a OpenAPI document defines a security scheme name starting with X- it is not showing up in model.Components.SecuritySchemes

for example:

securitySchemes:
    OAuth:
      flows:
        authorizationCode:
          authorizationUrl: "https://example.com/v1/oauth/authorize"
          refreshUrl: "https://example.com/v1/oauth/token"
          scopes:
            account.manage: This scope grants permissions to perform read/edit/delete actions on Account data
            account.view: This scope grants permissions to perform read only actions on Account data
            openid: This scope grants permissions that enable SSO by granting an id token JWT that stores account data. Not used in v1/account endpoints
          tokenUrl: "https://example.com/v1/oauth/token"
      type: oauth2
    X-API-Key:
      in: header
      name: X-API-Key
      type: apiKey

X-API-Key can't be found

@daveshanley
Copy link
Member

Another extension glitch I think, Will address ASAP.

@daveshanley daveshanley self-assigned this Dec 20, 2022
daveshanley added a commit that referenced this issue Dec 20, 2022
Security schemes with a `X-` prefix were being seen mistakenly as extensions, because the key name was automatically set to lowercase, before a check.
daveshanley added a commit that referenced this issue Dec 20, 2022
Security schemes with a `X-` prefix were being seen mistakenly as extensions, because the key name was automatically set to lowercase, before a check.
@daveshanley
Copy link
Member

Resolved in v0.4.8

@rpmccarter
Copy link

rpmccarter commented Oct 25, 2023

Hello! Seems like this is fixed for X-, but is still broken for x-. I've opened #188, which adds test cases for both cases, and I'm hoping someone can help me fix the underlying bug. Thanks!

I realize this is a slightly different bug than the one listed in this issue. Happy to make a new issue rather than reopening this one if that's helpful

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

No branches or pull requests

3 participants