Closed
Description
Describe the bug
Generated classmethod from_dict
openapi-python-client/openapi_python_client/templates/model.py.jinja
Lines 131 to 132 in 5cfe4e1
should probably be annotated as
@classmethod
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
i.e. using typing.Mapping
.
This marks the input dictionary as immutable and thus mypy is OK if you pass it a TypedDict
. Otherwise, it correctly complains about type-incompatibility because the method could be removing or adding keys from the dictionary.
OpenAPI Spec File
NA.
Additional context
Metadata
Metadata
Assignees
Labels
No labels