phoenixnap / springmvc-raml-plugin

Spring MVC - RAML Spec Synchroniser Plugin. A Maven plugin designed to Generate Server & Client code in Spring from a RAML API descriptor and conversely, a RAML API document from the SpringMVC Server implementation.
Apache License 2.0
136 stars 84 forks source link

@Valid annotations added on same getter in both parent and child objects lead to exception #265

Closed stojsavljevic closed 6 years ago

stojsavljevic commented 6 years ago

In case we have something like this:

types: 
  Addres: 
    type: object
    properties: 
      city: string
      street: string
      houseNo: string
  Parent: 
    type: object
    properties: 
      address: Addres
  Child: 
    type: Parent

the plugin will generate getAddres method in both Parent and Child with @Valid annotation (if validation is used). But when validating Child object exception is thrown:

javax.validation.ConstraintDeclarationException: HV000131: A method return value must not be marked for cascaded validation more than once in a class hierarchy, but the following two methods are marked as such: ...