We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
由于lua中没有数组概念,pb.decode会把空数组当成空table,当cjson进行decode时就会序列化为{}。 现在cjson支持cjson.decode_array_with_array_mt(true)即当setmetatable({}, array_mt)时就会序列化[]。 我现在的做法为,递归所有属性,找到"repeated"的空table,进行设置 这种感觉非常不友好而且严重影响性能,有没有从pb方面就能很好的解决问题的方法呢?
The text was updated successfully, but these errors were encountered:
可以讨论下看看有什么比较好的方案
Sorry, something went wrong.
[] {} 都设置成 nil
可以考虑pb.defaults("*array", array_mt)
pb.defaults("*array", array_mt)
Successfully merging a pull request may close this issue.
由于lua中没有数组概念,pb.decode会把空数组当成空table,当cjson进行decode时就会序列化为{}。
现在cjson支持cjson.decode_array_with_array_mt(true)即当setmetatable({}, array_mt)时就会序列化[]。
我现在的做法为,递归所有属性,找到"repeated"的空table,进行设置
这种感觉非常不友好而且严重影响性能,有没有从pb方面就能很好的解决问题的方法呢?
The text was updated successfully, but these errors were encountered: