-
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.
Make `Option` fields non-required by default. This is the way it used to be originally but was changed due hopes for better client code generation. However since it caused issues with client side generation the behaviour is now changed back on this commit. The nullability behaviour will still stay to same, so `Option` will still be considered nullable. These rules are explained in the docs for greater detail. This commit also adds `required` attribute that can be used to declare a field of `ToSchema` and `IntoParams` as required in order to change the default required status of a field / parameter. Since `Option` is by default non-required, this would enforce the `name` parameter to be required. ```rust #[derive(IntoParams)] #[into_params(parameter_in = Query)] struct Params { #[param(required)] name: Option<String>, } ```
- Loading branch information
Showing
15 changed files
with
306 additions
and
121 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
Oops, something went wrong.