-
-
Notifications
You must be signed in to change notification settings - Fork 348
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(openapi): set default on schema from
FieldDefinition
Consider the following: ```python def get_foo(foo_id: int = 10) -> None: ... ``` In such cases, no `KwargDefinition` is created since there is no metadata provided via `Annotated`. The default is still parsed, and set on the generated `FieldDefinition`, however the `SchemaCreator` currently only considers defaults that are set on `KwargDefinition`. So in such cases, we should fallback to the default set on the `FieldDefinition` if there is a valid default value.
- Loading branch information
Showing
2 changed files
with
19 additions
and
1 deletion.
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