12 references to JsonSerializerDefaults
System.Text.Json.SourceGeneration (12)
JsonSourceGenerator.Emitter.cs (2)
1174
if (optionsSpec.Defaults is
JsonSerializerDefaults
defaults)
1453
private static string FormatJsonSerializerDefaults(
JsonSerializerDefaults
defaults)
JsonSourceGenerator.Parser.cs (3)
265
JsonSerializerDefaults
? defaults = null;
293
Debug.Assert(attributeData.ConstructorArguments.Length == 1 & attributeData.ConstructorArguments[0].Type?.Name is nameof(
JsonSerializerDefaults
));
294
defaults = (
JsonSerializerDefaults
)attributeData.ConstructorArguments[0].Value!;
Model\SourceGenerationOptionsSpec.cs (1)
70
=> PropertyNamingPolicy ?? (Defaults is
JsonSerializerDefaults
.Web ? JsonKnownNamingPolicy.CamelCase : null);
src\libraries\System.Text.Json\Common\JsonSerializerDefaults.cs (1)
12
/// Specifies that general-purpose values should be used. These are the same settings applied if a <see cref="
JsonSerializerDefaults
"/> isn't specified.
src\libraries\System.Text.Json\Common\JsonSourceGenerationOptionsAttribute.cs (5)
23
/// Constructs a new <see cref="JsonSourceGenerationOptionsAttribute"/> instance with a predefined set of options determined by the specified <see cref="
JsonSerializerDefaults
"/>.
25
/// <param name="defaults">The <see cref="
JsonSerializerDefaults
"/> to reason about.</param>
27
public JsonSourceGenerationOptionsAttribute(
JsonSerializerDefaults
defaults)
31
if (defaults is
JsonSerializerDefaults
.Web)
37
else if (defaults is not
JsonSerializerDefaults
.General)