<PackageReference Include="System.Text.Json" Version="7.0.4" />

JsonPolymorphismOptions

Defines polymorphic configuration for a specified base type.

Gets the list of derived types supported in the current polymorphic type configuration.

public bool IgnoreUnrecognizedTypeDiscriminators { get; set; }

When set to true, instructs the serializer to ignore any unrecognized type discriminator id's and reverts to the contract of the base type. Otherwise, it will fail the deserialization.

public string TypeDiscriminatorPropertyName { get; set; }

Gets or sets a custom type discriminator property name for the polymorhic type. Uses the default '$type' property name if left unset.

Gets or sets the behavior when serializing an undeclared derived runtime type.