Closed darklyspaced closed 8 months ago
there is a name conflict between Option<T> and the Option generated by quicktype, resulting in rust complaining that Option doesn't have any generic arguments as it's definition has been overridden from the prelude.
Option<T>
Option
{ "option": { "name": "test", "age": 5 } }
use serde::{Serialize, Deserialize}; #[derive(Debug, Serialize, Deserialize)] pub struct Welcome { pub option: Option<Option>, } #[derive(Debug, Serialize, Deserialize)] pub struct Option { pub name: Option<String>, pub age: Option<i64>, }
the rust code produces by quicktype fails to compile.
this should be pretty simple to fix: just add a case when a struct is called Option. call it something else and just #[serde(rename = "option")].
#[serde(rename = "option")]
Adding Option to the keywords list will fix this.
there is a name conflict between
Option<T>
and theOption
generated by quicktype, resulting in rust complaining thatOption
doesn't have any generic arguments as it's definition has been overridden from the prelude.MRE
the rust code produces by quicktype fails to compile.
this should be pretty simple to fix: just add a case when a struct is called
Option
. call it something else and just#[serde(rename = "option")]
.