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

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

GitHub user bananer opened a pull request:

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

    THRIFT-4436: port nodejs changes from THRIFT-3748 to js lib (rebased)

    test for serialization of nested list,
    run all tests when building js lib

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

    $ git pull https://github.com/bananer/thrift THRIFT-4436-pr2

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

    https://github.com/apache/thrift/pull/1457.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 #1457
    
----
commit f398f57bf2caa052c4e451c1a4e5800317ba8cf4
Author: Philip Frank <ich@...>
Date:   2018-01-02T08:00:36Z

    THRIFT-4436: port nodejs changes from THRIFT-3748 to js lib,
    test for serialization of nested list,
    run all tests when building js lib

----


> Deserialization of nested list discards content
> -----------------------------------------------
>
>                 Key: THRIFT-4436
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4436
>             Project: Thrift
>          Issue Type: Bug
>          Components: JavaScript - Library
>    Affects Versions: 0.10.0, 0.11.0
>            Reporter: Philip Frank
>
> I'm trying to transmit a list of lists, like this:
> {code}
> service HelloSvc {
>   list<list<string>> test()
> }
> {code}
> Using XHR Transport and JSON Protocol, with a service implementation in 
> Python like this:
> {code}
> class HelloSvcHandler:
>     def __init__(self):
>         pass
>     def test(self,):
>         return [
>             ["s1", "s2"],
>             ["s3", "s4"],
>             ["s5"]
>         ]
> {code}
> The serialized response looks good to me (seen in browser development tools):
> {code}
> [1,"test",2,0,{"0":{"lst":["lst",3,["str",2,"s1","s2"],["str",2,"s3","s4"],["str",1,"s5"]]}}]
> {code}
> However, when deserialized to JavaScript, the result looks like this:
> {code}
> [["s1","s2"],[],[]]
> {code}
> I would expect it to look like this:
> {code}
> [["s1","s2"],["s3","s4"],["s5"]]
> {code}
> It looks to me like during JSON deserialization, all but the first entry in 
> the list of lists lose their content.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to