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

Allows Optional lists with unique_items check #4568

Merged
merged 1 commit into from Oct 17, 2022

Commits on Sep 26, 2022

  1. Allows Optional lists with unique_items check

    When using `unique_items` with an `Optional[List[T]]` field, the field
    validator would raise the following error if the field was not provided:
    > `'NoneType' object is not iterable (type=type_error)`
    
    Updating the validator to return `None` in these cases avoids the issue.
    
    Fixes pydantic#3957, pydantic#4050, pydantic#4119
    mfulgo committed Sep 26, 2022
    Copy the full SHA
    3ba804e View commit details
    Browse the repository at this point in the history