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

JsonIgnoreCondition

public enum JsonIgnoreCondition
When specified on DefaultIgnoreCondition, determines when properties and fields across the type graph are ignored. When specified on Condition, controls whether a property or field is ignored during serialization and deserialization. This option overrides the setting on DefaultIgnoreCondition.
namespace System.Text.Json.Serialization { public enum JsonIgnoreCondition { Never, Always, WhenWritingDefault, WhenWritingNull } }