[ 
https://issues.apache.org/jira/browse/THRIFT-3302?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14708311#comment-14708311
 ] 

ASF GitHub Bot commented on THRIFT-3302:
----------------------------------------

GitHub user nsuke opened a pull request:

    https://github.com/apache/thrift/pull/591

    THRIFT-3302 Go JSON protocol should encode Thrift byte type as signed…

    … integer string

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/nsuke/thrift THRIFT-3302

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/thrift/pull/591.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #591
    
----
commit 3d8f4ce9de6dec201e115af3dabf8d9f7402371e
Author: Nobuaki Sukegawa <nsu...@gmail.com>
Date:   2015-08-23T03:34:31Z

    THRIFT-3302 Go JSON protocol should encode Thrift byte type as signed 
integer string

----


> Go JSON protocol should encode Thrift byte type as signed integer string
> ------------------------------------------------------------------------
>
>                 Key: THRIFT-3302
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3302
>             Project: Thrift
>          Issue Type: Bug
>          Components: Go - Library
>            Reporter: Nobuaki Sukegawa
>            Assignee: Nobuaki Sukegawa
>
> h3. Problem
> Go implementation of JSON and simple JSON protocols encode Thrift byte type 
> field as unsigned 8bit integer.
> i.e. -1 is encoded to "255" by Go implementation while "-1" by others like 
> C++, Java and Python.
> h3. Reproduce
> Cross test with go server and py client (JSON protocols of course).
> (like "expected -127 but got 129")
> Static-typed clients (such as C++ and Java) are not likely to notice the 
> difference because of integer overflow.
> h3. Fix
> Explicitly convert the unsigned 8-bit value back to signed one in JSON 
> protocols before converting to text.



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

Reply via email to