Annotation Interface OpenAPIDecorator


@Retention(SOURCE) @Documented @Target({TYPE,METHOD}) public @interface OpenAPIDecorator
The annotation can be used to add suffix and prefix for operationIds. For example, when you have 2 controllers with same operations, but use generics:
 @OpenAPIDecorator(opIdPrefix = "cats-", opIdSuffix = "-suffix")
 @Controller("/cats")
 interface MyCatsOperations extends Api<MyRequest, MyResponse> {
 }

 @OpenAPIDecorator("dogs-")
 @Controller("/dogs")
 interface MyDogsOperations extends Api<MyRequest, MyResponse> {
 }
 
Since:
4.5.0
  • Element Details

    • value

      String value
      Returns:
      Prefix for operation ids.
      Default:
      ""
    • opIdPrefix

      @AliasFor(member="value") String opIdPrefix
      Returns:
      Prefix for operation ids.
      Default:
      ""
    • opIdSuffix

      String opIdSuffix
      Returns:
      Suffix for operation ids.
      Default:
      ""
    • addAlways

      boolean addAlways
      Returns:
      is this flag false, prefixes and suffixes will not be added to operationId if operationId is set explicitly in the Operation annotation
      Default:
      true