We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
So... I guess i found something wrong with nested nestIfPresent I'm using version 0.4.0
Should the code below throw an exception or not? In this test, there is a violation in the second validation
public class Main { public static void main(String[] args) { new Main(); } public Main() { Validator<Bar> barValidator = ValidatorBuilder.<Bar>of() .constraint(Bar::getValue, "name", Constraint::notNull) .build(); Validator<Foo> fooValidator = ValidatorBuilder.<Foo>of() .nestIfPresent(Foo::getBar, "bar", barValidator) .build(); Validator<Root> rootValidator = ValidatorBuilder.<Root>of() .nest(Root::getFoo, "foo", fooValidator) .build(); // data Foo foo = new Foo(null); Root root = new Root(foo); // Working as expected ConstraintViolations fooViolations = fooValidator.validate(foo); if (!fooViolations.isEmpty()) throw new RuntimeException("no exceptions expected here"); // Unexpected violation ConstraintViolations rootViolations = rootValidator.validate(root); if (!rootViolations.isEmpty()) throw new RuntimeException("neither here"); } private class Root { private Foo foo; private Root(Foo foo) { this.foo = foo; } public Foo getFoo() { return foo; } } private class Foo { private Bar bar; private Foo(Bar bar) { this.bar = bar; } public Bar getBar() { return bar; } } private class Bar { private String value; private Bar(String value) { this.value = value; } public String getValue() { return value; } } }
And something similar is happening with forEach as well, I just couldn't find exacly what. Yet.
Could it be a bug or did I miss something?
The text was updated successfully, but these errors were encountered:
@henriquephil Thanks for the feedback! It looks like it's not working as expected. Let me check when I have time. I'm currently pretty busy.
Sorry, something went wrong.
fixed via #120
Fix deep nested object validation for n-layers nested object. (#123)
be1a535
closes gh-60
Successfully merging a pull request may close this issue.
So... I guess i found something wrong with nested nestIfPresent
I'm using version 0.4.0
Should the code below throw an exception or not?
In this test, there is a violation in the second validation
And something similar is happening with forEach as well, I just couldn't find exacly what. Yet.
Could it be a bug or did I miss something?
The text was updated successfully, but these errors were encountered: