You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2022/12/22 11:06:33 UTC

[GitHub] [incubator-brpc] mrwhyxxk opened a new issue, #2054: Pb2JsonOptions的注释与实际相反

mrwhyxxk opened a new issue, #2054:
URL: https://github.com/apache/incubator-brpc/issues/2054

   **Describe the bug (描述bug)**
   ```
   1、single_repeated_to_array字段的注释中,default是false。
   2、但是实际使用时发现,默认是开启的。例如
   "my_field": ["value1"], my_field是一个repeated字段,没有设置single_repeated_to_array的情况下,仍然解析为array
   ```
   ![截屏2022-12-22 19 00 22](https://user-images.githubusercontent.com/45534026/209120213-31ebd594-d50a-41fe-86db-fea328c14980.png)
   
   **To Reproduce (复现方法)**
   
   
   **Expected behavior (期望行为)**
   
   
   **Versions (各种版本)**
   OS:centos7和6
   Compiler:gcc7.3
   brpc:1.3
   protobuf:2.4.1
   
   **Additional context/screenshots (更多上下文/截图)**
   
   


-- 
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: dev-unsubscribe@brpc.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] wasphin commented on issue #2054: Pb2JsonOptions的注释与实际相反

Posted by GitBox <gi...@apache.org>.
wasphin commented on issue #2054:
URL: https://github.com/apache/incubator-brpc/issues/2054#issuecomment-1363630416

   > ```
   > 1、single_repeated_to_array字段的注释中,default是false。
   > 2、但是实际使用时发现,默认是开启的。例如
   > "my_field": ["value1"], my_field是一个repeated字段,没有设置single_repeated_to_array的情况下,仍然解析为array
   > ```
   
   参考这个示例:
   https://github.com/apache/incubator-brpc/blob/master/docs/cn/json2pb.md#repeated-field
   
   效果是当开启`single_repeated_to_array` 时,序列化为:
   ```json
   ["value1"]
   ```
   而不是
   ```json
   {
      "my_field": ["value1"]
   }
   ```
   
   假设使用的 proto 是:
   ```proto
   message foo {
       repeated string my_field = 1;
   }
   ```


-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [incubator-brpc] serverglen closed issue #2054: Pb2JsonOptions的注释与实际相反

Posted by GitBox <gi...@apache.org>.
serverglen closed issue #2054: Pb2JsonOptions的注释与实际相反
URL: https://github.com/apache/incubator-brpc/issues/2054


-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org