Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.10.2, 1.11.1
-
None
-
None
-
Tested on macOS 12.6
Description
When creating an Avro IDL file, if the developer adds multiple enumerations and/or records with the same name, no error or warning is shown when generating the AVSC file via the avro-tools idl2schemata operation. For example, given the following AVDL file...
@namespace("yournamespace") protocol ExampleSchema { enum typeCode{AA,BB,CC,DD} enum typeCode{ZZ,YY,XX,VV} record name{ typeCode typeCode; } record address{ typeCode typeCode; } record address{ string someName; } record message{ address address; name name; } }
...the generated AVSC will show (I'm having some trouble with the formatting here so I'll include an image and the text):
{ "type" : "record", "name" : "message", "namespace" : "yournamespace", "fields" : [ { "name" : "address", "type" : { "type" : "record", "name" : "address", "fields" : [ { "name" : "someName", "type" : "string" } ] } }, { "name" : "name", "type" : { "type" : "record", "name" : "name", "fields" : [ { "name" : "typeCode", "type" : { "type" : "enum", "name" : "typeCode", "symbols" : [ "ZZ", "YY", "XX", "VV" ] } } ] } } ]}
Here, the first enumeration is ignored, as is the first definition of address, as provided in the AVDL file.