Skip to content

AttributeError: 'NoneType' object has no attribute 'min_items' #965

@aknaut

Description

@aknaut

Bug

Please complete:

  • OS: Windows 10
  • Python version import sys; print(sys.version): 3.6.9 |Anaconda, Inc.| (default, Jul 30 2019, 14:00:49) [MSC v.1915 64 bit (AMD64)]
  • Pydantic version import pydantic; print(pydantic.VERSION): 1.0

I get an AttributeError while trying to generate a schema for a dictionary with values of type list.

Example:

from typing import Dict, List
from pydantic import BaseModel

class SomeSchema(BaseModel):
    entries: Dict[str, List[int]]

SomeSchema.schema()

Which results in AttributeError: 'NoneType' object has no attribute 'min_items'

Is this a bug or do I need to define the schema in a different way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug V1Bug related to Pydantic V1.X

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions