This solution enables polymorphic deserialization of abstract classes or interfaces using System.Text.Json. A $type property is added to the JSON data to specify the type, allowing the correct derived type to be deserialized. The PolymorphicJsonConverterFactory and PolymorphicJsonConverter classes automatically recognize types and handle dynamic conversion.
You can find the full source code on CSharpEssentials