I need to refer to this Student schema from inside another schema:
{
"type": "record",
"namespace": "data.add",
"name": "Student",
"fields": [
{
"name": "Name",
"type": "string"
},
{
"name": "Age",
"type": "int"
}
]
}
This is the parent Address schema which needs to refer to Student:
{
"type": "record",
"namespace": "data.add",
"name": "Address",
"fields": [
{
"name": "student",
"type": "Student"
}
]
}
The above throws an error when I build using Gradle with the Avro plugin. Both schemas are located in the same folder.
Sorry if I'm too late to the party, but it looks to me like both the maven avro plugin and the avro-tools compiler do not determine dependency order when loading, but will succeed if you order them yourself on the commandline. I have an example demonstrating this from your sample files in a standard maven directory structure.
When I put the schema with no dependencies first in the commandline, it succeeds:
When I put the schema with dependencies first in the commandline, it fails: