Skip to content
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

Automatic Validator for Couchbase AutoConfig #5178

Closed
ldoguin opened this issue Feb 18, 2016 · 2 comments
Closed

Automatic Validator for Couchbase AutoConfig #5178

ldoguin opened this issue Feb 18, 2016 · 2 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@ldoguin
Copy link

ldoguin commented Feb 18, 2016

I would love to have automatic validation just by adding an annotation on an entity. As a developer I expect to write only 'significant' code.

If I have

@NotNull
private String someField

I expect it to be the only code I have to write to make sure this field will never be persisted as null.

Currently I have to add a validator bean like so:

@Bean
public Validator validator() {
    return new LocalValidatorFactoryBean();
}

I know it's not a lot to add, but from a devex perspective, I would find it easier to have it directly set in CouchbaseAutoconfiguration.

That being said I might not realize fully what having a validator declared implies other than making sure your annotation will be taken into account.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 18, 2016
@snicoll snicoll added the for: team-attention An issue we'd like other members of the team to review label Feb 21, 2016
@philwebb
Copy link
Member

Probably worth following the same pattern as ConfigurationPropertiesBindingPostProcessor

@wilkinsona wilkinsona removed the for: team-attention An issue we'd like other members of the team to review label Feb 24, 2016
@snicoll
Copy link
Member

snicoll commented Dec 19, 2016

We should probably improve ValidationAutoConfiguration (#6228 ) to expose a Validator then. Right now, we don't use any of the logic in ConfigurationPropertiesBindingPostProcessor

@snicoll snicoll added type: enhancement A general enhancement for: team-attention An issue we'd like other members of the team to review and removed status: waiting-for-triage An issue we've not yet triaged for: team-attention An issue we'd like other members of the team to review labels Dec 19, 2016
@snicoll snicoll self-assigned this Dec 19, 2016
@snicoll snicoll added this to the 1.5.0 M1 milestone Dec 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

5 participants