fromJSONImpl

Undocumented in source. Be warned that the author may not have intended to support it.
T
fromJSONImpl
(
T
P
)
(
JSONValue json
,
P parent = null
)
if (
!isBuiltinType!T
)

Examples

Deserialize an instance of a user-defined type from a json object.

import jsonizer.jsonize;
import jsonizer.tojson;

static struct Foo {
  mixin JsonizeMe;

  @jsonize {
    int i;
    string[] a;
  }
}

auto jstr = q{
  {
    "i": 1,
    "a": [ "a", "b" ]
  }
};

// you could use `readJSON` instead of `parseJSON.fromJSON`
auto foo = jstr.parseJSON.fromJSON!Foo;
assert(foo.i == 1);
assert(foo.a == [ "a", "b" ]);

Meta