msgpack icon indicating copy to clipboard operation
msgpack copied to clipboard

Add encoding of nil values in tables and of empty maps

Open pespinho opened this issue 1 year ago • 0 comments

Hello Kieselsteini,

The current implementation does not support encoding nil as values of a table or an empty map, which are sometimes needed for complying to some protocol specifications, e.g. MessagePack-RPC.

The changes in this pull request target adding these two features to the library.

This is achieved by adding two objects to the library that represents the two MessagePack values (NIL and EMPTY_MAP). Since they have an unique address in Lua, it is possible to identify the intent of the user of encoding these values.

What do you think of this solution?

Best regards Pespinho

pespinho avatar Mar 05 '24 09:03 pespinho