Chrimle / openapi-to-java-records-mustache-templates

Generate Java Records from OpenAPI Specifications
https://chrimle.github.io/openapi-to-java-records-mustache-templates/
Apache License 2.0
3 stars 0 forks source link

Fix recursive validation of `record` fields using `@Valid` annotations #221

Closed Chrimle closed 1 week ago

Chrimle commented 1 week ago

Fields of generated record classes could themselves have constraints but were not annotated with @Valid, resulting in these fields not being validated. This fix ensures that all custom field types - whether inner classes, standalone classes, or self-referencing classes - are correctly annotated with @Valid. This is only applicable when generating with the useBeanValidation-option enabled.

Checklist