I'm setting up a pub/sub topic to receive some JSON data. One of the fields in the JSON data is an array of strings, like so:
{
...
"Tags": ["2333TAG"],
...
}
I've tried defining the schema as per the Avro 1.11 spec:
{
"type": "record",
"name": "Avro",
"fields": [
...
{
"name": "Tags",
"type": "array",
"items": "string",
"default": []
},
...
]
}
But when I try to validate the definition, I get the error: Invalid schema definition: Reference node does not refer to previously declared type: array
Any idea of what I might be doing wrong? I have verified that this is the field in the schema that's throwing the error.
Avro requires a nested type for declaring an array:
{
"type": "record",
"name": "Avro",
"fields": [
...
{
"name": "Tags",
"type": {
"type": "array",
"items": "string",
"default": []
}
}
...
]
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With