Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Fixed
-
1.9.1
Description
Steps to reproduce:
1) MyRecord.asvc file :
{ "type" : "record", "doc" : "Doc for record" "name" : "MyRecord", "namespace" : "My.Namespace", "fields" : [ { "name" : "Field1", "type" : "int" } ] }
2) Run command to generate C# class from the Avro spec file:
avrogen -s MyRecord.asvc ./
-> Current behavior: the Schema field in C# class is missing the "doc" data, I got serialization error when tried to use this class because the subject in Schema Registry contains the "doc" field (I register the avro spec file to the schema registry seperately)
public partial class MyRecord : ISpecificRecord { public static Schema _SCHEMA = Schema.Parse("{\"type\":\"record\",\"name\":\"MyRecord\",\"namespace\":\"My.Namespace\",\"fields\":[{\"name\":\"" + "Field1\",\"type\":\"int\"}]}");
-> Expected behavior: we should have the "doc" field for type "record", so it will be consistent with the spec file
public partial class MyRecord : ISpecificRecord { public static Schema _SCHEMA = Schema.Parse("{\"type\":\"record\", \"doc\":\"Doc for record\", \"name\":\"MyRecord\", \"namespace\":\"My.Namespace\", \"fields\":[{\"name\":\"" + "Field1\",\"type\":\"int\"}]}");
As a work around, right now I have to remove the "doc" for the type "record" but I think we should have it there and not causing a problem.
Attachments
Issue Links
- fixes
-
AVRO-2997 Documentation is missing in string representation of named schemas
- Patch Available
- links to