Re: Rust Serde Deserialize

2022-08-30 Thread Martin Grigorov
https://github.com/lerouxrgd/rsgen-avro/pull/36 On Tue, Aug 30, 2022 at 9:07 AM Martin Grigorov wrote: > Hi Rajiv, > > Now, when you said it I remembered about this prerequisite for serializing > bytes. > I will open a PR to rsgen-avro to add #[serde(with = "serde_bytes")] when > "bytes" schema

Re: Rust Serde Deserialize

2022-08-29 Thread Martin Grigorov
Hi Rajiv, Now, when you said it I remembered about this prerequisite for serializing bytes. I will open a PR to rsgen-avro to add #[serde(with = "serde_bytes")] when "bytes" schema is used! Regards, Martin On Mon, Aug 29, 2022 at 5:10 PM Rajiv M Ranganath wrote: > Hi Martin, > > It looks like

Re: Rust Serde Deserialize

2022-08-29 Thread Rajiv M Ranganath
Hi Martin, It looks like there are no changes needed on the Avro side. I was not using Serde correctly. On the Rust side, we need to use `serde_bytes` [1] crate, and define our Rust struct as follows. ``` #[derive(Debug, PartialEq, Eq, Clone, serde::Deserialize, serde::Serialize)] #[serde(defaul

Re: Rust Serde Deserialize

2022-08-29 Thread Rajiv M Ranganath
On Mon, Aug 29, 2022 at 3:18 PM Martin Grigorov wrote: [...] > Do you want to contribute the code as a failing unit test in a Pull > Request ? > With a fix would be awesome! Okay. Please give me a couple of days. I'll investigate and open a PR. Best, Rajiv

Re: Rust Serde Deserialize

2022-08-29 Thread Martin Grigorov
Hi Rajiv, There are 0 known issues for the Rust SDK! :-) Do you want to contribute the code as a failing unit test in a Pull Request ? With a fix would be awesome! Thanks! Martin On Mon, Aug 29, 2022 at 12:11 PM Rajiv M Ranganath < rajiv.rangan...@gmail.com> wrote: > Hi Martin, > > On Mon, Au

Re: Rust Serde Deserialize

2022-08-29 Thread Rajiv M Ranganath
Hi Martin, On Mon, Aug 29, 2022 at 1:43 PM Martin Grigorov wrote: [...] > I'd recommend you this nice tool for generating Rust structs from Avro > schema: https://github.com/lerouxrgd/rsgen-avro Thanks for the reply and the pointer to `rsgen-avro`. :-) It looks like there seems to be an issue

Re: Rust Serde Deserialize

2022-08-29 Thread Martin Grigorov
Hi Rajiv, I'd recommend you this nice tool for generating Rust structs from Avro schema: https://github.com/lerouxrgd/rsgen-avro $ cat q.avsc 1 │ { 2 │ "type": "record", 3 │ "name": "Abcd", 4 │ "fields": [ 5 │ {"name": "b", "type": ["null", "bytes"], "default":