[ 
https://issues.apache.org/jira/browse/AVRO-1291?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14270215#comment-14270215
 ] 

Sergei Kuzmin commented on AVRO-1291:
-------------------------------------

Argument passed defines how the object persist in memory. With default 
HINTS_NONE this is current behavior (no Type hinting).
With HINTS_ALL this is strict JSON hinting. I.e. you can do 
json.dumps(my_avro_object) and get correct JSON Avro Serialization (no extra 
JSONDecoder/Encoder required)
With HINTS_PEGASUS you get Linkedin Pegasus representation of the object. You 
can use this for example to deserialize object from avro file and then make a 
REST.li call:
requests.put(RESTLI_SERVER_URL, json.dumps(my_avro_object))

> Python library missing strict JSON encode/decoe
> -----------------------------------------------
>
>                 Key: AVRO-1291
>                 URL: https://issues.apache.org/jira/browse/AVRO-1291
>             Project: Avro
>          Issue Type: Bug
>          Components: python
>    Affects Versions: 1.7.7
>            Reporter: Jeremy Kahn
>         Attachments: avro.diff
>
>
> The Python Avro libraries don't actually have a proper JSON decoder or 
> encoder, because they don't handle the [type-hinting for 
> unions|http://avro.apache.org/docs/current/spec.html#json_encoding] 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|http://mail-archives.apache.org/mod_mbox/avro-user/201304.mbox/%3CCAKne9Z6nkYXwb4QzPr4qNyH1o7TnL1674MspgnHuKMuD2imguQ%40mail.gmail.com%3E]
>  on the Avro User mailing list.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to