Annotation Interface OpenApiFilter


@Retention(RUNTIME) @Target(TYPE) public @interface OpenApiFilter
This extends the MP way to define an `org.eclipse.microprofile.openapi.OASFilter`. Currently in MP, this needs to be added to a config `mp.openapi.filter` and only allows one filter (class) per application.

This quarkus specific annotation allows users to annotate a class extending OASFilter as an OpenApiFilter. Such annotated classes will automatically be picked up and run during the appropriate OpenApiFilter.RunStage.

The configured RunStages in stages() take precedence, if explicitly set. Otherwise, the RunStage from value() is used, if explicitly set. Otherwise, the default value of stages() is used.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Names of the OpenAPI document configurations this filter should be applicable for
    int
    Filter with a higher priority will be applied first
    The stages at which this filter should run.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Use stages() instead.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Default document name which is used for the unnamed default document configuration.
    static final String
    Marker to indicate that a filter should run for any document name.
  • Field Details

    • DEFAULT_DOCUMENT_NAME

      static final String DEFAULT_DOCUMENT_NAME
      Default document name which is used for the unnamed default document configuration.
      See Also:
    • FILTER_RUN_FOR_ANY_DOCUMENT

      static final String FILTER_RUN_FOR_ANY_DOCUMENT
      Marker to indicate that a filter should run for any document name.
      See Also:
  • Element Details

    • stages

      The stages at which this filter should run.

      Example: @OpenApiFilter(stages = {OpenApiFilter.RunStage.BUILD, OpenApiFilter.RunStage.RUNTIME_STARTUP})

      Intentionally defaults to the deprecated OpenApiFilter.RunStage.RUN as to not break backwards compatibility.

      Default:
      {RUN}
    • value

      Deprecated, for removal: This API element is subject to removal in a future version.
      Use stages() instead.
      When this filter should run, default Runtime.
      Default:
      RUN
    • priority

      int priority
      Filter with a higher priority will be applied first
      Returns:
      Default:
      1
    • documentNames

      String[] documentNames
      Names of the OpenAPI document configurations this filter should be applicable for
      Returns:
      Default:
      {"<ALL>"}