Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(openapi): set default on schema from FieldDefinition #3280

Merged
merged 1 commit into from
Mar 29, 2024

Commits on Mar 29, 2024

  1. 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.
    guacs authored and provinzkraut committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    35c4825 View commit details
    Browse the repository at this point in the history