Closes gh-3566
This commit is contained in:
Stephane Nicoll
2015-07-23 11:52:51 +02:00
parent fbf6574b51
commit 34891c27de

View File

@@ -780,8 +780,11 @@ annotations to your `@ConfigurationProperties` class:
} }
---- ----
In order to validate values of nested properties, you must annotate the static nested
class as `@Valid`. For example, building upon the above `@ConfigurationProperties` class:
In order to validate values of nested properties, you must annotate the associated field
as `@Valid` to trigger its validation. For example, building upon the above
`ConnectionSettings` example:
[source,java,indent=0] [source,java,indent=0]
---- ----
@@ -791,11 +794,11 @@ class as `@Valid`. For example, building upon the above `@ConfigurationPropertie
@NotNull @NotNull
@Valid @Valid
private InetAddress remoteAddress; private RemoteAddress remoteAddress;
// ... getters and setters // ... getters and setters
private static class InetAddress { private static class RemoteAddress {
@NotEmpty @NotEmpty
public String hostname; public String hostname;