question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for using Jackson instead of Gson

See original GitHub issue

Currently the ApnsPayloadBuilder uses Gson to create the content for the payload.

Is it possible to make the creation of payload pluggable via some kind of interface, or extract a base builder that would have common methods for the locations where the conversion to JSON is needed?

The reason why I am asking for this is due to the fact that I would like to try and use one JSON parsing library within our project and currently we use Jackson a lot.

I am also prepared to work on this if you are interested and would accept such a PR.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
filiphrcommented, Mar 4, 2019

Please excuse the long delay in getting back to this.

No problem.

Respectfully, if we still have Gson as a dependency, why does it matter if we’re using Gson or Jackson to generate the payload? Is the idea that you’d then add an exclude clause for Gson if you really, really didn’t want it?

Yes the idea was that you can explicitly exclude Gson if you don’t need it. However, it depends on the approach you’ll like to take.

Here are some options that I have in mind:

  • Do not to include any library and have a manual way of crafting the payload in case none are present
  • Request from users to include a library
  • Add 2 new artifacts that would either include Gson or Jackson as a dependency. If you want full backwards compatibility you can just add a Jacskon one that would exclude Gson and add Jackson
0reactions
jchamberscommented, May 6, 2020

This is covered by #776.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jackson vs Gson - Baeldung
Both Gson and Jackson are good options for serializing/deserializing JSON data, simple to use and well documented. Advantages of Gson:.
Read more >
Jackson Vs. Gson - java - Stack Overflow
Jackson and Gson are the most complete Java JSON packages regarding actual data binding support; many other packages only provide primitive ...
Read more >
Configuring Spring Boot to use Gson instead of Jackson
Spring Boot uses Jackson by default for serializing and deserializing request and response objects in your REST APIs. If you want to use ......
Read more >
Jackson Vs Gson - Javatpoint
Jackson and Gson both are the libraries/APIs. Both the libraries work with JSON data. These are also used to serialize and deserialize the...
Read more >
Jackson vs Gson: A Deep Dive - Examples Java Code Geeks
The Jackson ObjectMapper by default serializes the Date object as a long epoch value. Contrarily, Gson by default serializes Date as a string....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found