From 8ce8f67c062dd32cf97ff7791f012940a9a110d7 Mon Sep 17 00:00:00 2001 From: Badlop Date: Tue, 15 Jul 2025 10:36:24 +0200 Subject: [PATCH] misc: Add workaround for Json library not able to handle empty list --- src/misc.erl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/misc.erl b/src/misc.erl index 55c1cec29..32a85a8d1 100644 --- a/src/misc.erl +++ b/src/misc.erl @@ -146,6 +146,9 @@ json_encode({[{_Key, _Value} | _]} = Term) -> (Val, Encoder) -> json:encode_value(Val, Encoder) end)); +json_encode({[]}) -> + %% Jiffy was able to handle this case, but Json library does not + <<"{}">>; json_encode(Term) -> iolist_to_binary(json:encode(Term)). json_decode(Bin) ->