Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-1291

Python library missing strict JSON encode/decode

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 1.7.7
    • None
    • python
    • None
    • Hide
      This patch modifies DatumReader and DatumWriter to allow memory serialization/deserialization to plain format (already supported), strict JSON (json.dumps produces valid strict avro json), and linkedin Pegasus format (you can attach attach json.dumps(myobject) while making calls to rest.li servers)
      Show
      This patch modifies DatumReader and DatumWriter to allow memory serialization/deserialization to plain format (already supported), strict JSON (json.dumps produces valid strict avro json), and linkedin Pegasus format (you can attach attach json.dumps(myobject) while making calls to rest.li servers)

    Description

      The Python Avro libraries don't actually have a proper JSON decoder or encoder, because they don't handle the type-hinting for unions properly.

      The Python avro.io library should provide a pair of StrictJsonEncoder,StrictJsonDecoder} classes that correctly include (and decode) the type hints when the schema expects a union.

      Jonathan Coveney raised this concern on the Avro User mailing list.

      Attachments

        1. avro.diff
          11 kB
          Sergei Kuzmin

        Issue Links

          Activity

            People

              Unassigned Unassigned
              trochee Jeremy Kahn
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: