14 references to SerializedValueCheckType
System.Text.Json.SourceGeneration (14)
JsonSourceGenerator.Emitter.cs (14)
850
SerializedValueCheckType
defaultCheckType = GetCheckType(contextSpec, propertyGenSpec);
859
if (defaultCheckType !=
SerializedValueCheckType
.None)
873
case
SerializedValueCheckType
.Ignore:
876
case
SerializedValueCheckType
.IgnoreWhenNull:
887
case
SerializedValueCheckType
.IgnoreWhenDefault:
898
case
SerializedValueCheckType
.DisallowNull:
1126
private static
SerializedValueCheckType
GetCheckType(ContextGenerationSpec contextSpec, PropertyGenerationSpec propertySpec)
1130
JsonIgnoreCondition.WhenWriting =>
SerializedValueCheckType
.Ignore,
1131
JsonIgnoreCondition.WhenWritingNull => propertySpec.PropertyType.CanBeNull ?
SerializedValueCheckType
.IgnoreWhenNull :
SerializedValueCheckType
.None,
1132
JsonIgnoreCondition.WhenWritingDefault => propertySpec.PropertyType.CanBeNull ?
SerializedValueCheckType
.IgnoreWhenNull :
SerializedValueCheckType
.IgnoreWhenDefault,
1133
_ when propertySpec.IsGetterNonNullableAnnotation && contextSpec.GeneratedOptionsSpec?.RespectNullableAnnotations is true =>
SerializedValueCheckType
.DisallowNull,
1134
_ =>
SerializedValueCheckType
.None,