| Another thing that is bothering me a bit and is related to the issue at hand is how we deal with parameters and return values. Currently, we can't disable the already validated bean tracking based on the real validated bean metadata which would have been nice to achieve. When you validate:
public class Bean {
public void myMethod(@Valid MyParameterBean parameter1)
}
it would be nice to take into account if MyParameterBean has some cascading enabled inside it or not. Currently we can't do that as the ValidationContext is global to the full validation of the method (so to the other parameters too). I'm not sure we can find a nice solution to this problem. Maybe what we are doing now is the best we can do but I'm wondering if we should have some sort of a ValidationContext specific to each parameter/return value. Currently, it's using the cascading mechanism so it's very generic. Maybe it's better to keep it this way. Worth exploring though IMHO. |