-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Validation of @ConfigurationProperties does not happen for nested properties #3510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This works: @ConfigurationProperties("config")
class Config {
@NotNull
@Valid
private Props props = new Props();
public Props getProps() {
return props;
}
public void setProps(Props props) {
this.props = props;
}
public static class Props {
@NotEmpty
// doesn't work here
private String value = "";
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
} |
* pr/3566: Polish Document validation of nested components
why use it here? but others all wrong.
|
@shipengyan I'm not sure I understand the question, but here's not the best place to ask it. We like to keep the issue tracker purely for bugs and enhancements. The issue has also been closed for 2 years. If have a general question you should ask on http://stackoverflow.com, or you can join us on http://gitter.im. |
This comment is for people who still face this issue: For me, the salvation was this: It wasn't necessary the static class |
E.g. this works:
this doesn't
The text was updated successfully, but these errors were encountered: