null string will throw exception
mzfhhhh opened this issue · comments
mzfhhhh commented
struct P
{ string name; }
auto jv = parseJSON(`{"name": null}`);
auto j = fromJSON!P(jv);
std.json.JSONException@std\json.d(136): JSONValue is not a string
Edwin van Leeuwen commented
Thanks for reporting.
Looking into it this should be fixed by returning T.init if JSON_TYPE == NULL here:
https://github.com/BlackEdder/painlessjson/blob/master/source/painlessjson/painlessjson.d#L615
Will try to do this in the next couple of days (PR's are welcome of course :) )