aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/util/internal/testdata/books.proto
diff options
context:
space:
mode:
authorGravatar Feng Xiao <xfxyjwf@gmail.com>2017-03-09 16:30:15 -0800
committerGravatar Feng Xiao <xfxyjwf@gmail.com>2017-03-09 16:30:15 -0800
commit61e87f3d41554989883e2c2fe35fbb9d891879cd (patch)
treeb0232bf1c6fe824e90fb7729cde74e87d30e7f64 /src/google/protobuf/util/internal/testdata/books.proto
parentcad6a51a30d021bc25932f3d0f98b4593463a0c6 (diff)
Use per-type table to lookup JSON name.
Different fields from different messages can map to the same JSON name and the original global lookup table is only capable of mapping one of such fields. This change converts the global table to per-type tables so fields from different messages won't conflict.
Diffstat (limited to 'src/google/protobuf/util/internal/testdata/books.proto')
-rw-r--r--src/google/protobuf/util/internal/testdata/books.proto9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/google/protobuf/util/internal/testdata/books.proto b/src/google/protobuf/util/internal/testdata/books.proto
index 9fe4f7aa..869271f4 100644
--- a/src/google/protobuf/util/internal/testdata/books.proto
+++ b/src/google/protobuf/util/internal/testdata/books.proto
@@ -190,3 +190,12 @@ message Cyclic {
repeated Author m_author = 5;
optional Cyclic m_cyclic = 4;
}
+
+// Test that two messages can have different fields mapped to the same JSON
+// name. See: https://github.com/google/protobuf/issues/1415
+message TestJsonName1 {
+ optional int32 one_value = 1 [json_name = "value"];
+}
+message TestJsonName2 {
+ optional int32 another_value = 1 [json_name = "value"];
+}