diff --git a/protobuf_to_pydantic/plugin/field_desc_proto_to_code.py b/protobuf_to_pydantic/plugin/field_desc_proto_to_code.py index de04ead..254c4d6 100644 --- a/protobuf_to_pydantic/plugin/field_desc_proto_to_code.py +++ b/protobuf_to_pydantic/plugin/field_desc_proto_to_code.py @@ -565,8 +565,8 @@ def _get_protobuf_type_model(self, field: FieldDescriptorProto) -> ProtobufTypeM rule_type_str = "any" type_factory = AnyMessage self._add_import_code("google.protobuf.any_pb2", "Any") - elif field.type_name.split(".")[-2] == "Struct": - py_type_str = "Dict" + elif _type_str == "Struct": + py_type_str = "typing.Dict" rule_type_str = "struct" type_factory = dict else: