Re: Change rest-http Java to JSON null transformation logic

2016-06-16 Thread Alexey Kuznetsov
Den, that was my main reason "consistency". Strings in java can be "null" and can be empty. But after serialization we lost this info. As for compatibility - I'm afraid it is impossible to fix. Only to change user code. On Thu, Jun 16, 2016 at 4:51 PM, Denis Magda wrote: > This looks strange. De

Re: Change rest-http Java to JSON null transformation logic

2016-06-16 Thread Pavel Tupitsyn
Alexey, got it regarding "null" string, thank you. Can you elaborate on non-null default values? Is it only for primitive types, or something else? Anyway, can we omit fields with default values? I have seen some serializers that work this way. Pavel. On Thu, Jun 16, 2016 at 1:05 PM, Alexey Kuzn

Re: Change rest-http Java to JSON null transformation logic

2016-06-16 Thread Alexey Kuznetsov
Pavel, we cannot omit them. Because if JSON will be transformed back to Java and some java field has not null default value that will lead to not correct de-serialization in this case. On Thu, Jun 16, 2016 at 4:54 PM, Pavel Tupitsyn wrote: > Why do we even write null fields? Can we just omit th

Re: Change rest-http Java to JSON null transformation logic

2016-06-16 Thread Alexey Kuznetsov
Pavel, in this case object will be serialized like : {"a": "null"} compare with {"a": null} On Thu, Jun 16, 2016 at 4:49 PM, Pavel Tupitsyn wrote: > Hi, > > What if there is an actual string with "null" value? > > Pavel. > > On Thu, Jun 16, 2016 at 12:44 PM, Vladislav Pyatkov > wrote: > >> Hell

Re: Change rest-http Java to JSON null transformation logic

2016-06-16 Thread Alexey Kuznetsov
Vlad, Actually I implemented 2 custom serializers: one for null strings and another for null objects. But I think that it looks like a "workaround" for me. On Thu, Jun 16, 2016 at 4:44 PM, Vladislav Pyatkov wrote: > Hello, > > Why do you want this, if you can save full compatibility using custo

Re: Change rest-http Java to JSON null transformation logic

2016-06-16 Thread Pavel Tupitsyn
Why do we even write null fields? Can we just omit them? This will be faster, more compact, and less ambiguous. Pavel. On Thu, Jun 16, 2016 at 12:51 PM, Denis Magda wrote: > This looks strange. Definitely for consistency reasons it makes sense that > all ‘null’ objects including string are seri

Re: Change rest-http Java to JSON null transformation logic

2016-06-16 Thread Denis Magda
This looks strange. Definitely for consistency reasons it makes sense that all ‘null’ objects including string are serialized as “null”. In regards to the compatibility stuff I think it can be resolved somehow. — Denis > On Jun 16, 2016, at 12:15 PM, Alexey Kuznetsov > wrote: > > Hi All! >

Re: Change rest-http Java to JSON null transformation logic

2016-06-16 Thread Pavel Tupitsyn
Hi, What if there is an actual string with "null" value? Pavel. On Thu, Jun 16, 2016 at 12:44 PM, Vladislav Pyatkov wrote: > Hello, > > Why do you want this, if you can save full compatibility using custom > serializer for null value (ObjectMapper#setSerializerProvider)? > > On Thu, Jun 16, 20

Re: Change rest-http Java to JSON null transformation logic

2016-06-16 Thread Vladislav Pyatkov
Hello, Why do you want this, if you can save full compatibility using custom serializer for null value (ObjectMapper#setSerializerProvider)? On Thu, Jun 16, 2016 at 12:15 PM, Alexey Kuznetsov wrote: > Hi All! > > I'm working on migrating from outdated json-lib to Jackson issue > IGNITE-3277 [1]

Change rest-http Java to JSON null transformation logic

2016-06-16 Thread Alexey Kuznetsov
Hi All! I'm working on migrating from outdated json-lib to Jackson issue IGNITE-3277 [1] and found that previous library serialize null strings as "" and null objects as "null", for example: {"a": "", "b": null} How about to serialize all values as "null" ? In this case we would definitely know t