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

I'd like to propose validator.validateProperty(Object bean, String propertyName, SomeGroupValidation.class) #569

Closed
ThiagoDosSantos opened this issue Sep 7, 2013 · 6 comments

Comments

@ThiagoDosSantos
Copy link

As hibernate validator has this method, I think it'd be useful to have this method in vraptor validator as well. And it's very simple to implement!

@ThiagoDosSantos
Copy link
Author

For all those who don't think it can be useful, here it's an example:

public class Book {
@Min.List( { @min(value = 100, groups = Printing.class), @min(value = 5, groups = Draft.class) })
private int numOfPages;

    ... other fields ...

}

For now, we can't validate only numOfPages field with vraptor validator. But it's possible with hibernate validator:

hibernateValidator.validateProperty(book, "numOfPages", Printing.class);

@garcia-jj
Copy link
Member

Already implemented. Please, look BeanValidator.validateProperties, that you can define properties to be validated.

@ThiagoDosSantos
Copy link
Author

Garcia, It's not implemented as you said. There's no BeanValidator.validateProperty(Object bean, String propertyName, SomeGroupValidation.class)

@nykolaslima
Copy link
Contributor

Today we can validate some properties: validateProperties(object, "id", "name");
or validate some Validation Groups: validate(object, Grupo1.class, Grupo2.class)
#506

We don't have an implementation as @ThiagoDosSantos suggested.

@garcia-jj
Copy link
Member

My mistake. Thiago, can you send a pull request to us?

Thanks

@ThiagoDosSantos
Copy link
Author

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants