Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

希望支持 oneof 的 DefaultMessageDecoding #247

Open
YoKnoWhat opened this issue Jun 22, 2023 · 1 comment
Open

希望支持 oneof 的 DefaultMessageDecoding #247

YoKnoWhat opened this issue Jun 22, 2023 · 1 comment

Comments

@YoKnoWhat
Copy link

image
【诉求】形如上图的 message,业务层希望在开启 use_default_metatable 选项的时候, property_type_1.any_member 也能取到默认值。

目前的实现中,LPB_METADEF 这个解码模式只考虑了 USE_FIELD 的默认值,并且默认值设置逻辑中会忽略 oneof 字段。希望能针对原表默认值的机制做个支持,毕竟一个类型的元表只有一份,这种情景下针对所有 oneof 支持他们的默认值其实也是说得通的。

@starwing
Copy link
Owner

这个好像不太容易,因为如果要实现这个特性,需要考虑在赋值以后再设置默认值。这一点其实可以考虑一下,有pr最好啦,不过我自己目前没什么时间做这个。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants