Skip to content

Commit 19d378e

Browse files
committed
Merge branch '2.17' into 2.18
2 parents 3b85344 + d0ac429 commit 19d378e

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

release-notes/CREDITS-2.x

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1785,6 +1785,11 @@ Peter Levart (plevart@github)
17851785
a Converter that may return null for a non-null input
17861786
(2.17.2)
17871787

1788+
Susan Witts (susanw1@github)
1789+
* Reported #4607: `MismatchedInput`: No Object Id found for an instance of X to
1790+
assign to property '@id'
1791+
(2.17.2)
1792+
17881793
Ulf Dreyer (u3r@github)
17891794
* Reported #4085: `@JsonView` does not work on class-level for records
17901795
(2.18.0)

release-notes/VERSION-2.x

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ Project: jackson-databind
6666
(reported by @dmelisso)
6767
#4595: No way to explicitly disable wrapping in custom annotation processor
6868
(reported by @SimonCockx)
69+
#4607: `MismatchedInput`: No Object Id found for an instance of X to
70+
assign to property '@id'
71+
(reported by Susan W)
6972
#4610: `DeserializationFeature.FAIL_ON_UNRESOLVED_OBJECT_IDS` does not work when
7073
used with Polymorphic type handling
7174
(fix by Joo-Hyuk K)

src/main/java/com/fasterxml/jackson/databind/deser/BeanDeserializer.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,15 +363,18 @@ public Object deserializeFromObject(JsonParser p, DeserializationContext ctxt) t
363363
final Object bean = _valueInstantiator.createUsingDefault(ctxt);
364364
// [databind#631]: Assign current value, to be accessible by custom deserializers
365365
p.assignCurrentValue(bean);
366+
367+
// First: do we have native Object Ids (like YAML)?
366368
if (p.canReadObjectId()) {
367369
Object id = p.getObjectId();
368370
if (id != null) {
369371
_handleTypedObjectId(p, ctxt, bean, id);
370372
}
371373
}
372374
// [databind#3838]: since 2.16 Uniform handling of missing objectId
373-
// only for the specific "empty JSON Object" case
374-
if (_objectIdReader != null && p.hasTokenId(JsonTokenId.ID_END_OBJECT)) {
375+
// only for the specific "empty JSON Object" case (and only for non-Native
376+
// Object Ids, see [databind#4607]
377+
else if (_objectIdReader != null && p.hasTokenId(JsonTokenId.ID_END_OBJECT)) {
375378
// [databind#4610]: check if we are to skip failure
376379
if (ctxt.isEnabled(DeserializationFeature.FAIL_ON_UNRESOLVED_OBJECT_IDS)) {
377380
ctxt.reportUnresolvedObjectId(_objectIdReader, bean);

0 commit comments

Comments
 (0)