Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Duplicate
-
1.10.2
-
None
-
None
Description
This issue is causing producers not to find the schemas when serializing messages.
How to reproduce:
1. Create a MyRecord.avsc file:
{ "type": "record", "name": "MyRecord", "namespace": "my.namespace", "doc": "my documentation", "fields": [ { "name": "field1", "type": "int" }, { "name": "field2", "type": "string", "order": "ascending", "aliases": [ "field3" ] }] }
2. Run avrogen to generate the C# class:
avrogen -s MyRecord.avsc .
3. Check the output:
/// <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\"]}]}");
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.