Top Description Methods
org.eclipse.microprofile.openapi.annotations.security

public @Interface SecurityRequirement

extends Annotation
Annotations
@Target:METHOD, TYPE
@Retention:RUNTIME
@Repeatable:SecurityRequirements
@Inherited
Imports
java.lang.annotation.ElementType, .Inherited, .Repeatable, .Retention, .RetentionPolicy, .Target

Specifies a security requirement for an operation.

Applying this annotation to a method or class is equivalent to applying a SecurityRequirementsSet annotation containing only this annotation.

See Also
OpenAPI Specification Security Requirement Object

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the name of this Security Requirement instance
name
()

Name MUST correspond to a security scheme which is declared in the Security Schemes under the Components Object.

public String[]

Returns:

a list of scope names required for the execution of this Security Requirement instance.
scopes
()

If the security scheme referred by the name property is of type "oauth2" or "openIdConnect", then the scopes array is a list of scope names required for the execution.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

nameback to summary
public String name()

Name MUST correspond to a security scheme which is declared in the Security Schemes under the Components Object.

Returns:String

the name of this Security Requirement instance

scopesback to summary
public String[] scopes()

If the security scheme referred by the name property is of type "oauth2" or "openIdConnect", then the scopes array is a list of scope names required for the execution.

For other security scheme types, the array MAY contain a list of required roles.

Returns:String[]

a list of scope names required for the execution of this Security Requirement instance.