stripe-java icon indicating copy to clipboard operation
stripe-java copied to clipboard

Implicit Gson library dependency should be removed

Open solatarius opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe.

The EventData class which is defined in the Event object has a member object of type JsonObject which is a type defined by the com.google.gson library.

When I try to deserialize stored json into an Event object using a com.fasterxml.jackson ObjectMapper, errors are thrown because the object jsonString contains fields not explicitly defined by the JsonObject.

https://github.com/stripe/stripe-java/blob/master/src/main/java/com/stripe/model/EventData.java#L28

Describe the solution you'd like

The object field of the EventData class should be of type Map<String, Object> or something similar... and anywhere else in the models where JsonObject is used, it should be replaced with the same solution

Describe alternatives you've considered

No response

Additional context

No response

solatarius avatar Apr 21 '22 04:04 solatarius

Hi @solatarius , thanks for the report!

We generally would like to support Jackson more generally. I've split out https://github.com/stripe/stripe-java/issues/1344 to track this as a top-level feature request.

dcr-stripe avatar Apr 21 '22 15:04 dcr-stripe

maybe it's better to move to standard Java Json Binding (JSR 367)

https://javaee.github.io/jsonb-spec/

pizzi80 avatar May 27 '22 10:05 pizzi80