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

securitySchemes is being cleared #10

Closed
pisaychuk opened this issue Nov 8, 2022 · 2 comments · Fixed by #14
Closed

securitySchemes is being cleared #10

pisaychuk opened this issue Nov 8, 2022 · 2 comments · Fixed by #14
Labels
bug Something isn't working

Comments

@pisaychuk
Copy link

pisaychuk commented Nov 8, 2022

Hey @dolmen, I noticed an issue with my doc after running preprocessing. I have the following config in yml:

security:
  - httpBasic: []
....
components:
  securitySchemes:
    httpBasic:
      type: http
      scheme: basic

Once I run the preprocessing, the resulting json is


"components" : {
   ....
    "securitySchemes" : { }
}

"security" : [ {
    "httpBasic" : [ ]
  } ],

As you see securitySchemes is being cleared.

@macr1408
Copy link

I'm having the same issue, just opened a PR for this.

@dolmen dolmen added the bug Something isn't working label Dec 4, 2024
@dolmen
Copy link
Member

dolmen commented Dec 8, 2024

In fact /components/securitySchemes are not referenced via $ref. So we need a different algorithm to detect references.

Related issues about OpenAPI design:

dolmen added a commit that referenced this issue Dec 8, 2024
Fix lookup of references to securitySchemes before cleaning it.

/components/securitySchemes are not referenced by $ref like other components.
We now implement the correct algorithm to lookup for references before cleaning:
- look for references in Security Requirements in /security
- look for references in Security Requirements in /paths/<path>/<method>/security
dolmen added a commit that referenced this issue Dec 8, 2024
Fix lookup of references to securitySchemes before cleaning it.

/components/securitySchemes are not referenced by $ref like other components.
We now implement the correct algorithm to lookup for references before cleaning:
- look for references in Security Requirements in /security
- look for references in Security Requirements in /paths/<path>/<method>/security
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

Successfully merging a pull request may close this issue.

3 participants