Skip to content

Commit e8f31dc

Browse files
committed
Fix mypy issue with generated from_dict on reference properties
1 parent 92b907e commit e8f31dc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## 0.1.1 - 2020-03-06
8-
- Fix mypy issue in generated models with datetime properties
8+
- Fix mypy issue in generated models `from_dict` with datetime or reference properties
99

1010
## 0.1.0 - 2020-02-28
1111
- Initial Release

openapi_python_client/templates/ref_property.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
{% else %}
44
{{ property.name }} = None
55
if ({{ property.name }}_data := d.get("{{ property.name }}")) is not None:
6-
{{ property.name }} = {{ property.reference.class_name }}.from_dict({{ property.name }}_data)
6+
{{ property.name }} = {{ property.reference.class_name }}.from_dict(cast(Dict, {{ property.name }}_data))
77
{% endif %}

0 commit comments

Comments
 (0)