mgholam / fastJSON

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

[Critical bug, Breaking change 2.3.3 -> 2.3.5]: StackOverflow Exception #118

Closed AgentFire closed 4 years ago

AgentFire commented 4 years ago

After updating from 2.3.3 to 2.3.5 I have stumbled upon this very unpleasant bug. NuGet package version: 2.3.5 (latest, stable).

Minimal repro:

class Program
{
    // Self-reference is now a problem that needs hotfixing.
    public sealed class Model
    {
        public Model[] Children { get; set; }
    }

    static void Main()
    {
        JSON.ToObject<Model>("{}");
    }
}

Even this simple JSON and model setup does not behave as it used to. image

mgholam commented 4 years ago

Hmmm, thanks, I will look into it.

mgholam commented 4 years ago

Checkout v2.3.5.2

AgentFire commented 4 years ago

Yup, you fixed it. I'd also recommend you to deprecate 2.3.5 version via NuGet site ( > direct management link < ), using the "This package has critical bugs that make it unusable" checkbox.