You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using PATCH for objects that use @JsonAnySetter for deserialization and therefore don't have a corresponding property in MappedProperties, DomainObjectReader#doMerge fails. This used to work in previous versions of this class, when
if (!mappedProperties.hasPersistentPropertyForField(fieldName))
was used (without removing the field from deserialization, see changes in commit and commit ). Now
if (!mappedProperties.isWritableProperty(fieldName)) {
checks whether the property is writable (which is an improvement). But this also returns true if the class to merge contains an @JsonAnySetter. This means that the following call
Hi!
When using
PATCH
for objects that use@JsonAnySetter
for deserialization and therefore don't have a corresponding property inMappedProperties
,DomainObjectReader#doMerge
fails. This used to work in previous versions of this class, whenwas used (without removing the field from deserialization, see changes in commit and commit ). Now
checks whether the property is writable (which is an improvement). But this also returns
true
if the class to merge contains an@JsonAnySetter
. This means that the following callreturns
null
and the call after thisThrows the error.
The solution IMHO is a simple null check before the
accessor.getProperty
call likeThis lets
@JsonAnySetter
handle the further deserialization, as I understand was the intention in previous versions and should be now.I confirmed this fix with a test case, see referenced pull request.
The text was updated successfully, but these errors were encountered: