Skip to content

Conversation

@JacksonJang
Copy link
Contributor

Issue: #1622, #3355

While working on #1622, I fortunately fixed #3355 as well (?)

Here's what I think was happening:
When Child deserializer is created through Parent's children field,
it gets built without _propertyBasedCreator. (_propertyBasedCreator == null)

The root cause is the timing issue between createContextual() and resolve().

  1. Parent deserializer starts processing children field
  2. Child deserializer is created.
  3. createContextual() is called to apply @JsonIgnoreProperties
  4. At this point, _propertyBasedCreator is still null (resolve() not called yet)
  5. The contextual deserializer is created without _propertyBasedCreator
  6. resolve() is called later on the original deserializer, but doesn't affect the contextual one
  7. That happened the issue.

So I fixed it, reconstructing PropertyBasedCreator in createContextual() when _propertyBasedCreator == null is detected.
When you have a moment, please take a look.

@github-actions
Copy link

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 78.8% 📈 +0.100%
Branches branches 72.5% 📈 +0.000%

Coverage data generated from JaCoCo test results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deserialization fails depending on the order of deserialized objects with "Cannot construct instance (although at least one Creator exists)"

1 participant