Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FAIL_ON_MISSING_EXTERNAL_TYPE_ID_PROPERTY setting ignored when creator properties are buffered #2404

Closed
josephlbarnett opened this issue Aug 4, 2019 · 3 comments
Milestone

Comments

@josephlbarnett
Copy link
Contributor

josephlbarnett commented Aug 4, 2019

#1341 added the ability to disable a FAIL_ON_MISSING_EXTERNAL_TYPE_ID_PROPERTY deserialization feature. However, it appears to only be observed through the complete(JsonParser p, DeserializationContext ctxt, Object bean) codepath, and is not examined in the complete(JsonParser p, DeserializationContext ctxt, PropertyValueBuffer buffer, PropertyBasedCreator creator) variant that gets used with, for example, @JsonCreator annoations.

It looks like adding the same check for prop.isRequired() || ctxt.isEnabled(DeserializationFeature.FAIL_ON_EXTERNAL_TYPE_ID_MISSING_PROPERTY)) immediately before calling ctxt.reportInputMismatch should allow the feature to work properly in this case?

Tested on jackson-databind 2.9.9

josephlbarnett added a commit to josephlbarnett/jackson-databind that referenced this issue Aug 5, 2019
…tor properties

The feature was only getting examined in the "normal" case, and
not when using creator properties

Fixes FasterXML#2404
@josephlbarnett
Copy link
Contributor Author

this may be the same issue reported in #1527, as we initially saw this working with kotlin classes. Attached PR fixes in our case and includes a test that demonstrates the issue with pure java classes.

josephlbarnett added a commit to josephlbarnett/jackson-databind that referenced this issue Aug 5, 2019
…tor properties

The feature was only getting examined in the "normal" case, and
not when using creator properties

Fixes FasterXML#2404
josephlbarnett added a commit to josephlbarnett/jackson-databind that referenced this issue Aug 5, 2019
…tor properties

The feature was only getting examined in the "normal" case, and
not when using creator properties

Fixes FasterXML#2404
@cowtowncoder
Copy link
Member

Looks legit: thank you for contribution!

Quick question: have I asked for (and received) CLA yet? If not, it's at:

https://github.com/FasterXML/jackson/blob/master/contributor-agreement.pdf

and the usual way is to print, fill & sign, scan, email to info at fasterxml dot com.
Once I get it I'll merge the PR and it will be part of eventual 2.9.10 (as well as 2.10.0.pr2).
And I hope it'll help a lot with Kotlin module.

@josephlbarnett
Copy link
Contributor Author

CLA emailed, thanks!

cowtowncoder pushed a commit that referenced this issue Aug 13, 2019
…tor properties (#2409)

The feature was only getting examined in the "normal" case, and
not when using creator properties

Fixes #2404
@cowtowncoder cowtowncoder modified the milestones: 2.9,0.pr4, 2.9.10 Aug 13, 2019
cowtowncoder added a commit that referenced this issue Aug 13, 2019
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

No branches or pull requests

2 participants