simon0-o commented on code in PR #2469:
URL: https://github.com/apache/thrift/pull/2469#discussion_r940178077


##########
compiler/cpp/src/thrift/generate/t_json_generator.cc:
##########
@@ -268,7 +268,9 @@ void t_json_generator::write_type_spec(t_type* ttype) {
     write_key_and("annotations");
     start_object();
     for (auto & annotation : ttype->annotations_) {
-      write_key_and_string(annotation.first, annotation.second);
+      for (auto& annotation_value : annotation.second) {
+        write_key_and_string(annotation.first, annotation_value);
+      }

Review Comment:
   I added a `AnnotationCompatiableTest`, will this do?
   ```thrift
   struct AnnotationCompatiableTest {
           1: bool Bool0 = true (vt.const = "true", go.tag = 'json:"bool0"')
           2: i8 Byte0 = 1 (vt.lt = "2", go.tag = 'json:"byte0"')
           3: double Double0 = 1.0 (vt.lt = "2.0", go.tag = 'json:"double0"')
           4: string String0 = "my const string" (vt.const = "my const string", 
go.tag = 'json:"string0"')
           5: binary Binary0 = "my const string" (vt.const = "my const string", 
go.tag = 'json:"binary0"')
           6: map<string, string> Map0 (vt.min_size = "0", go.tag = 
'json:"map0"')
           7: set<string> Set0 (vt.min_size = "0", go.tag = 'json:"set0"')
           8: EnumFoo Enum0 = EnumFoo.e2 (vt.in = "[EnumFoo.e2]", go.tag = 
'json:"enum0"')
           9: Foo Struct0 (vt.skip = "true", go.tag = 'json:"struct0"')
   }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to