Package org.apache.juneau.bean.openapi3
Class SecurityRequirement
java.lang.Object
org.apache.juneau.bean.openapi3.OpenApiElement
org.apache.juneau.bean.openapi3.SecurityRequirement
Lists the required security schemes for this operation.
 
See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionDefault constructor.SecurityRequirement(SecurityRequirement copyFrom) Copy constructor.
- 
Method SummaryModifier and TypeMethodDescriptionaddRequirement(String schemeName, String... scopes) Adds a security requirement.copy()Makes a copy of this object.<T> TGeneric property getter.Returns the security requirements map.keySet()Returns all the keys on this element.Generic property setter.setApiKeyAuth(String schemeName) Adds a security requirement for a scheme that doesn't use scopes.setRequirements(Map<String, List<String>> value) Sets the security requirements map.strict()Sets strict mode on this bean.Sets strict mode on this bean.
- 
Constructor Details- 
SecurityRequirementpublic SecurityRequirement()Default constructor.
- 
SecurityRequirementCopy constructor.- Parameters:
- copyFrom- The object to copy.
 
 
- 
- 
Method Details- 
copyMakes a copy of this object.- Returns:
- A new copy of this object.
 
- 
getRequirementsReturns the security requirements map.- Returns:
- The security requirements map.
 
- 
setRequirementsSets the security requirements map.- Parameters:
- value- The new value for this property.
- Returns:
- This object.
 
- 
addRequirementAdds a security requirement.- Parameters:
- schemeName- The security scheme name. Must not be- null .
- scopes- The required scopes. Must not be- null .
- Returns:
- This object.
 
- 
setApiKeyAuthAdds a security requirement for a scheme that doesn't use scopes.This is a convenience method for adding security schemes that don't use scopes, such as API keys, HTTP Basic authentication, or HTTP Bearer tokens. According to the OpenAPI specification, security schemes that don't use scopes should have an empty array as the value. This method is equivalent to calling addRequirement(schemeName) with no scopes.Example:// Add API key authentication requirement SecurityRequirementrequirement =new SecurityRequirement() .setApiKeyAuth("api_key" );// Results in: { "api_key": [] } See Also:- Parameters:
- schemeName- The security scheme name. Must not be- null .
- Returns:
- This object.
 
- 
getDescription copied from class:OpenApiElementGeneric property getter.Can be used to retrieve non-standard Swagger fields such as "$ref" .- Overrides:
- getin class- OpenApiElement
- Type Parameters:
- T- The datatype to cast the value to.
- Parameters:
- property- The property name to retrieve.
- type- The datatype to cast the value to.
- Returns:
- The property value, or null if the property does not exist or is not set.
 
- 
setDescription copied from class:OpenApiElementGeneric property setter.Can be used to set non-standard Swagger fields such as "$ref" .- Overrides:
- setin class- OpenApiElement
- Parameters:
- property- The property name to set. Must not be- null .
- value- The new value for the property.
- Returns:
- This object
 
- 
keySetDescription copied from class:OpenApiElementReturns all the keys on this element.- Overrides:
- keySetin class- OpenApiElement
- Returns:
- All the keys on this element.
   
 Nevernull .
 
- 
strictDescription copied from class:OpenApiElementSets strict mode on this bean.- Overrides:
- strictin class- OpenApiElement
- Returns:
- This object
 
- 
strictDescription copied from class:OpenApiElementSets strict mode on this bean.- Overrides:
- strictin class- OpenApiElement
- Parameters:
- value- The new value for this property.
 Non-boolean values will be converted to boolean using- Boolean..- valueOf (value.toString())
 Can be- null (interpreted as- false ).
- Returns:
- This object
 
 
-