refactor: Global Jackson configuration #521
Merged
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.
All classes in the SDK which model JSON objects use the annotations
@JsonIgnoreProperties(ignoreUnknown = true)
and@JsonInclude(value = JsonInclude.Include.NON_NULL)
. This adds needless overhead to creating new classes and nested classes, since they may be easily forgotten. It also makes classes less readable. Since this is the default policy applied across the SDK, it makes sense to configure this at the top level to avoid this repetition. The major refactoring that has occurred since v7.7.0, with the introduction of theJsonable
interface (and later,JsonableBaseObject
class) that all domain classes now implement, there is a convenient way to do this using theJsonable#createDefaultObjectMapper()
method. For the rare cases where default configuration needs to be overriden,JsonableBaseObject#createJsonObjectMapper()
has been added.This PR also removes the unused and deprecated
com.vonage.client.sms.HexUtil
class as it is not part of the public API.