Closed haoxianhan closed 2 years ago
the only data structure of Lua is table, which is a hash table. Means table has no order for it's keys. So if you set all keys of oneof, I cant find out which is the "last set", so it's not usable. lua-protobuf choose to encode all of the keys. Just don't do this if you don't like the behavior.
This library just do encode/decode for protobuf, but not validate the data. So write you own functions to validate it.
the only data structure of Lua is table, which is a hash table. Means table has no order for it's keys. So if you set all keys of oneof, I cant find out which is the "last set", so it's not usable. lua-protobuf choose to encode all of the keys. Just don't do this if you don't like the behavior.
This library just do encode/decode for protobuf, but not validate the data. So write you own functions to validate it.
gotcha.
proto define following:
test example:
result:
doesn't
oneof
field means just one of member would be encode/decode ?