public class SecurityRequirementObjectBuilder extends Object
Lists the required security schemes to execute this operation. The name used for each property MUST correspond to
a security scheme declared in the SecuritySchemeObject
under the ComponentsObject
.
Security Requirement Objects that contain multiple schemes require that all schemes MUST be satisfied for a request to be authorized. This enables support for scenarios where multiple query parameters or HTTP headers are required to convey security information.
When a list of Security Requirement Objects is defined on the OpenAPIObject
or
OperationObject
, only one of Security Requirement Objects in the list needs to be
satisfied to authorize the request.
Constructor and Description |
---|
SecurityRequirementObjectBuilder() |
Modifier and Type | Method and Description |
---|---|
SecurityRequirementObject |
build() |
static SecurityRequirementObjectBuilder |
securityRequirementObject()
Creates a builder for a
SecurityRequirementObjectBuilder |
SecurityRequirementObjectBuilder |
withRequirements(Map<String,List<String>> requirements) |
public SecurityRequirementObjectBuilder withRequirements(Map<String,List<String>> requirements)
requirements
- Each name MUST correspond to a security scheme which is declared in the ComponentsObject.securitySchemes
under the ComponentsObject
. If the security scheme is of type "oauth2"
or
"openIdConnect"
, then the value is a list of scope names required for the execution.
For other security scheme types, the array MUST be empty.public SecurityRequirementObject build()
public static SecurityRequirementObjectBuilder securityRequirementObject()
SecurityRequirementObjectBuilder
Copyright © 2017–2019. All rights reserved.