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

refactor: Global Jackson configuration #521

Merged
merged 10 commits into from
Apr 9, 2024
Merged

refactor: Global Jackson configuration #521

merged 10 commits into from
Apr 9, 2024

Conversation

SMadani
Copy link
Contributor

@SMadani SMadani commented Apr 9, 2024

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 the Jsonable interface (and later, JsonableBaseObject class) that all domain classes now implement, there is a convenient way to do this using the Jsonable#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.

@codecov-commenter
Copy link

codecov-commenter commented Apr 9, 2024

Codecov Report

Merging #521 (d67fa1e) into main (5f6687d) will increase coverage by 0.03%.
The diff coverage is 96.15%.

❗ Current head d67fa1e differs from pull request most recent head 2ec1405. Consider uploading reports for the commit 2ec1405 to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #521      +/-   ##
============================================
+ Coverage     95.50%   95.54%   +0.03%     
+ Complexity     3348     3339       -9     
============================================
  Files           502      501       -1     
  Lines          7972     7941      -31     
  Branches        440      433       -7     
============================================
- Hits           7614     7587      -27     
+ Misses          204      200       -4     
  Partials        154      154              
Files Coverage Δ
src/main/java/com/vonage/client/HttpWrapper.java 100.00% <ø> (ø)
src/main/java/com/vonage/client/Jsonable.java 93.33% <100.00%> (+2.02%) ⬆️
...ain/java/com/vonage/client/JsonableBaseObject.java 100.00% <100.00%> (ø)
.../com/vonage/client/VonageApiResponseException.java 67.39% <100.00%> (ø)
...onage/client/account/AccountResponseException.java 100.00% <ø> (ø)
...ava/com/vonage/client/account/BalanceResponse.java 100.00% <ø> (ø)
...c/main/java/com/vonage/client/account/Country.java 100.00% <ø> (ø)
...com/vonage/client/account/FullPricingResponse.java 100.00% <ø> (ø)
...com/vonage/client/account/ListSecretsResponse.java 33.33% <ø> (-16.67%) ⬇️
...c/main/java/com/vonage/client/account/Network.java 100.00% <ø> (ø)
... and 280 more

@SMadani SMadani merged commit 6504a1c into main Apr 9, 2024
15 checks passed
@SMadani SMadani deleted the v8.5 branch April 9, 2024 16:54
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.

None yet

2 participants