diff --git a/protobuf_to_pydantic/__version__.py b/protobuf_to_pydantic/__version__.py index d169a2f..6c8e6b9 100644 --- a/protobuf_to_pydantic/__version__.py +++ b/protobuf_to_pydantic/__version__.py @@ -1 +1 @@ -__version__ = "v0.2.2" +__version__ = "0.0.0" 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 37f6fe2..ef1f069 100644 --- a/protobuf_to_pydantic/plugin/field_desc_proto_to_code.py +++ b/protobuf_to_pydantic/plugin/field_desc_proto_to_code.py @@ -293,6 +293,7 @@ def _message_field_handle( value_type_str = self._get_value_code(map_type_dict["values"]) else: value_type_str = self._get_protobuf_type_model(message.field[1]).py_type_str + self._add_import_code("typing") type_str = f"typing.Dict[{key_type_str}, {value_type_str}]" # custom field support @@ -308,6 +309,7 @@ def _message_field_handle( field_param_dict_migration_v2_handler(field_info_dict, is_warnings=False) if optional_dict.get(field.name, {}).get("is_proto3_optional", False): + self._add_import_code("typing") type_str = f"typing.Optional[{type_str}]" if field_info_dict.get( "default", _pydantic_adapter.PydanticUndefined