-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit refactors enum processing from ground up. This fully unifies the how each enum variant schema is resolved and the way variant schemas are generated. This will result easier debugging, changing and updating the enum processing in future and most of all the enums now will behave consistently due to removing bunch of duplication and adding correct abstractions instead. This commit also unifies previously known `SimpleEnum` and `ReprEnum` to a single enum to furhter simplify the code. Also `ComplexEnum` is now known by `MixedEnum`. This commit implements discriminator with support for custom mapping. Discriminator can only be used with `#[serde(untagged)]` enum having only unnamed field variants with one schema reference implementing `ToSchema` trait. It cannot be used with primitive types nor with inlined schemas. Removed `#[serde(tag = ...)]` as discriminator support. Update docs and add support for missing features for enum variants such as `Title`, `Deprecated`, `MinProperties` and `MaxProperties`. ### Breaking changes * `#[serde(tag = ...)]` will not be used as discriminator.
- Loading branch information
Showing
16 changed files
with
1,857 additions
and
1,632 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
Oops, something went wrong.