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

Using multiple security schemes does not follow OAS 3 spec #483

Open
jjcollinge opened this issue May 4, 2023 · 2 comments
Open

Using multiple security schemes does not follow OAS 3 spec #483

jjcollinge opened this issue May 4, 2023 · 2 comments

Comments

@jjcollinge
Copy link

jjcollinge commented May 4, 2023

As defined in the OAS 3 spec, you should be able to use multiple security schemes together in a few different ways:

security:    # A OR B
  - A
  - B
security:    # A AND B
  - A
    B
security:    # (A AND B) OR (C AND D)
  - A
    B
  - C
    D

I have found that when using A AND B in my OAS 3.0.3 spec that the generated postman collection only respects A and does not include B.

Below is a representative sample of my spec:

paths:
  /somepath:
    get:
      description: get something
      operationId: get something
      security:
        - bearerAuth: []
          apiKey: []

components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    apiKey:
      type: apiKey
      name: x-custom-apikey
      in: header

The generated collection only includes a header for the bearerAuth security scheme and not the apiKey.

@JaredAAT
Copy link

JaredAAT commented May 9, 2023

@jjcollinge this might be related: postmanlabs/openapi-to-postman#465

i think it's an issue with the underlying postman convertor rather than with the portman library

@jjcollinge
Copy link
Author

@JaredAAT thanks for the response. Looks like you're right, thanks for spotting that!

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

2 participants