DomainObjectReader throws UnsupportedOperationException on PATCH request when altering the size of existing Array [DATAREST-1068] #1433
When sending a PATCH request with some fields to update an existing entity, if one of the fields is an array, and the size of the array is different from the existing property array, handleArrayNode method from DomainObjectReader class throws an UnsupportedOperationException.
When debugging all the way down into DomainObjectReader class, the handleArrayNode method seems to be called from handleArray method, which is sending a Collection as parameter after calling ifCollection(source) method. This ifCollection method is returning a fixed size List (from Arrays.asList) which eventually, handleArrayNode method is trying to alter in size with .add or .remove methods on the given Collection, and here is where the UnsupportedOperationException is thrown.
I am using Spring Boot 1.5.2-RELEASE. But i see no changes in Spring Data Rest repository on these methods class for latest branches/tags
Affects: 2.6.1 (Ingalls SR1)
Referenced from: pull request #371
The text was updated successfully, but these errors were encountered:
DomainObjectReader still contains this flaw as of today's build of version 3.3.0.BUILD-SNAPSHOT. I have created a a unit test that demonstrates the problem and the code to fix it. But I have no clue how to create a branch on which to submit a PR. I'd be happy to upload what I have if someone could assist with the branch permissions