deserializeJson

Deserializes a JSON value into the destination variable.

The same types as for serializeToJson() are supported and handled inversely.

  1. void deserializeJson(T dst, Json src)
  2. T deserializeJson(Json src)
    T
    deserializeJson
    (
    T
    )
  3. T deserializeJson(R input)

Examples

struct Foo {
	int number;
	string str;
}
Foo f = deserializeJson!Foo(`{"number": 12, "str": "hello"}`);
assert(f.number == 12);
assert(f.str == "hello");

See Also

serializeToJson, serializeToJsonString, vibe.data.serialization

Meta