Skip to content

Commit 62fc421

Browse files
Add failing tests for google.protobuf Struct and Value #9
1 parent eeed1c0 commit 62fc421

File tree

5 files changed

+38
-0
lines changed

5 files changed

+38
-0
lines changed

betterproto/tests/inputs/config.py

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
"casing_message_field_uppercase", # 11
1313
"namespace_keywords", # 70
1414
"namespace_builtin_types", # 53
15+
"googletypes_struct", # 9
16+
"googletypes_value", # 9
1517
}
1618

1719
services = {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"struct": {
3+
"key": true
4+
}
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
syntax = "proto3";
2+
3+
import "google/protobuf/struct.proto";
4+
5+
message Test {
6+
google.protobuf.Struct struct = 1;
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"value1": "hello world",
3+
"value2": true,
4+
"value3": 1,
5+
"value4": null,
6+
"value5": [
7+
1,
8+
2,
9+
3
10+
]
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
syntax = "proto3";
2+
3+
import "google/protobuf/struct.proto";
4+
5+
// Tests that fields of type google.protobuf.Value can contain arbitrary JSON-values.
6+
7+
message Test {
8+
google.protobuf.Value value1 = 1;
9+
google.protobuf.Value value2 = 2;
10+
google.protobuf.Value value3 = 3;
11+
google.protobuf.Value value4 = 4;
12+
google.protobuf.Value value5 = 5;
13+
}

0 commit comments

Comments
 (0)