Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-2894

PHP json serializer skips maps with int/bool keys

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.9.2
    • Fix Version/s: 0.9.3
    • Component/s: PHP - Compiler
    • Labels:
      None

      Description

      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:

      struct Foo {
        1: map<i32,string>;
      }

      This is unnecessarily strict, since PHP's json_encode() function will convert the keys to strings for you.

      Pull request coming.

        Attachments

          Activity

            People

            • Assignee:
              jensg Jens Geyer
              Reporter:
              stigsb Stig Bakken
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: