You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Artur Kalimullin (Jira)" <ji...@apache.org> on 2021/04/29 14:39:00 UTC
[jira] [Comment Edited] (AVRO-3124) Java: toString serializer
produces incorrect JSON fields for Temporal logical types
[ https://issues.apache.org/jira/browse/AVRO-3124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17335527#comment-17335527 ]
Artur Kalimullin edited comment on AVRO-3124 at 4/29/21, 2:38 PM:
------------------------------------------------------------------
Ok, I got it now. Our QAs used the toString() implementation to parse the data (for pretty-priting purposes only)
I think it worth breaking the toString() to return a non-JSON compliant object or maybe use the JsonEncoder internally to make the transformation. Maybe leave the possibility to produce the json-ish string using an additional method like `toPrettyString()` so users would know that this is not the JSON they are looking for :)
was (Author: kaliy):
Ok, I got it now. Our QAs used the toString() implementation to parse the data.
I think it worth breaking the toString() to return a non-JSON compliant object or maybe use the JsonEncoder internally to make the transformation. Maybe leave the possibility to produce the json-ish string using an additional method like `toPrettyString()` so users would know that this is not the JSON they are looking for :)
> Java: toString serializer produces incorrect JSON fields for Temporal logical types
> -----------------------------------------------------------------------------------
>
> Key: AVRO-3124
> URL: https://issues.apache.org/jira/browse/AVRO-3124
> Project: Apache Avro
> Issue Type: Bug
> Components: java
> Reporter: Artur Kalimullin
> Assignee: Artur Kalimullin
> Priority: Major
>
> When the java class has been generated using one of the Temporal logical types and then converted to JSON using toString(), the output field does is not a proper string:
>
> {code:java}
> "operationTime": 2021-04-29T04:01:57.465Z
> {code}
> This is an ISO-8601 compliant string, so it should be treated as a string:
>
> {code:java}
> "operationTime": "2021-04-29T04:01:57.465Z"
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)