Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Workaround
-
1.11.3
-
None
-
Quarkus released a fix for this issue: https://github.com/quarkusio/quarkus/issues/39344
Description
I am unable to generate Java classes from two .avsc files that both contain an identical record. I get a SchemaParseException: Can't redefine: com.example.domain.Provenance.
- schema 1: programmes-key.avsc
- schema 2: programmes-value.avsc
I am not sure I understand the generator correctly since the the check to throw the exception in this case was recently added for the code generation via an Open API yaml https://issues.apache.org/jira/browse/AVRO-3805
Here the commit in question:
Steps to reproduce:
- Download avsc-java-generator.zip
- Unzip and change into directory
- Run ./gradlew quarkusDev --stacktrace
- Observe SchemaParseException in output
Expected:
The generator should accept the same name and overwrite the output.
Result:
Caused by: org.apache.avro.SchemaParseException: Can't redefine: com.example.domain.Provenance at org.apache.avro.Schema$Names.put(Schema.java:1604) at org.apache.avro.Schema$Names.add(Schema.java:1598) at org.apache.avro.Schema.parse(Schema.java:1774) at org.apache.avro.Schema.parse(Schema.java:1736) at org.apache.avro.Schema$Parser.parse(Schema.java:1471) at org.apache.avro.Schema$Parser.parse(Schema.java:1433)