elnabo / json2object

Type safe Haxe/JSON (de)serializer
MIT License
66 stars 17 forks source link

(default,null) typedef fields don't work #11

Closed Gama11 closed 7 years ago

Gama11 commented 7 years ago

Trying to use json2object for vshaxe's build tool, I came across this issue:

class Main {
    static function main() {
        var parser = new json2object.JsonParser<ReadonlyStruct>();
        trace(parser.fromJson('{"foo":1}', ""));
    }
}

typedef ReadonlyStruct = {
    var foo(default,null):Int;
}
ibilon commented 7 years ago

Thanks for the report, fixed by https://github.com/elnabo/json2object/commit/7204b761f63ea3dc81c829f7d333fd97a5d425a6.

Gama11 commented 7 years ago

Wow, that was quick! 👍