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

lib/java TSimpleJSONProtocol can emit invalid JSON

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.9.2
    • None
    • None
    • Patch Available

    Description

      TSimpleJSONProtocol can emit JSON with maps whose keys are not string (which is not allowed is the JSON spec).

      This happens if the key in a map is anything other than a String (int, enum, etc)

      For example, it can emit JSON like this:

      {"myMap":{5:"myValue"}}
      

      which should be:

      {"myMap":{"5":"myValue"}}
      

      I have a path that fixes this, I'll upload it shortly (still trying to get my dev environment to run the tests).

      Also AFAICT there is no unit test for TSimpleJSONProtocol – I'll try and add one to the patch.

      Thanks!
      Alex

      Attachments

        Activity

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

          People

            alexlevenson Alex Levenson
            alexlevenson Alex Levenson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment