Skip to content

Commit

Permalink
Merge pull request #41 from LOMS/fix-google-protobuf-struct
Browse files Browse the repository at this point in the history
Fix code generation for `google.protobuf.Struct` type
  • Loading branch information
so1n authored Feb 28, 2024
2 parents b5f5e60 + fd274de commit da6f82f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions protobuf_to_pydantic/plugin/field_desc_proto_to_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit da6f82f

Please sign in to comment.