System.Text.Json has introduced polymorphic JSON serialization which allows to serialize and deserialize objects without writing custom converter. This can make the user faced API simpler and easier to write new code. To get this working .NET 7.0 or higher is required.
Implementing this can break with old versions of the web server as this changes the handling of events completely.
More information: https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/polymorphism?pivots=dotnet-7-0