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

Do you really need gson? #307

Closed
ptahchiev opened this issue Aug 30, 2016 · 5 comments
Closed

Do you really need gson? #307

ptahchiev opened this issue Aug 30, 2016 · 5 comments
Labels

Comments

@ptahchiev
Copy link

ptahchiev commented Aug 30, 2016

Hello I'm building a spring-boot application and I have more than 400 dependencies. Out of those 400 dependencies only stripe is depending on gson and spring-boot is smart enough to detect if you have a jackson dependency or gson dependency to detect which class to use so it actually works with both. I know it's shit there's no native json parser in Java and there might be one in Java 9 but until that happens do you think you might be able to support both jackson and gson and use it as compile-time dependency only?

@brandur
Copy link
Contributor

brandur commented Aug 30, 2016

Hi Petar,

Taking a look at this, unfortunately it seems that GSON's entrenched itself a little bit in the library. A project to add support for multiple dependencies might be laudable, but to be honest, would probably not rank favorably compared to anything else we're working on right now.

I'd certainly be interested in getting us over to a standard library JSON package if one ever appeared though!

@marctrem
Copy link

@ptahchiev Would shading the gson dependency here solve your issue? If Spring looks for those classes by by fully qualified name, it's not going to notice gson from here if it's shaded.

Just to make sure, is your issue that:

  • another dependency is loaded
  • Spring detects gson provided by the Stripe library

Thanks!

@ptahchiev
Copy link
Author

My problem is that i'm trying to keep my project as small as possible. Currently I'm using jackson for JSON serialization/deserialization, but now i have two dependencies - gson and jackson.
What spring boot are doing is they are implementation agnostic - and i was wondering if it would be possible to use your API with jackson as well, and not dragging the gson dependency always.

@ob-stripe
Copy link
Contributor

Closing this issue due to age and the fact that we're unlikely to get rid of Gson anytime soon.

@dcr-stripe
Copy link
Contributor

Sorry for the bump on an old issue - just tagging this against our new top-level feature request for supporting Jackson.

#1344

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants