Closed fospitia closed 3 weeks ago
Hi.
Next code fails with stack overflow
#[derive(Serialize, Deserialize, ToSchema)] #[schema(no_recursion)] pub struct Tree { left: Box<Tree>, right: Box<Tree>, } #[derive(Serialize, Deserialize, ToSchema)] #[schema(no_recursion)] pub enum TreeRecursion { Named { left: Box<TreeRecursion> }, Unnamed(Box<TreeRecursion>), NoValue, } #[derive(Serialize, Deserialize, ToSchema)] pub enum Recursion { #[schema(no_recursion)] Named { left: Box<Recursion>, right: Box<Recursion>, }, #[schema(no_recursion)] Unnamed(Box<Recursion>), Map(HashMap<String, Recursion>), NoValue, }
Without the Map(HashMap<String, Recursion>) line work.
And if you add it, the macro gives the following error
#[schema(no_recursion)] Map(HashMap<String, Recursion>),
NoRecursion does not support `ToTokens`
Thanks
Oh, that is a bug indeed,
The above should be possible.
Hi.
Next code fails with stack overflow
Without the Map(HashMap<String, Recursion>) line work.
And if you add it, the macro gives the following error
Thanks