openapi-preprocessor icon indicating copy to clipboard operation
openapi-preprocessor copied to clipboard

securitySchemes is being cleared

Open pisaychuk opened this issue 2 years ago • 1 comments

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.

pisaychuk avatar Nov 08 '22 15:11 pisaychuk

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

macr1408 avatar Oct 17 '23 14:10 macr1408

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

Related issues about OpenAPI design:

  • OAI/OpenAPI-Specification#3776
  • OAI/OpenAPI-Specification#1972

dolmen avatar Dec 08 '24 22:12 dolmen