Upgrade Jackson from 2.9.10 to 2.16.2 #1
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why?
Issue:
As described in the linked issue, if another dependency has Jackson as a transitive dependency and causes it to be updated to >2.15 in a project, then the Intercom
HttpClient.readEntity
method breaks (it begins to throw Jackson DatabindUnrecognizedPropertyException
s at runtime).This PR attempts to upgrade the Jackson dependency of intercom-java & then fix the
ObjectMapper
as necessary.See also:
How?
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "type" (class io.intercom.api.TypedData), not marked as ignorable (0 known properties: ])
ObjectMapper
:ObjectMapper
configurations toMapperSupport
so that it will (once again, as in older versions of Jackson) ignore any uncrecognized properties.FAIL_ON_UNKNOWN_PROPERTIES
to falsecom.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class io.intercom.api.TypedData and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: io.intercom.api.User["companies"]
FAIL_ON_EMPTY_BEANS
to falsejava.lang.ClassCastException: io.intercom.api.TypedData cannot be cast to io.intercom.api.Segment
.It seems that something breaks the serialization of nested fields that are collections, such as
tags
andsegments
:should be: