Can System.Text.Json tolerate an unrecognized type discriminator during deserialization?
Summary A deserialization failure occurred when System.Text.Json rejected an unknown type discriminator in a polymorphic payload. Instead of gracefully ignoring the unrecognized subtype, the serializer threw a NotSupportedException, preventing the object graph from being materialized. Root Cause The failure stems from how System.Text.Json enforces strict polymorphic type resolution: The interface IBar is marked with [JsonPolymorphic(IgnoreUnrecognizedTypeDiscriminators … Read more