Jersey/JAX-RS : How to cascade beans-validation recursively with @Valid automatically?

Actually, according to the specification, adding @Valid is exactly for this usecase. From the JSR 303 specification:

In addition to supporting instance validation, validation of graphs of object is also supported. The result of a graph validation is returned as a unified set of constraint violations.
Consider the situation where bean X contains a field of type Y. By annotating field Y with the @Valid annotation, the Validator will validate Y (and its properties) when X is validated.

The @Valid annotation is applied recursively

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)