assert(deserialize!(int[int])(serializeToJson(null)) is null);
assert(deserialize!(int[int])(serializeToAsdf(null)) is null);
assert(deserialize!(int[int])(serializeToJson([2 : 1, 40 : 2])) == [2 : 1, 40 : 2]);
assert(deserialize!(int[int])(serializeToAsdf([2 : 1, 40 : 2])) == [2 : 1, 40 : 2]);
import std.typecons;
struct Nested
{
float f;
}
struct T
{
string str;
Nullable!Nested nested;
@serdeOptional
Nullable!bool nval;
}
T t;
assert(deserialize!T(`{"str":null,"nested":null}`) == t);
t.str = "txt";
t.nested = Nested(123);
t.nval = false;
assert(deserialize!T(`{"str":"txt","nested":{"f":123},"nval":false}`) == t);
Deserialize associative array with integral type key