The OpenD Programming Language

serializeValue

integral typed value associative array serialization

Examples

import mir.ser.json: serializeJson;
uint[short] ar = [256 : 1];
assert(serializeJson(ar) == `{"256":1}`);
ar.remove(256);
assert(serializeJson(ar) == `{}`);
assert(serializeJson((uint[string]).init) == `{}`);
// assert(deserializeJson!(uint[short])(`{"256":1}`) == cast(uint[short]) [256 : 1]);

Meta