Make Method protected void processConstraintViolations of Spring Validator Adaptor Public [SPR-17339] #21873
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: declined
A suggestion or change that we don't feel we should currently apply
Ankur Pathak opened SPR-17339 and commented
This method of SpringValidatorAdaptor should be public or their should be some similar public interface:
protected void processConstraintViolations(Set<ConstraintViolation<Object>> violations, Errors errors) {}
It allows to convert Set<ConstraintViolation> to BindingResult(BindException). So it has pottential of being used outside spring framework may be jax-rs, jax-ws in following manner:
Making that method protected is conflicting with above use case. Or we can have similar pblic interface to convert Ser<ConstrainViolation> to BindingResult.
Even some api framework like jax-ws jesey have integration for bean validation api and through constraintvoilationexception. this exception has set<constrainviolations>. Right now we don;t have any interface in LocalValidatorFactory to convert it to bindingresult. The advantage bindingresult
has is by using it we can easily prepare validation errors for user in any framework.
Affects: 5.0.9, 5.1 GA
The text was updated successfully, but these errors were encountered: