Skip to content

Multiple security requirements with annotations #1261

@cbornet

Description

@cbornet

According to the spec, it should be possible to declare multiple requirements with AND logic on a Map but this doesn't seem to be possible from the annotations (only the OR list is available)

When using the authorizations={@authorizations...} in an operation, the following code is called

public void addSecurity(String name, List<String> scopes) {
        if (this.security == null) {
            this.security = new ArrayList<Map<String, List<String>>>();
        }
        Map<String, List<String>> req = new HashMap<String, List<String>>();
        if (scopes == null) {
            scopes = new ArrayList<String>();
        }
        req.put(name, scopes);
        this.security.add(req);
    }

so the authorization is put in a single element map which is then added to the list.
Could it be possible to have support for the "AND" logic in the annotations ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions