You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Aki Sukegawa (JIRA)" <ji...@apache.org> on 2016/02/05 13:05:41 UTC

[jira] [Resolved] (THRIFT-3232) Cannot deserialize json messages created with

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

Aki Sukegawa resolved THRIFT-3232.
----------------------------------
    Resolution: Won't Fix

It is intended behavior.

Quote from THRIFT-2535

{quote}
 you would not be able to deserialize if this was enabled,
{quote}


> Cannot deserialize json messages created with 
> ----------------------------------------------
>
>                 Key: THRIFT-3232
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3232
>             Project: Thrift
>          Issue Type: Bug
>          Components: Java - Library
>    Affects Versions: 0.9.2
>            Reporter: Jelmer Kuperus
>
> THRIFT-2535 introduced the fieldNamesAsString argument on TJSONProtocol.Factory
> When you use it to serialize messages to json , the resulting output cannot be deserialized back to an object when using the same protocolfactory
> Example :
> {noformat}
> TJSONProtocol.Factory factory = new TJSONProtocol.Factory(true);
> TSerializer tSerializer = new TSerializer(factory);
> foo foo1 = new Foo();
> String value = tSerializer.toString(foo1, "utf-8");
> TDeserializer tDeserializer = new TDeserializer(factory);
> foo foo2 = new foo();
> tDeserializer.fromString(foo2, value);
> {noformat}
> Will give you Exception in thread "main" org.apache.thrift.protocol.TProtocolException: Unexpected character:



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)