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

Help Jackson with Guava Deserializers #6899

Closed
4 tasks done
paulmarcelinbejan opened this issue Jan 2, 2024 · 4 comments
Closed
4 tasks done

Help Jackson with Guava Deserializers #6899

paulmarcelinbejan opened this issue Jan 2, 2024 · 4 comments

Comments

@paulmarcelinbejan
Copy link

1. What are you trying to do?

It is not possible to read an object with a Table as a field from Kafka since behind the scenes, spring framework uses Jackson to deserialize objects, and at the moment there are a lot of Guava Data Types that are not handled by Jackson

https://github.com/FasterXML/jackson-datatypes-collections/blob/2.17/guava/src/main/java/com/fasterxml/jackson/datatype/guava/GuavaDeserializers.java

2. What's the best code you can write to accomplish that without the new feature?

I have switched from Guava Table to Map<C, Map<R, V>>

3. What would that same code look like if we added your feature?

probably something like:

public HashBasedTable(Map<R, Map<C, V>> table);

(Optional) What would the method signatures for your feature look like?

No response

Concrete Use Cases

I need to deserialize an object that has a Table as a field.
The serialization is already implemented.

Packages

com.google.common.collect

Checklist

@paulmarcelinbejan paulmarcelinbejan added the type=addition A new feature label Jan 2, 2024
@Stephan202
Copy link
Contributor

This issue looks a lot like #6893. Is there anything that blocks Jackson from implementing the missing deserialization support?

(Related Jackson ticket: FasterXML/jackson-datatypes-collections#1. CC @cowtowncoder.)

@netdpb
Copy link
Member

netdpb commented Jan 2, 2024

It does seem to me that the proper path forward is for Jackson to implement a deserializer for Guava's ImmutableTable rather than to introduce a public constructor.

@cowtowncoder
Copy link

Agreed: I don't think there is anything Guava should need to add (besides, any new addition would be for latest Guava and Jackson module is designed to work with a wide range of Guava versions so cannot rely on latest).
Someone just needs to take time to write a Jackson JsonDeserializer for Table type.

@netdpb
Copy link
Member

netdpb commented Jan 2, 2024

OK, thanks for confirming. I'll go ahead and close this issue then.

And thank you, @paulmarcelinbejan, for thinking about ways to make the experience of using Guava easier!

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

No branches or pull requests

5 participants