[
https://issues.apache.org/jira/browse/THRIFT-2894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14251315#comment-14251315
]
ASF GitHub Bot commented on THRIFT-2894:
----------------------------------------
GitHub user stigsb opened a pull request:
https://github.com/apache/thrift/pull/331
PHP generator: in jsonSerialize, only skip maps with non-scalar keys
Previously skipped maps with enum or non-base-type keys. This fixes the
original patch in THRIFT-2894.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/stigsb/thrift THRIFT-2894
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/thrift/pull/331.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 #331
----
commit 9b80e8c3c43428497ffa4274e6b427343aeb855c
Author: Stig Bakken <[email protected]>
Date: 2014-12-12T11:49:47Z
PHP generator: in jsonSerialize, only skip maps with non-scalar keys
(previously skipped maps with non-string keys)
----
> PHP json serializer skips maps with int/bool keys
> -------------------------------------------------
>
> Key: THRIFT-2894
> URL: https://issues.apache.org/jira/browse/THRIFT-2894
> Project: Thrift
> Issue Type: Bug
> Components: PHP - Compiler
> Affects Versions: 0.9.2
> Reporter: Stig Bakken
> Assignee: Jens Geyer
> Priority: Minor
> Fix For: 0.9.3
>
>
> When the PHP generator runs with the "json" option, it skips fields that are
> maps with non-string keys. An instance of this struct will produce an empty
> object when JSON-serialized:
> {code}struct Foo {
> 1: map<i32,string>;
> }{code}
> This is unnecessarily strict, since PHP's json_encode() function will convert
> the keys to strings for you.
> Pull request coming.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)