Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 1.1
-
Fix Version/s: 1.1.1
-
Component/s: Controllers
-
Labels:None
-
Testcase included:yes
Description
When binding to a domain object with a nullable property, typeMismatch errors are ignored - the property simply remains unchanged. Example is attached with a simple failing test. Removing the nullable: true from the dateOfBirth property in the domain class causes the test to pass as the binding error is detected.
We need to be careful with this issue, because if I recall there was another issue that asked for nullable:true to bind to null if the input was invalid. However, i think that makes sense of target type is a String and the input is a blank String like "" in which case you expect a result of null. Also if it was an Integer you would expect null to for a blank string.
So the point is the handling of blank needs to be treated differently to the handling of actual user input