I generated a java object from the following thrift object:
struct Account {
1: required string accountType,
2: bool accountActive,
}
The SimpleJSONProtocol
was never intended to be deserializable. Use TJSONProtocol
instead.
From http://wiki.apache.org/thrift/ThriftUsageJava:
Serializing to "Simple" JSON
TSerializer serializer = new TSerializer(new TSimpleJSONProtocol.Factory()); String json = serializer.toString(work);
The "Simple" JSON protocol produces output suitable for AJAX or scripting languages. It does not preserve Thrift's field tags and cannot be read back in by Thrift.
(emphasis mine)