Interface SecurityRequirement
- All Superinterfaces:
Constructible
,Map<String,
List<String>>
SecurityRequirement
- See Also:
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdds a security scheme to the SecurityRequirement instance based on the scheme name.Adds a security scheme to the SecurityRequirement instance based on the scheme name and required scope (optional) provided.Adds a security scheme to the SecurityRequirement instance based on the scheme name and required scopes (optional) provided.boolean
containsKey
(Object key) Deprecated.since 1.1Deprecated.since 1.1Returns a path item for a given name.Returns a copy map (potentially immutable) of the schemes.default boolean
Check whether a scheme is present in the map.Deprecated.since 1.1void
Deprecated.since 1.1Deprecated.since 1.1void
removeScheme
(String securitySchemeName) Removes a security scheme to the SecurityRequirement instance based on the scheme name.void
setSchemes
(Map<String, List<String>> items) Set all security schemes to the SecurityRequirement instance.Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsValue, entrySet, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, putIfAbsent, remove, replace, replace, replaceAll, size, values
-
Method Details
-
addScheme
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
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
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
Removes a security scheme to the SecurityRequirement instance based on the scheme name.- Parameters:
securitySchemeName
- the name of security scheme
-
getSchemes
Returns a copy map (potentially immutable) of the schemes.- Returns:
- all items
-
setSchemes
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
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
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.since 1.1In the next version,SecurityRequirement
will no longer extendsMap
, this method will no longer be present. UsegetScheme(String)
instead. -
containsKey
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 interfaceMap<String,
List<String>>
-
put
Deprecated.since 1.1In the next version,SecurityRequirement
will no longer extendsMap
, this method will no longer be present. UseaddScheme(String, List)
instead. -
putAll
Deprecated.since 1.1In the next version,SecurityRequirement
will no longer extendsMap
, this method will no longer be present. UsesetSchemes(Map)
instead. -
remove
Deprecated.since 1.1In the next version,SecurityRequirement
will no longer extendsMap
, this method will no longer be present. UseremoveScheme(String)
instead.
-