Annotation Interface OpenApi.SecuritySchemeRequirement

Enclosing class:
OpenApi

@Target({TYPE,METHOD}) @Retention(CLASS) @Documented @Inherited public static @interface OpenApi.SecuritySchemeRequirement
OpenAPI Security Requirement Object scheme entry metadata.

Use directly on @OpenApi.Document metadata types, endpoint types, or methods to declare a single security requirement object with one scheme. Use inside @OpenApi.SecurityRequirement to declare multiple schemes required together by one OpenAPI security requirement object.

On @OpenApi.Document metadata types, direct type-level usage emits a top-level document security requirement. On endpoint types, direct type-level usage applies to generated operations for the endpoint. Method-level usage replaces inherited endpoint requirements for that operation. Direct usage cannot be combined with @OpenApi.SecurityRequirement or @OpenApi.SecurityRequirements on the same type or method. Type-level usage on a declarative REST endpoint contract also applies to its implementations. A security requirement declared directly on an endpoint implementation replaces requirements inherited from its contract.

If matching methods inherited from multiple endpoint contracts declare scheme requirements, each inherited method must declare the same requirements, including repeated occurrences, although the annotation order can differ. Helidon emits the inherited requirements once. Different inherited declarations cause code generation to fail. A scheme requirement declared directly on the endpoint implementation method replaces all inherited method-level requirements.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Required scheme name.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    OAuth/OpenID Connect scopes for this scheme.
  • Element Details

    • value

      String value
      Required scheme name.
      Returns:
      scheme name
    • scopes

      String[] scopes
      OAuth/OpenID Connect scopes for this scheme.
      Returns:
      scopes
      Default:
      {}