Add @Valid annotation to fields

Proprietary

In Spring Boot 3.4, validation of @ConfigurationProperties classes annotated with @Validated now follows the Bean Validation specification, only cascading to nested properties if the corresponding field is annotated with @Valid. The recipe will add a @Valid annotation to each field which has a type that has a field which is annotated with a jakarta.validation.constraints.* annotation.

io.moderne.java.spring.boot3.AddValidToConfigurationPropertiesFields
mod run . --recipe=io.moderne.java.spring.boot3.AddValidToConfigurationPropertiesFields

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.