roofdiver commented on issue #285:
URL: https://github.com/apache/avro-rs/issues/285#issuecomment-3304565095
Ok so I went looking in the source code for a solution and I found that you
can use
` #[serde(with = "apache_avro::serde_avro_bytes_opt")] ` in your struct and
then de-serialization of byte arrays works.
Then you can do something like this
```
#[derive(Debug, Deserialize, Serialize, Encode, Decode, Clone)]
pub struct Example{
#[serde(with = "apache_avro::serde_avro_bytes_opt")]
pub data: Option<Vec<u8>>,
}
```
I would like to put it out that there that I searched pretty heavily and
couldn't find this until I dug into the source code. I think it may be worth
noting in the examples on the doc page.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]