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/04 15:05:10 UTC

[GitHub] [incubator-brpc] wasphin commented on pull request #2035: only allow to convert root array to single repeated pb

wasphin commented on PR #2035:
URL: https://github.com/apache/incubator-brpc/pull/2035#issuecomment-1336434709

   > ### What problem does this PR solve?
   > Issue Number:
   > 
   > Problem Summary: 目前打开single_repeated_to_array开关后,pb转json只支持root case,但是打开array_to_single_repeated开关,json转pb没有限制root case。这样会导致json转pb,pb再转回json,前后的json结构发生了变化,不符合预期。例如:
   > 
   > ```
   > # pb
   > meesage Single {
   >     repeated int ids;
   > }
   > 
   > message Test {
   >     Single single;
   > }
   > 
   > # 打开array_to_single_repeated开关后,以下json可以转为Test
   > {
   >     "ids": [1,2,3]
   > }
   
   这个可以转为 Test? 感觉转换后应该是空 Test,看代码应该是从 json 中查找 field 进行转换,找不到 single 不应该进入到内层。


-- 
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