misc: Add workaround for Json library not able to handle empty list

This commit is contained in:
Badlop
2025-07-15 10:36:24 +02:00
parent a17c2c166d
commit 8ce8f67c06
+3
View File
@@ -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) ->