Closed scottPlusPlus closed 4 years ago
It is a nice idea, thanks for the PR !
Just two little things.
trace
when the custom writer/parser is invalid with Context.fatalError
instead. I'd rather see the errors at compile time.I swapped out the trace
s, great call!
I'm not sure I follow about "test of invalid parsing with a custom parser". If I include an invalid parser that doesn't compile, then the test wouldn't compile either?
Ok, I'll try to add a test later.
Could you swap the final
to var
so we can continue to support Haxe 3, before I merge it.
I forgot it broke the CI.
finals swapped. If you manage to get a test working I'll love to see how you did it.
Thanks for the changes. I'll try to add a test by the end of the end week with the updated readme
Thanks for the PR, it's quite a useful feature.
I've released json2object 3.8.0, the errors thrown inside a custom parser are now available in parser.errors
.
Allows custom parsing/writing of Classes or Fields via @:jcustomparse/@:jcustomwrite attributes
Main drive was to allow for parsing Dynamics. Happy to make any changes / address concerns.