I have a web service that is deployed out in multiple regions and requires different validation logic on the request object depending on the region. Things like street addresses and postal codes, phone numbers, emails, etc.
My webservice method currently receives a POJO generated from the schema XSD which has some basic restrictions defined in it, and gets validated against that, but they are the most lenient restrictions across all the supported regions.
I want to be able to have to validate the request object against the current region’s requirements, and get back error message(s) for all the violations so that I can return an error response to the calling party that details the issues.
Wondering what is the best way to implement this with the Hibernate Validator?