swagger-editor icon indicating copy to clipboard operation
swagger-editor copied to clipboard

Swagger Editor incorrectly makes auth schemes OR instead of AND

Open johnament opened this issue 3 years ago • 0 comments

Q&A (please complete the following information)

  • OS: macOS
  • Browser: chrome
  • Version: editor.swagger.io
  • Method of installation: browser
  • Swagger-Editor version: latest
  • Swagger/OpenAPI version: OpenAPI 3.0.1

Content & configuration

In our API, we require both an auth header and a custom header. As a result, I've made the following API spec which represents that part. However, when using the editor, I noticed that the prompts for authorization act like an either/or where the spec says it should be an AND: https://swagger.io/docs/specification/authentication/api-keys/

Example Swagger/OpenAPI definition:

components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: Api-Key
    authHeader:
      type: apiKey
      in: header
      name: Authorization

security:
  - apiKey: []
    authHeader: []

Describe the bug you're encountering

In our API, we require both an auth header and a custom header. As a result, I've made the following API spec which represents that part. However, when using the editor, I noticed that the prompts for authorization act like an either/or where the spec says it should be an AND: https://swagger.io/docs/specification/authentication/api-keys/

To reproduce...

Steps to reproduce the behavior:

  1. Go to editor, add this config in
  2. Click on 'Authorize'
  3. See that the two fields are displayed with buttons below each
  4. Expected: the two fields appear together and there is a single Authorize button.

johnament avatar Aug 30 '22 12:08 johnament