chenBright opened a new pull request, #2035:
URL: https://github.com/apache/incubator-brpc/pull/2035
### 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]
}
# 但是打开single_repeated_to_array开关后,Test转为json的格式为:
{
single: {
"ids": [1,2,3]
}
}
```
### What is changed and the side effects?
Changed:
Side effects:
- Performance effects(性能影响):
- Breaking backward compatibility(向后兼容性):
如果旧代码希望array_to_single_repeated将非root array转成single
@repedted的话,使用此PR代码后,会导致json转pb失败。
---
### Check List:
- Please make sure your changes are compilable(请确保你的更改可以通过编译).
- When providing us with a new feature, it is best to add related
tests(如果你向我们增加一个新的功能, 请添加相关测试).
- Please follow [Contributor Covenant Code of
Conduct](../../master/CODE_OF_CONDUCT.md).(请遵循贡献者准则).
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]