Commit bc3c3232 authored by Madhura Bhave's avatar Madhura Bhave

Merge branch '2.1.x'

Closes gh-18734
parents d73a579d e59a643e
...@@ -1326,8 +1326,7 @@ To do so, ensure that a compliant JSR-303 implementation is on your classpath an ...@@ -1326,8 +1326,7 @@ To do so, ensure that a compliant JSR-303 implementation is on your classpath an
TIP: You can also trigger validation by annotating the `@Bean` method that creates the configuration properties with `@Validated`. TIP: You can also trigger validation by annotating the `@Bean` method that creates the configuration properties with `@Validated`.
Although nested properties will also be validated when bound, it's good practice to also annotate the associated field as `@Valid`. To ensure that validation is always triggered for nested properties, even when no properties are found, the associated field must be annotated with `@Valid`.
This ensures that validation is triggered even if no nested properties are found.
The following example builds on the preceding `AcmeProperties` example: The following example builds on the preceding `AcmeProperties` example:
[source,java,indent=0] [source,java,indent=0]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment