Uploaded image for project: 'appNG'
  1. appNG
  2. APPNG-2272

DefaultValidationProvider.addValidationMetaData does not correctly handle parameterized super classes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Highest
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 1.20.0
    • Component/s: appng-api
    • Labels:
      None

      Description

      Example:

      public class Person {
      	private String name;
      
      	@NotNull
      	public String getName() {
      		return name;
      	}
      
      	public void setName(String name) {
      		this.name = name;
      	}
      }
      
      public class FormBase<T> {
      	private T item;
      
      	@Valid
      	public T getItem() {
      		return item;
      	}
      
      	public void setItem(T item) {
      		this.item = item;
      	}
      }
      
      public class PersonForm extends FormBase<Person> {
      
      }
      

      The expected Result (represented as XML) would look like:

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <metaData xmlns="http://www.appng.org/schema/platform" binding="item" bindClass="org.appng.exaple.PersonForm">
      	<field name="name" type="text" binding="item.name">
      		<validation>
      			<notNull>
      				<message ref="item.name" class="ERROR" code="{javax.validation.constraints.NotNull.message}">must not be null</message>
      			</notNull>			
      		</validation>
      	</field>
      </metaData>

        Attachments

          Activity

            People

            • Assignee:
              mueller.matthias Matthias Müller
              Reporter:
              mueller.matthias Matthias Müller
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: