Skip to content

Commit 5a6bbba

Browse files
authored
Merge pull request #96 from mxthxngx/95-auto-import-typing-for-struct
Imports typing during conversion of struct code to Dict
2 parents 53d8037 + 5aca055 commit 5a6bbba

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

protobuf_to_pydantic/plugin/field_desc_proto_to_code.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,7 @@ def _get_type_factory(module_name: str, message_name: str) -> Any:
883883
py_type_str = "typing.Dict[str, typing.Any]"
884884
rule_type_str = "struct"
885885
type_factory = dict
886+
self._add_import_code("typing")
886887
elif field.type_name.startswith(".google.protobuf"):
887888
py_type_str = _type_str
888889
rule_type_str = "any"

0 commit comments

Comments
 (0)