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

PHP json serializer skips maps with int/bool keys

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.9.2
    • 0.9.3
    • PHP - Compiler
    • 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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment