Skip to content

Fix updating nested collection fields using JSON Patch#2402

Open
EdikAmperyan wants to merge 2 commits into
spring-projects:mainfrom
EdikAmperyan:fix/#2401
Open

Fix updating nested collection fields using JSON Patch#2402
EdikAmperyan wants to merge 2 commits into
spring-projects:mainfrom
EdikAmperyan:fix/#2401

Conversation

@EdikAmperyan

Copy link
Copy Markdown

Fix updating nested collection fields using JSON Patch

Closes #2401
Related tickets #2401

Fix updating nested collection fields using JSON Patch

Closes spring-projects#2401
Related tickets spring-projects#2401
@pivotal-cla

Copy link
Copy Markdown

@EdikAmperyan Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-cla

Copy link
Copy Markdown

@EdikAmperyan Thank you for signing the Contributor License Agreement!

…collection elements

SkippedPropertyPath.nested() used path.getTypeInformation(), which returns
the type of the first segment of the PropertyPath chain instead of the leaf
property. For pointers like /catalog/books/0/reviews/- the index segment
was therefore not skipped and was resolved as a property name, failing
with PropertyReferenceException ("No property '0' found...").

Use path.getLeafProperty().getTypeInformation(), mirroring what
SpelExpressionBuilder.next() already does.

Related tickets spring-projects#2401

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Updating nested collection elements using JSON Patch throws exception

4 participants