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

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

aknaut opened this issue Nov 5, 2019 · 1 comment · Fixed by #969

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

aknaut opened this issue Nov 5, 2019 · 1 comment · Fixed by #969


Copy link

@aknaut aknaut commented Nov 5, 2019


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.


from typing import Dict, List
from pydantic import BaseModel

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


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?

@aknaut aknaut added the bug label Nov 5, 2019
@samuelcolvin samuelcolvin mentioned this issue Nov 6, 2019
3 of 4 tasks complete

This comment has been minimized.

Copy link

@samuelcolvin samuelcolvin commented Nov 6, 2019

Thanks for reporting, fixed on #969. Let me know if that fixes your problem, I'll release an update in a day or two.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.