fluent-validator icon indicating copy to clipboard operation
fluent-validator copied to clipboard

能否支持ValidatorContext中获取当前验证的字段信息

Open eziliao opened this issue 8 years ago • 1 comments

我看了下文档中比如要返回详细信息的话,这获取字段名称直接给硬编码在代码中,如果写一个验证器同类型字段都能使用,那么这样的话还是希望能在ValidatorContext直接获取到字段信息。例如:字段名称,类型等。

context.addError(ValidationError.create("Something is wrong about the car seat count!").setErrorCode(100).setField("seatCount").setInvalidValue(t));

eziliao avatar Nov 25 '17 01:11 eziliao

你说的有道理,如果在context中可以获取这些变量那么会友好很好。

neoremind avatar Nov 25 '17 03:11 neoremind