Interface SecurityRequirement
-
- All Superinterfaces:
Constructible
,java.util.Map<java.lang.String,java.util.List<java.lang.String>>
public interface SecurityRequirement extends Constructible, java.util.Map<java.lang.String,java.util.List<java.lang.String>>
SecurityRequirement- See Also:
- SecurityRequirement Object
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description SecurityRequirement
addScheme(java.lang.String securitySchemeName)
Adds a security scheme to the SecurityRequirement instance based on the scheme name.SecurityRequirement
addScheme(java.lang.String securitySchemeName, java.lang.String scope)
Adds a security scheme to the SecurityRequirement instance based on the scheme name and required scope (optional) provided.SecurityRequirement
addScheme(java.lang.String securitySchemeName, java.util.List<java.lang.String> scopes)
Adds a security scheme to the SecurityRequirement instance based on the scheme name and required scopes (optional) provided.boolean
containsKey(java.lang.Object key)
Deprecated.since 1.1java.util.List<java.lang.String>
get(java.lang.Object key)
Deprecated.since 1.1default java.util.List<java.lang.String>
getScheme(java.lang.String securitySchemeName)
Returns a path item for a given name.java.util.Map<java.lang.String,java.util.List<java.lang.String>>
getSchemes()
Returns a copy map (potentially immutable) of the schemes.default boolean
hasScheme(java.lang.String securitySchemeName)
Check whether a scheme is present in the map.java.util.List<java.lang.String>
put(java.lang.String key, java.util.List<java.lang.String> value)
Deprecated.since 1.1void
putAll(java.util.Map<? extends java.lang.String,? extends java.util.List<java.lang.String>> m)
Deprecated.since 1.1java.util.List<java.lang.String>
remove(java.lang.Object key)
Deprecated.since 1.1void
removeScheme(java.lang.String securitySchemeName)
Removes a security scheme to the SecurityRequirement instance based on the scheme name.void
setSchemes(java.util.Map<java.lang.String,java.util.List<java.lang.String>> items)
Set all security schemes to the SecurityRequirement instance.
-
-
-
Method Detail
-
addScheme
SecurityRequirement addScheme(java.lang.String securitySchemeName, java.lang.String scope)
Adds a security scheme to the SecurityRequirement instance based on the scheme name and required scope (optional) provided.- Parameters:
securitySchemeName
- the name of security scheme declared in the Components section of the OpenAPI documentscope
- a required scope - only valid when the defined scheme is 'oauth2' or 'openIdConnect'. null values will be rejected (implementation will throw an exception) or ignored.- Returns:
- Updated SecurityRequirement instance
-
addScheme
SecurityRequirement addScheme(java.lang.String securitySchemeName, java.util.List<java.lang.String> scopes)
Adds a security scheme to the SecurityRequirement instance based on the scheme name and required scopes (optional) provided.- Parameters:
securitySchemeName
- the name of security scheme declared in the Components section of the OpenAPI documentscopes
- the scopes required - only valid when the defined scheme is 'oauth2' or 'openIdConnect'. null values will be rejected (implementation will throw an exception) or ignored.- Returns:
- Updated SecurityRequirement instance
-
addScheme
SecurityRequirement addScheme(java.lang.String securitySchemeName)
Adds a security scheme to the SecurityRequirement instance based on the scheme name. No scopes are included, resulting in an empty list of scopes for the security scheme. This is valid when the defined security scheme is not 'oauth2' or 'openIdConnect'.- Parameters:
securitySchemeName
- the name of security scheme declared in the Components section of the OpenAPI document- Returns:
- Updated SecurityRequirement instance
-
removeScheme
void removeScheme(java.lang.String securitySchemeName)
Removes a security scheme to the SecurityRequirement instance based on the scheme name.- Parameters:
securitySchemeName
- the name of security scheme
-
getSchemes
java.util.Map<java.lang.String,java.util.List<java.lang.String>> getSchemes()
Returns a copy map (potentially immutable) of the schemes.- Returns:
- all items
-
setSchemes
void setSchemes(java.util.Map<java.lang.String,java.util.List<java.lang.String>> items)
Set all security schemes to the SecurityRequirement instance. Keys are the name of security scheme declared in the Components section of the OpenAPI document, values are a list of required scope - only valid when the defined scheme is 'oauth2' or 'openIdConnect'- Parameters:
items
- a map containing the security schemes.
-
hasScheme
default boolean hasScheme(java.lang.String securitySchemeName)
Check whether a scheme is present in the map. This is a convenience method forgetSchemes().containsKey(name)
- Parameters:
securitySchemeName
- the name of security scheme- Returns:
- a boolean to indicate if the scheme is present or not.
-
getScheme
default java.util.List<java.lang.String> getScheme(java.lang.String securitySchemeName)
Returns a path item for a given name. This is a convenience method forgetSchemes().get(name)
- Parameters:
securitySchemeName
- the name of security scheme- Returns:
- the corresponding path item or null.
-
get
@Deprecated java.util.List<java.lang.String> get(java.lang.Object key)
Deprecated.since 1.1In the next version,SecurityRequirement
will no longer extendsMap
, this method will no longer be present. UsegetScheme(String)
instead.- Specified by:
get
in interfacejava.util.Map<java.lang.String,java.util.List<java.lang.String>>
-
containsKey
@Deprecated boolean containsKey(java.lang.Object key)
Deprecated.since 1.1In the next version,SecurityRequirement
will no longer extendsMap
, this method will no longer be present. UsehasScheme(String)
instead.- Specified by:
containsKey
in interfacejava.util.Map<java.lang.String,java.util.List<java.lang.String>>
-
put
@Deprecated java.util.List<java.lang.String> put(java.lang.String key, java.util.List<java.lang.String> value)
Deprecated.since 1.1In the next version,SecurityRequirement
will no longer extendsMap
, this method will no longer be present. UseaddScheme(String, List)
instead.- Specified by:
put
in interfacejava.util.Map<java.lang.String,java.util.List<java.lang.String>>
-
putAll
@Deprecated void putAll(java.util.Map<? extends java.lang.String,? extends java.util.List<java.lang.String>> m)
Deprecated.since 1.1In the next version,SecurityRequirement
will no longer extendsMap
, this method will no longer be present. UsesetSchemes(Map)
instead.- Specified by:
putAll
in interfacejava.util.Map<java.lang.String,java.util.List<java.lang.String>>
-
remove
@Deprecated java.util.List<java.lang.String> remove(java.lang.Object key)
Deprecated.since 1.1In the next version,SecurityRequirement
will no longer extendsMap
, this method will no longer be present. UseremoveScheme(String)
instead.- Specified by:
remove
in interfacejava.util.Map<java.lang.String,java.util.List<java.lang.String>>
-
-