JWambaugh / TJSON

The tolerant JSON parser for Haxe
78 stars 25 forks source link

Need a way to serialize objects into JSON #1

Closed gamedevsam closed 11 years ago

gamedevsam commented 11 years ago

Parsing JSON files into Dynamic objects is a fantastic feature, and it's beautifully implemented in one small file. What would make this killer is if we could serialize objects at runtime into a JSON text file.

JWambaugh commented 11 years ago

I agree, and would like to implement serialization inside of TJSON in the future. In the meantime, I've been using hx_nice_json for my serializing needs: http://lib.haxe.org/p/hx_nice_json

gamedevsam commented 11 years ago

That framework looks awesome!

Why don't you integrate its functionality to this repo? Make this the only JSON parser / serializer lib you'll ever need.

gamedevsam commented 11 years ago

Could maybe simplify the implementation, that constructor takes in a whole lot of parameters that seems arbitrary. All you care about in a JSON serializer is that is takes in an object and spits out a JSON representation of its fields. Maybe sorting by name / type would be nice, but that's completely secondary.

JWambaugh commented 11 years ago

Done! I implemented a brand new JSON serializer in TJSON. It's just as easy to use as the parser, and supports 2 different JSON 'styles'. One human readable, and one with no whitespace.

It's up on haxelib for haxe 2 and haxe 3.

Thanks for your feedback!