django-ninja
django-ninja copied to clipboard
Attribute `description` declared has type `str` but is used as type None
"filename": "docs/src/tutorial/body/code01.py"
"warning_type": "Incompatible attribute type [8]"
"warning_message": " Attribute description
declared in class Item
has type str
but is used as type None
.",
"warning_line": 6
"fix": "" instead of None
@luca-digrazia thank you for PR - but tests are failing... https://github.com/vitalik/django-ninja/runs/7858252406?check_suite_focus=true
and if you read the docs for that page - there is also a reference that None
is expected there
so what you probably mean is to mark it as Optional:
description: Optional[str] = None
@luca-digrazia thank you for PR - but tests are failing... https://github.com/vitalik/django-ninja/runs/7858252406?check_suite_focus=true
and if you read the docs for that page - there is also a reference that
None
is expected thereso what you probably mean is to mark it as Optional:
description: Optional[str] = None
Yes, updated with optional.