14 references to SerializedValueCheckType
System.Text.Json.SourceGeneration (14)
JsonSourceGenerator.Emitter.cs (14)
839
SerializedValueCheckType
defaultCheckType = GetCheckType(contextSpec, propertyGenSpec);
848
if (defaultCheckType !=
SerializedValueCheckType
.None)
862
case
SerializedValueCheckType
.Ignore:
865
case
SerializedValueCheckType
.IgnoreWhenNull:
876
case
SerializedValueCheckType
.IgnoreWhenDefault:
887
case
SerializedValueCheckType
.DisallowNull:
1075
private static
SerializedValueCheckType
GetCheckType(ContextGenerationSpec contextSpec, PropertyGenerationSpec propertySpec)
1079
JsonIgnoreCondition.WhenWriting =>
SerializedValueCheckType
.Ignore,
1080
JsonIgnoreCondition.WhenWritingNull => propertySpec.PropertyType.CanBeNull ?
SerializedValueCheckType
.IgnoreWhenNull :
SerializedValueCheckType
.None,
1081
JsonIgnoreCondition.WhenWritingDefault => propertySpec.PropertyType.CanBeNull ?
SerializedValueCheckType
.IgnoreWhenNull :
SerializedValueCheckType
.IgnoreWhenDefault,
1082
_ when propertySpec.IsGetterNonNullableAnnotation && contextSpec.GeneratedOptionsSpec?.RespectNullableAnnotations is true =>
SerializedValueCheckType
.DisallowNull,
1083
_ =>
SerializedValueCheckType
.None,