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

Use AND instead of OR for multiple authentication options #1147

Closed
milosmns opened this issue Dec 25, 2019 · 3 comments
Closed

Use AND instead of OR for multiple authentication options #1147

milosmns opened this issue Dec 25, 2019 · 3 comments

Comments

@milosmns
Copy link

Hi,

I see this was already reported in #577, but it seems like it's not fixed.

I have the following code:

"security": [
  {
    "AppID": []
  },
  {
    "AppSecret": []
  }
]

But it still generates:

Generated

So, I get OR there instead of AND. Even if this is intentional, I'd like to change to AND instead (at least with a configuration option).

This is my full HTML:

<!DOCTYPE html>
<html>
  <head>
    <title>My API</title>
    <!-- needed for adaptive design -->
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet">

    <style>
      body {
        margin: 0;
        padding: 0;
      }
    </style>
  </head>
  <body>
    <redoc spec-url='my-api-on-gist.json' hide-download-button></redoc>
    <script src="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js"></script>
  </body>
</html>
@milosmns
Copy link
Author

I believe it's here:

@RomanHotsiy
Copy link
Member

This is per OAS spec, to get AND change your code to:

"security": [
  {
    "AppID": [],
    "AppSecret": []
  }
]

See here: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#security-requirement-object

@milosmns
Copy link
Author

@RomanHotsiy interesting, I'll take a look! Thanks!

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