8000 List[T] validation is not strict enough · Issue #86 · pydantic/pydantic · GitHub
[go: up one dir, main page]

Skip to content

List[T] validation is not strict enough #86

@mgu

Description

@mgu

with this kind of model :

class Foo(BaseModel):
    items: List[int]

Foo(items='') does not throw any error. Looking at the code, we do not check the list is a list, but we iterate over it and check the elements. Any empty iterable can be used for List[T]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0