Skip to content

Security requirements object is confusing #1216

Description

@OJFord

What's the motivation for having:

security:
  - scheme1: []
  - scheme2: []

rather than:

security:
  scheme1: []
  scheme2: []

which seems more straightforward, and easier to parse?

As it is, when encountering a security object, we have a list of maps containing just a single key - only we don't know what that key is. (Python-ish, as it happens) pseudocode:

for scheme in security:
    scheme_id = scheme.keys().pop()
    scopes = scheme[scheme_id]
    // ...

versus:

for (scheme_id, scopes) in security:
    // ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions