3

I am using openapi generator (5.4.0) with gradle.

It is configured with spring generator name, and added lombok configOptions.

additionalModelTypeAnnotations : "@lombok.Builder; @lombok.NoArgsConstructor;@lombok.AllArgsConstructor;"

As some fields are nullable, I get a compile warning:

 warning: @Builder will ignore the initializing expression entirely. 
If you want the initializing expression to serve as default, 
add @Builder.Default.

Is there anyway to rectify this without adding @Builder.Default to the mustache pojo template?

Thanks, B

user518066
  • 1,277
  • 3
  • 23
  • 35
  • https://stackoverflow.com/questions/47883931/default-value-in-lombok-how-to-init-default-with-both-constructor-and-builder/50392165#50392165 according to this comment, move the @Builder annotation to constructer level. The core issue is still being addressed https://github.com/projectlombok/lombok/issues/2340 – DDK Feb 14 '23 at 12:22

0 Answers0