Annotation Type Authorization


  • @Target(METHOD)
    @Retention(RUNTIME)
    public @interface Authorization
    Defines an authorization scheme to be used on a resource or an operation.

    The authorization scheme used needs to be declared at the Swagger root level first.

    This annotation is not used directly and will not be parsed by Swagger. It should be used within either Api or ApiOperation.

    See Also:
    ApiOperation, Api
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      String value
      The name of the authorization scheme to be used on this resource/operation.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      AuthorizationScope[] scopes
      The scopes to be used if the authorization scheme is OAuth2.
    • Element Detail

      • value

        String value
        The name of the authorization scheme to be used on this resource/operation.

        The name must be defined in the Resource Listing's authorization section,

      • scopes

        AuthorizationScope[] scopes
        The scopes to be used if the authorization scheme is OAuth2.
        See Also:
        AuthorizationScope
        Default:
        {@io.swagger.annotations.AuthorizationScope(scope="", description="")}