flavray / avro-rs

Avro client library implementation in Rust
MIT License
169 stars 95 forks source link

No support for named type references #203

Closed jchia closed 2 years ago

jchia commented 2 years ago

The following schema parses fine with Python Avro but in avro-rs, Schema::parse_str() rejects it with Error: ParsePrimitive("Dec"):

{
    "type": "record",
    "name": "foo",
    "fields": [
        {
            "name": "x",
            "type": {
                "type": "record",
                "name": "Dec",
                "fields": [
                    {
                        "name": "base",
                        "type": "int"
                    },
                    {
                        "name": "exp",
                        "type": "int"
                    }
                ]
            }
        },
        {
            "name": "y",
            "type": "Dec"
        }
    ]
}

The part of the Avro spec describing references to named types is here: https://avro.apache.org/docs/current/spec.html#names

martin-g commented 2 years ago

Please use the successor of this project: https://github.com/apache/avro/tree/master/lang/rust

martin-g commented 2 years ago

See https://github.com/flavray/avro-rs/pull/99#issuecomment-1017195592