I am having trouble parsing my AVRO json schema. I try to use the avro.ParseSchema function from this library: https://github.com/go-avro/avro. However, i get the following error message:
Unknown type name: array
I've been trying to fix this for a long time but i cannot seem to make it right. I have the following strucs implemented:
import (
"bytes"
"log"
avro "gopkg.in/avro.v0"
)
type Matrix struct {
UID int `avro:"uid"`
Data [][]float64 `avro:"data"`
}
type MatrixContainer struct {
MatricesArray []*Matrix `avro:"matrices_array"`
}
//Somewhere in here it goes wrong
schema, err := avro.ParseSchema(`{
"type": "record",
"name": "MatrixContainer",
"fields": [
{
"name": "matrices_array",
"type": "array",
"items": {
"type": "record",
"name": "Matrix",
"fields": [
{"name": "uid","type":"int"},
{"name": "data","type":"array","items":
{"type":"array","items":"double"}
}
]
}
}
]
}`)
Any help would be greatly appreciated.