You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Tim Sebastian (JIRA)" <ji...@apache.org> on 2015/10/07 21:43:26 UTC
[jira] [Comment Edited] (THRIFT-2994) Node.js TJSONProtocol cannot
be used for object serialization.
[ https://issues.apache.org/jira/browse/THRIFT-2994?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14947455#comment-14947455 ]
Tim Sebastian edited comment on THRIFT-2994 at 10/7/15 7:43 PM:
----------------------------------------------------------------
i rebased the patch based on the current master and in your linked diff (https://patch-diff.githubusercontent.com/raw/apache/thrift/pull/379.patch).
This change no longer exists (it did in the first version of my PR as the affected lines got inserted in a different merge: https://github.com/apache/thrift/commit/d8187c5ff1d8b83d170cbce69282688be39df19c).
However the current diff should no longer have this conflict!
was (Author: timse):
i rebased the patch based on the current master and in your linked diff (https://patch-diff.githubusercontent.com/raw/apache/thrift/pull/379.patch) this change no longer exists (it did in the first version but the affected lines got inserted in a different merge: https://github.com/apache/thrift/commit/d8187c5ff1d8b83d170cbce69282688be39df19c)
so this conflict does no longer apply
> Node.js TJSONProtocol cannot be used for object serialization.
> --------------------------------------------------------------
>
> Key: THRIFT-2994
> URL: https://issues.apache.org/jira/browse/THRIFT-2994
> Project: Thrift
> Issue Type: Bug
> Components: Node.js - Library
> Reporter: Jan Brauer
> Assignee: Randy Abernethy
>
> Consider the following code using the Thrift example types.
> {code:title=serialize.js|borderStyle=solid}
> var thrift = require('thrift');
> var test_types = require('gen-nodejs/ThriftTest_types.js');
> var bonk = new test_types.Bonk({message: "message", type: 6})
> var t_out = new thrift.TBufferedTransport();
> var p_out = new thrift.TJSONProtocol(t_out);
> bonk.write(p_out);
> var out
> t_out.flush(function (b) { out = b;});
> console.log(out)
> {code}
> My expectation would be for {{out}} to contain the serialized {{Bonk}} struct.
> But due to [TJSONProtocol|https://github.com/apache/thrift/blob/master/lib/nodejs/lib/thrift/protocol.js#L1287] only writing to the underlying transport in {{writeMessageEnd}} the above code does not work.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)