[ 
https://issues.apache.org/jira/browse/GOSSIP-61?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Edward Capriolo updated GOSSIP-61:
----------------------------------
    Description: 
I noticed there was a problem with the way we are using Jackson to serialize 
some things.

See here:
https://github.com/apache/incubator-gossip/pull/36/files#diff-936a81be82f0bea048f1ca091413d8fa

First, an Integer it magically becomes a long! 

Second, if a key to a map is an integer it will become a string! This is 
because numbers are not keys in json.

Third any type that implements Set will automatically be serialized like an 
Array/Set.  I do not see how to override this specifically.

As a work around I made all the tests send strings. I also removed the set 
interface from OrSet and GrowOnlySet so that I can control the serialization.

If we can understand this:
https://github.com/FasterXML/jackson-datatype-guava/blob/master/src/main/java/com/fasterxml/jackson/datatype/guava/ser/MultimapSerializer.java

I think we have a better chance of getting the types to serialize/serialize 
correctly.

  was:


I noticed there was a problem with the way we are using Jackson to serialize 
some things.

See here:
https://github.com/apache/incubator-gossip/pull/36/files#diff-936a81be82f0bea048f1ca091413d8fa

First, an Integer it magically becomes a long! 

Second, if a key to a map is an integer it will become a string! This is 
because numbers are not keys in json.

Third any type that implements Set will automatically be serialized like an 
Array/Set.  

As a work around I made all the tests send strings. I also removed the set 
interface from OrSet and GrowOnlySet so that I can control the serialization.

If we can understand this:
https://github.com/FasterXML/jackson-datatype-guava/blob/master/src/main/java/com/fasterxml/jackson/datatype/guava/ser/MultimapSerializer.java

I think we have a better chance of getting the types to serialize/serialize 
correctly.


> Make a proper Jackson module
> ----------------------------
>
>                 Key: GOSSIP-61
>                 URL: https://issues.apache.org/jira/browse/GOSSIP-61
>             Project: Gossip
>          Issue Type: Bug
>            Reporter: Edward Capriolo
>
> I noticed there was a problem with the way we are using Jackson to serialize 
> some things.
> See here:
> https://github.com/apache/incubator-gossip/pull/36/files#diff-936a81be82f0bea048f1ca091413d8fa
> First, an Integer it magically becomes a long! 
> Second, if a key to a map is an integer it will become a string! This is 
> because numbers are not keys in json.
> Third any type that implements Set will automatically be serialized like an 
> Array/Set.  I do not see how to override this specifically.
> As a work around I made all the tests send strings. I also removed the set 
> interface from OrSet and GrowOnlySet so that I can control the serialization.
> If we can understand this:
> https://github.com/FasterXML/jackson-datatype-guava/blob/master/src/main/java/com/fasterxml/jackson/datatype/guava/ser/MultimapSerializer.java
> I think we have a better chance of getting the types to serialize/serialize 
> correctly.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to