-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add DeserializationFeature.FAIL_ON_MISSING_EXTERNAL_TYPE_ID_PROPERTY
#1341
Conversation
This property controls the behavior of deserializing subtype properties that use the EXTERNAL_PROPERTY type id.
If this shouldn't be configurable with a DeserializationProperty, let me know and I will fix it so that it only throws the exception in case of a required property. |
Do you have a separate issue for PR to explain why this is needed, thinking behind needing the feature? |
The issue is that when the subtype property is missing, an exception is thrown. I had some legacy input to take that sometimes included the suptype property and sometimes didn't. I couldn't figure out any other way to fix the issue besides adding a feature, or simply not throwing the exception. Is there another way around this issue? Quick example: No issue with this {
"type": "orange",
"fruit": {
"name" : "Mandarin"
}
} Exception thrown, when 'fruit' property could just be null. {
"type": "orange"
} |
Ok, so this would be for cases where "type id" itself is specified, but no actual payload (data)? Thank you for explaining the intent. |
Before merging the patch, the only process thing we need is to get a filled Contributor License Agreement from: https://github.com/FasterXML/jackson/blob/master/contributor-agreement.pdf (unless I have asked for one before?) The usual method is to download, print, fill + sign & scan it, and email to Thank you for submitting this PR! |
I can change the feature name if needed. Any suggestions? |
Thanks, I can merge, consider the change. One problem wrt 2.8 is that I think the default must be I noticed the CLA, so I can proceed with merging soon, hopefully tomorrow. Thanks again! |
…nce we switch master to be 2.9.0-SNAPSHOT
DeserializationFeature.FAIL_ON_MISSING_EXTERNAL_TYPE_ID_PROPERTY
Renamed feature as |
This property controls the behavior of deserializing subtype properties
that use the EXTERNAL_PROPERTY type id.