neoremind / fluent-validator

A Java validation framework leveraging fluent interface style and JSR 303 specification
Apache License 2.0
1.02k stars 222 forks source link

only first filed of car's tow same validator was validated #34

Open JoeXie opened 6 years ago

JoeXie commented 6 years ago
FluentValidator.checkAll()
                .configure(new SimpleRegistry())
                .on(car)
                .doValidate(new SimpleValidateCallback());

class car may like this:

class car{
...
    @FluentValidate(SimpleDataValidator.class)
    private String startTime;

    @FluentValidate(SimpleDataValidator.class)
    private String endTime;
...
}

When I use this method, only first filed of car's tow same validator was validated, validator worked on startTime, ignored endTime.

neoremind commented 6 years ago

Sorry, I am a little busy recently, can you make sure which strategy is enabled? if failfast is enabled, only first error will be returned.

JoeXie commented 6 years ago

@neoremind Yes, policy is FailFast. on the case of the first field is correct , the second field is wrong. But the framework didn't find the second wrong field and just ignored this field.

neoremind commented 6 years ago

I will look into this issue.