Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.12.0
-
None
Description
With version 1.12.0 the avro-maven-plugin stopped parsing leading underscore for field names. This was not the case for version 1.11.3
The following error can be observed.
line 94:9 token recognition error at: '_'
This should be allowed according to the specification for field names:
- start with [A-Za-z_]
- subsequently contain only [A-Za-z0-9_]
I can reproduce the issue with this test:
@Test void testParsingLeadingUnderscore() throws IOException { String avdl = """ @namespace("com.example.avro.schema") record Example { string _field; } """; var byteStream = new ByteArrayInputStream(avdl.getBytes(UTF_8)); IdlFile parse = new IdlReader().parse(byteStream); Schema schema = parse.getNamedSchema("com.example.avro.schema.Example"); // Fails since actual field name does not have a leading underscore assertEquals("_field", schema.getFields().get(0).name()); }
Attachments
Issue Links
- links to