Hello ![]()
For log purpose i’m using a custom log_hooks to add some metadata then send a message to a RabbitMQ queue.
But recently some issues came up : services consuming the queue can’t parse the incoming JSON, a field (tls_peer_subject_name) defined as an array is written as an empty object ({} instead of an empty array [])
Indeed in my log_hooks when i manually add a field as an empty array data["tls_peer_subject_name"] = {} the data retrieved in the RabbitMQ queue looks like this { ..., "type": "Rejection", "tls_peer_subject_name": {}, ...}.
It seems that kumo.serde.json_encode and kumo.serde.json_encode_pretty are using materialize_to_lua_value which will try to obtain a native lua representation of the provided value unfortunately that’s where the problem happens when encoding empty table as correct Lua representation but as invalid JSON’s one ![]()
To hackfix this i added a check for size of this table in my log_hooks.
Do you have another workaround ? (Or an incoming feature/fix ?
)
Thanks by advance and happy new year ! ![]()
PS:
Using version 2025.10.06-5ec871ab :
kumo.serde.json_encode(toto))```
will give :
`{'empty_json':{},'empty_lua':{},'filled':[1,2,3]}`