Skip to content

Commit 67a6289

Browse files
#9 Support importing wellknown types Value and ListValue
1 parent 41164f4 commit 67a6289

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

betterproto/plugin.py

+2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
WELLKNOWN_TYPES: Dict[str, Optional[Type]] = defaultdict(lambda: None, {
5050
'google.protobuf.Empty': google.protobuf.empty_pb2.Empty,
5151
'google.protobuf.Struct': google.protobuf.struct_pb2.Struct,
52+
'google.protobuf.Value': google.protobuf.struct_pb2.Value,
53+
'google.protobuf.ListValue': google.protobuf.struct_pb2.ListValue,
5254
})
5355

5456

betterproto/tests/inputs/config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"oneof_enum", # 63
1111
"casing_message_field_uppercase", # 11
1212
"namespace_keywords", # 70
13-
"namespace_builtin_types" # 53
13+
"namespace_builtin_types", # 53
1414
}
1515

1616
services = {

betterproto/tests/inputs/googletypes_service_returns_googletype/googletypes_service_returns_googletype.proto

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import "google/protobuf/struct.proto";
66
service Test {
77
rpc GetEmpty (RequestMessage) returns (google.protobuf.Empty);
88
rpc GetStruct (RequestMessage) returns (google.protobuf.Struct);
9+
rpc GetListValue (RequestMessage) returns (google.protobuf.ListValue);
10+
rpc GetValue (RequestMessage) returns (google.protobuf.Value);
911
}
1012

1113
message RequestMessage {

0 commit comments

Comments
 (0)