79801703

Date: 2025-10-27 10:33:16
Score: 0.5
Natty:
Report link

I had same issue, but in my case the validation annotations were not generated because I configured to use Lombok annotations.

This was my configuration of openapi-generator-maven-plugin before:

<configOptions><additionalModelTypeAnnotations>@lombok.Data
    @lombok.Builder
    @lombok.AllArgsConstructor
    @lombok.NoArgsConstructor
    @lombok.Generated</additionalModelTypeAnnotations>
                        </configOptions>

and @NotNull and @Valid annotations were not generated on the class's fields. After removal of additionalModelTypeAnnotations config option, the getters are generated with validation annotations.

The options "useBeanValidation" and "useJakartaEe", and the dependency "spring-boot-starter-validation" were not needed in my case.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @NotNull
  • User mentioned (0): @Valid
  • Low reputation (0.5):
Posted by: Igor Bljahhin