Closed BenFradet closed 7 years ago
I have a schema file containing an array of record schemas like so:
[ { "name": "ReusedRecord", "type": "record", "fields": [ { "name": "aString", "type": "string" } ] }, { "name": "MainRecord", "type": "record", "fields": [ { "name": "reusedRecord1", "type": "ReusedRecord" }, { "name": "reusedRecord1", "type": "ReusedRecord" } ] } ]
The code generation works as expected in java through avro-tools but using go-avro it fails with this error: https://github.com/elodina/go-avro/blob/master/codegen.go#L93-L96 since the root schema is a UnionSchema and not a RecordSchema.
Does someone know how to circumvent this issue? Or should I repeat the schema x times?
I circumvented the issue by defining one global schema reusing a few records across sub schemas.
I have a schema file containing an array of record schemas like so:
The code generation works as expected in java through avro-tools but using go-avro it fails with this error: https://github.com/elodina/go-avro/blob/master/codegen.go#L93-L96 since the root schema is a UnionSchema and not a RecordSchema.
Does someone know how to circumvent this issue? Or should I repeat the schema x times?