-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance no_recursion rule to apply also containers (#1144)
This commit further enhances the `no_recursion` rule to also apply on named structs, enums and named field enum variants. When provided on these aforementioned levels it will apply to its fields / variants. Example of the enhanced syntax. ```rust #[derive(ToSchema)] #[schema(no_recursion)] pub struct Tree { left: Box<Tree>, right: Box<Tree>, } #[derive(ToSchema)] #[schema(no_recursion)] pub enum TreeRecursion { Named { left: Box<TreeRecursion> }, Unnamed(Box<TreeRecursion>), NoValue, } #[derive(ToSchema)] pub enum Recursion { #[schema(no_recursion)] Named { left: Box<Recursion>, right: Box<Recursion>, }, #[schema(no_recursion)] Unnamed(Box<Recursion>), NoValue, } ``` Closes #1137
- Loading branch information
Showing
7 changed files
with
92 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters