mgholam / fastJSON

Smallest, fastest polymorphic JSON serializer
https://www.codeproject.com/Articles/159450/fastJSON-Smallest-Fastest-Polymorphic-JSON-Seriali
MIT License
478 stars 148 forks source link

Formatter.PrettyPrint not thread safe #96

Closed xmedeko closed 5 years ago

xmedeko commented 5 years ago

Formatter.PrettyPrintmanipulates theprivate static string _indent` variable which is not thread safe. Possible solutions:

Also, Formatter.PrettyPrint(string input) should use JSON.Parameters.FormatterIndentSpaces and not always three spaces.

Also, it would be handy to have JSON.Beautify(string input, string indent) for custom indent (e.g. a tab).

mgholam commented 5 years ago

Thanks! I will look into it.

mgholam commented 5 years ago

fixed in v2.2.2

xmedeko commented 5 years ago

Thanks for a quick fix. 👍

You have left some commented out old code in the Formatter.cs.

I miss a bit JSON.Beautify(string input, string indent) but that's not so important. (Maybe the JSON.Beautify methods are obsolete?).

It's possible to close this issue.