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

PHP: add "json" option to create JsonSerializable code

    XMLWordPrintableJSON

    Details

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

      Description

      This patch adds a "json" option to PHP code generation that will make generated classes implement JsonSerializable, so thrift objects may be converted to json using json_encode() easily. If the "validate" option is enabled, the object's write validator will be called, beyond that the jsonSerialize() method only outputs non-null fields in the JSON object (JSON parsers get grumpy if you send them null where they expect to see a number).

        Attachments

          Activity

            People

            • Assignee:
              roger Roger Meier
              Reporter:
              stigsb Stig Bakken
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: