[
https://issues.apache.org/jira/browse/AVRO-3090?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
José Magalhães updated AVRO-3090:
---------------------------------
Description:
This issue is causing producers not to find the schemas when serializing
messages.
How to reproduce:
1. Create a MyRecord.avsc file:
{code:java}
{
"type": "record",
"name": "MyRecord",
"namespace": "my.namespace",
"doc": "my documentation",
"fields": [
{
"name": "field1",
"type": "int"
},
{
"name": "field2",
"type": "string",
"order": "ascending",
"aliases": [ "field3" ]
}]
}
{code}
2. Run avrogen to generate the C# class:
{code:java}
avrogen -s MyRecord.avsc .{code}
3. Check the output:
{code:java}
/// <summary>
/// my documentation
/// </summary>
public partial class MyRecord : ISpecificRecord
{
public static Schema _SCHEMA =
Avro.Schema.Parse("{\"type\":\"record\",\"name\":\"MyRecord\",\"namespace\":\"my.namespace\",\"fields\":[{\"name\":\""
+
"field1\",\"type\":\"int\"},{\"name\":\"field2\",\"type\":\"string\",\"aliases\":[\"field3\"]}]}");
{code}
The generated schema does not include the "doc" and "order" data as it would be
expected, which makes it very different from the schema the class was generated
from.
Serializers that do not allow the automatic registration of schemas will never
be able to find the schema and will always throw the "schema not found" error.
was:
This issue is causing producers not to find the schemas when serializing
messages.
How to reproduce:
1. Create a MyRecord.avsc file:
{code:java}
{
"type": "record",
"name": "MyRecord",
"namespace": "my.namespace",
"doc": "my documentation",
"fields": [
{
"name": "field1",
"type": "int"
},
{
"name": "field2",
"type": {
"type": "string",
"order": "ascending"
},
"aliases": [ "field3" ]
}]
}
{code}
2. Run avrogen to generate the C# class:
{code:java}
avrogen -s MyRecord.avsc .{code}
3. Check the output:
{code:java}
/// <summary>
/// my documentation
/// </summary>
public partial class MyRecord : ISpecificRecord
{
public static Schema _SCHEMA =
Avro.Schema.Parse("{\"type\":\"record\",\"name\":\"MyRecord\",\"namespace\":\"my.namespace\",\"fields\":[{\"name\":\""
+
"field1\",\"type\":\"int\"},{\"name\":\"field2\",\"type\":\"string\",\"aliases\":[\"field3\"]}]}");
{code}
The generated schema does not include the "doc" and "order" data as it would be
expected, which makes it very different from the schema the class was generated
from.
Serializers that do not allow the automatic registration of schemas will never
be able to find the schema and will always throw the "schema not found" error.
> C# AvroGen - Generated _SCHEMA field not including "doc" and "order"
> --------------------------------------------------------------------
>
> Key: AVRO-3090
> URL: https://issues.apache.org/jira/browse/AVRO-3090
> Project: Apache Avro
> Issue Type: Bug
> Components: csharp
> Affects Versions: 1.10.2
> Reporter: José Magalhães
> Priority: Critical
>
> This issue is causing producers not to find the schemas when serializing
> messages.
> How to reproduce:
> 1. Create a MyRecord.avsc file:
> {code:java}
> {
> "type": "record",
> "name": "MyRecord",
> "namespace": "my.namespace",
> "doc": "my documentation",
> "fields": [
> {
> "name": "field1",
> "type": "int"
> },
> {
> "name": "field2",
> "type": "string",
> "order": "ascending",
> "aliases": [ "field3" ]
> }]
> }
> {code}
>
> 2. Run avrogen to generate the C# class:
> {code:java}
> avrogen -s MyRecord.avsc .{code}
>
> 3. Check the output:
> {code:java}
> /// <summary>
> /// my documentation
> /// </summary>
> public partial class MyRecord : ISpecificRecord
> {
> public static Schema _SCHEMA =
> Avro.Schema.Parse("{\"type\":\"record\",\"name\":\"MyRecord\",\"namespace\":\"my.namespace\",\"fields\":[{\"name\":\""
> +
> "field1\",\"type\":\"int\"},{\"name\":\"field2\",\"type\":\"string\",\"aliases\":[\"field3\"]}]}");
> {code}
> The generated schema does not include the "doc" and "order" data as it would
> be expected, which makes it very different from the schema the class was
> generated from.
> Serializers that do not allow the automatic registration of schemas will
> never be able to find the schema and will always throw the "schema not found"
> error.
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)