You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by je...@apache.org on 2014/12/10 21:08:37 UTC
thrift git commit: THRIFT-2884 Map does not serialize correctly for
JSON protocol in Go library Client: Go Patch: Liangliang He
Repository: thrift
Updated Branches:
refs/heads/master 119869a20 -> 0a378709a
THRIFT-2884 Map does not serialize correctly for JSON protocol in Go library
Client: Go
Patch: Liangliang He <ll...@gmail.com>
This closes #312
Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/0a378709
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/0a378709
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/0a378709
Branch: refs/heads/master
Commit: 0a378709ab8b3b0de4bafde60a803da24096e8bd
Parents: 119869a
Author: Jens Geyer <je...@apache.org>
Authored: Wed Dec 10 21:04:28 2014 +0100
Committer: Jens Geyer <je...@apache.org>
Committed: Wed Dec 10 21:04:28 2014 +0100
----------------------------------------------------------------------
lib/go/thrift/json_protocol.go | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/thrift/blob/0a378709/lib/go/thrift/json_protocol.go
----------------------------------------------------------------------
diff --git a/lib/go/thrift/json_protocol.go b/lib/go/thrift/json_protocol.go
index 78348ec..bd89cb0 100644
--- a/lib/go/thrift/json_protocol.go
+++ b/lib/go/thrift/json_protocol.go
@@ -134,10 +134,16 @@ func (p *TJSONProtocol) WriteMapBegin(keyType TType, valueType TType, size int)
if e := p.WriteString(s); e != nil {
return e
}
- return p.WriteI64(int64(size))
+ if e := p.WriteI64(int64(size)); e != nil {
+ return e
+ }
+ return p.OutputObjectBegin()
}
func (p *TJSONProtocol) WriteMapEnd() error {
+ if e := p.OutputObjectEnd(); e != nil {
+ return e
+ }
return p.OutputListEnd()
}