Annotation Type SecurityRequirementsSet


  • @Target({METHOD,TYPE})
    @Retention(RUNTIME)
    @Repeatable(SecurityRequirementsSets.class)
    @Inherited
    public @interface SecurityRequirementsSet
    This annotation represents a set of security requirements which permit access to an operation if all of them are satisfied.

    If this annotation is applied to a method which corresponds to an operation, then the requirements will be added to that operation.

    If this annotation is applied to a class which contains methods which correspond to operations, then the requirements will be added to all operations corresponding to methods within that class which don't specify any other requirements.

    Security requirements can be specified for the whole API using OpenAPIDefinition.securitySets(). Security requirements specified for individual operations override those specified for the whole API.

    If multiple security requirement sets are specified for an operation, then a user must satisfy all of the requirements within any one of the sets to access the operation.

    An empty security requirement set indicates that authentication is not required.

    A SecurityRequirementSet annotation corresponds to a map of security requirements in an OpenAPI document.

     Example: 
     security: 
      - api_secret: []
        oauth_implicit: []
     
    See Also:
    SecurityRequirement Object
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      SecurityRequirement[] value
      The security requirements which make up the set
    • Element Detail

      • value

        SecurityRequirement[] value
        The security requirements which make up the set
        Returns:
        the array of the SecurityRequirement annotations, may be empty
        Default:
        {}