You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Raj G (Jira)" <ji...@apache.org> on 2020/11/02 21:06:00 UTC
[jira] [Updated] (AVRO-2953) Issue with deserialization when an
avro schema is composed of another schema as an optional field
[ https://issues.apache.org/jira/browse/AVRO-2953?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Raj G updated AVRO-2953:
------------------------
Summary: Issue with deserialization when an avro schema is composed of another schema as an optional field (was: Issue with deserialization when a schema composition of another object as an optional field )
> Issue with deserialization when an avro schema is composed of another schema as an optional field
> -------------------------------------------------------------------------------------------------
>
> Key: AVRO-2953
> URL: https://issues.apache.org/jira/browse/AVRO-2953
> Project: Apache Avro
> Issue Type: Bug
> Affects Versions: 1.9.1
> Reporter: Raj G
> Priority: Major
>
> we have defined an avro schema and using code generators to generate .java files in Java and .cs files C#.
> Here is the code generator we have been using to generate java classes out of the avro schema
> [https://plugins.gradle.org/plugin/com.commercehub.gradle.plugin.avro]
>
> and using AvroConverter.exe (from Confluen) to generate .cs files from .avsc file
> Now, when I'm trying to use publish a message onto Kafka using a c# producer and trying to consume it using a java consumer. This is working for most of the data type except the below contract "OptionalComposition".
> The deserialization is failing only for an optional field ( another schema)
>
> {code:java}
> {
> "type": "record",
> "name": "OptionalComposition",
> "doc": "Contract to test composition with optional field ",
> "namespace": "com.abc.avro.contracts",
> "fields": [
> { "name": "partOf", "type": ["null", "com.abc.avro.contracts.Reference"], "default": null }
> ]
> }
> {code}
>
>
> {code:java}
> {
> "type": "record",
> "name": "Reference",
> "namespace": "com.abc.avro.contracts",
> "fields": [
> { "name": "identifier", "type": "string" }
> ,
> { "name": "name", "type": "string" }
> ]
> }
> {code}
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)