spring-projects / spring-projects/spring-data-rest
ValidationErrors unable to resolve nested properties. [DATAREST-496]
@odrotbohm is already working on this.
Since Dec 31, 2020.
- Dominant language
- Java
- Stars
- 958
- Forks
- 568
- PR merge metrics
- No merged PRs in 30d
Description
Andrew Hamilton opened DATAREST-496 and commented
org.springframework.data.rest.core.ValidationErrors#getFieldValue uses the field as a key into the propertyCache when attempting to resolve the invalid value of the validation error.
For nested properties, this always results in a null invalidValue:
{
"errors" : [ {
"entity" : "PurchaseOrder",
"message" : "must match \"((0[0-9])|(1[0-2])|(2[1-9])|(3[0-2])|(6[1-9])|(7[0-2])|80)([0-9]{7})\"",
"invalidValue" : "null",
"property" : "payment.bankAccount.routingNumber"
} ]
}
For this request the routingNumber was "02100002133222".
From a quick look at the code, I'm not sure if getFieldValue should do the property navigation to attempt to find the invalid value, or if there's a more appropriate place to do that
Affects: 2.2.1 (Evans SR1)
1 votes, 4 watchers
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.