93 instantiations of JsonSerializerOptions
Aspire.Dashboard (2)
Aspire.Hosting (1)
BasicTestApp (1)
BasicWebSite (1)
BasketService (1)
ConfigurationSchemaGenerator (1)
ConfigurationSchemaGenerator.Tests (1)
dotnet-user-jwts (1)
InMemory.FunctionalTests (1)
Microsoft.AspNetCore.Authentication.Core.Test (1)
Microsoft.AspNetCore.Authentication.Twitter (1)
Microsoft.AspNetCore.Components (1)
Microsoft.AspNetCore.Components.Endpoints (3)
Microsoft.AspNetCore.Components.Server (2)
Microsoft.AspNetCore.Components.Server.Tests (5)
ElementReferenceJsonConverterTest.cs (5)
31Converter.Write(writer, elementReference, new JsonSerializerOptions());
50var elementReference = Converter.Read(ref reader, typeof(ElementReference), new JsonSerializerOptions());
70var elementReference = Converter.Read(ref reader, typeof(ElementReference), new JsonSerializerOptions());
88Converter.Read(ref reader, typeof(ElementReference), new JsonSerializerOptions());
107Converter.Read(ref reader, typeof(ElementReference), new JsonSerializerOptions());
Microsoft.AspNetCore.Components.Web (1)
Microsoft.AspNetCore.Components.WebAssembly (2)
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
Microsoft.AspNetCore.Components.WebView (2)
Microsoft.AspNetCore.Diagnostics (1)
Microsoft.AspNetCore.Grpc.JsonTranscoding (1)
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (4)
Microsoft.AspNetCore.Grpc.Swagger (1)
Microsoft.AspNetCore.Grpc.Swagger.Tests (1)
Microsoft.AspNetCore.Hosting (1)
Microsoft.AspNetCore.Http.Abstractions.Tests (1)
Microsoft.AspNetCore.Http.Extensions (2)
Microsoft.AspNetCore.Http.Extensions.Tests (11)
Microsoft.AspNetCore.Http.Microbenchmarks (1)
Microsoft.AspNetCore.Http.Results.Tests (4)
Microsoft.AspNetCore.Mvc.Core (2)
Microsoft.AspNetCore.Mvc.Core.Test (2)
Microsoft.AspNetCore.Mvc.FunctionalTests (1)
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (1)
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
Microsoft.AspNetCore.SignalR.Common.Tests (1)
Microsoft.AspNetCore.SignalR.Protocols.Json (1)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Microsoft.CodeAnalysis.ExternalAccess.Razor (1)
Microsoft.CodeAnalysis.Features (1)
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Microsoft.DotNet.Build.Tasks.Workloads (1)
Microsoft.DotNet.Internal.SymbolHelper (1)
Microsoft.DotNet.XliffTasks (1)
Microsoft.JSInterop (1)
Microsoft.ML.AutoML.Interactive (4)
Microsoft.ML.AutoML.Tests (4)
Microsoft.ML.GenAI.Phi.Tests (1)
Microsoft.ML.SearchSpace (1)
Microsoft.ML.SearchSpace.Tests (2)
MSBuild (2)
System.Text.Json (3)
Wasm.Performance.Driver (1)
1023 references to JsonSerializerOptions
Aspire.Dashboard (2)
BasicTestApp (1)
BasicWebSite (1)
BasketService (1)
ConfigurationSchemaGenerator (3)
ConfigurationSchemaGenerator.Tests (1)
dotnet-user-jwts (1)
Microsoft.AspNetCore.Authentication.Core.Test (1)
Microsoft.AspNetCore.Components (1)
Microsoft.AspNetCore.Components.Endpoints (2)
Microsoft.AspNetCore.Components.Server (5)
Microsoft.AspNetCore.Components.Web (11)
Microsoft.AspNetCore.Components.WebAssembly (5)
Microsoft.AspNetCore.Components.WebAssembly.Server (1)
Microsoft.AspNetCore.Components.WebAssembly.Tests (1)
Microsoft.AspNetCore.Components.WebView (6)
Microsoft.AspNetCore.Grpc.JsonTranscoding (56)
Internal\JsonRequestHelpers.cs (4)
87public static async ValueTask SendErrorResponse(HttpResponse response, Encoding encoding, Metadata trailers, Status status, JsonSerializerOptions options)
166public static async ValueTask WriteResponseMessage(HttpResponse response, Encoding encoding, object responseBody, JsonSerializerOptions options, CancellationToken cancellationToken)
183public static async ValueTask<TRequest> ReadMessage<TRequest>(JsonTranscodingServerCallContext serverCallContext, JsonSerializerOptions serializerOptions) where TRequest : class
371public static async ValueTask SendMessage<TResponse>(JsonTranscodingServerCallContext serverCallContext, JsonSerializerOptions serializerOptions, TResponse message, CancellationToken cancellationToken) where TResponse : class
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (7)
Microsoft.AspNetCore.Grpc.Microbenchmarks (2)
Microsoft.AspNetCore.Grpc.Swagger (1)
Microsoft.AspNetCore.Hosting (2)
Microsoft.AspNetCore.Http.Abstractions.Tests (3)
Microsoft.AspNetCore.Http.Extensions (19)
Microsoft.AspNetCore.Http.Extensions.Tests (17)
Microsoft.AspNetCore.Http.Microbenchmarks (2)
Microsoft.AspNetCore.Http.Results (7)
Microsoft.AspNetCore.Http.Results.Tests (23)
Microsoft.AspNetCore.Mvc.Core (16)
Microsoft.AspNetCore.Mvc.Core.Test (15)
Microsoft.AspNetCore.Mvc.FunctionalTests (1)
Microsoft.AspNetCore.Mvc.ViewFeatures (4)
Microsoft.AspNetCore.OpenApi (6)
Microsoft.AspNetCore.OpenApi.Tests (3)
Microsoft.AspNetCore.Routing (2)
Microsoft.AspNetCore.Routing.FunctionalTests (5)
Microsoft.AspNetCore.SignalR.Protocols.Json (3)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
Microsoft.CodeAnalysis.EditorFeatures (1)
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
Microsoft.CodeAnalysis.ExternalAccess.Razor (9)
Testing\RazorTestLanguageServerFactory.cs (6)
27internal override IRazorLanguageServerTarget CreateLanguageServer(JsonRpc jsonRpc, JsonSerializerOptions options, IRazorTestCapabilitiesProvider razorCapabilitiesProvider, HostServices hostServices)
32internal IRazorLanguageServerTarget CreateAlwaysActiveVSLanguageServer(JsonRpc jsonRpc, JsonSerializerOptions options, IRazorTestCapabilitiesProvider razorCapabilitiesProvider, HostServices hostServices)
37private IRazorLanguageServerTarget CreateLanguageServerCore(JsonRpc jsonRpc, JsonSerializerOptions options, IRazorTestCapabilitiesProvider razorCapabilitiesProvider, HostServices hostServices, WellKnownLspServerKinds serverKind)
69internal override void AddJsonConverters(JsonSerializerOptions options)
77private readonly JsonSerializerOptions _options;
79public RazorCapabilitiesProvider(IRazorTestCapabilitiesProvider razorTestCapabilitiesProvider, JsonSerializerOptions options)
Microsoft.CodeAnalysis.Features (3)
Microsoft.CodeAnalysis.LanguageServer.Protocol (52)
Microsoft.CommonLanguageServerProtocol.Framework.Package (2)
Microsoft.CommonLanguageServerProtocol.Framework.UnitTests (1)
Microsoft.DotNet.Internal.SymbolHelper (1)
Microsoft.DotNet.XliffTasks (1)
Microsoft.Extensions.Caching.Hybrid (1)
Microsoft.JSInterop (13)
Microsoft.JSInterop.Tests (5)
Microsoft.JSInterop.WebAssembly (2)
Microsoft.ML.AutoML (8)
Microsoft.ML.AutoML.Tests (8)
Microsoft.ML.SearchSpace (11)
Microsoft.ML.SearchSpace.Tests (6)
Microsoft.ML.Tokenizers (8)
Utils\StringSpanOrdinalKey.cs (6)
136public override StringSpanOrdinalKey ReadAsPropertyName(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) =>
139public override void WriteAsPropertyName(Utf8JsonWriter writer, StringSpanOrdinalKey value, JsonSerializerOptions options) =>
142public override StringSpanOrdinalKey Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) => new StringSpanOrdinalKey(reader.GetString()!);
143public override void Write(Utf8JsonWriter writer, StringSpanOrdinalKey value, JsonSerializerOptions options) => writer.WriteStringValue(value.Data!);
148public override Vocabulary Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
169public override void Write(Utf8JsonWriter writer, Vocabulary value, JsonSerializerOptions options) => throw new NotImplementedException();
MSBuild (2)
System.Memory.Data (7)
System.Net.Http.Json (33)
System\Net\Http\Json\HttpClientJsonExtensions.cs (4)
19private static Task<object?> FromJsonAsyncCore(Func<HttpClient, Uri?, CancellationToken, Task<HttpResponseMessage>> getMethod, HttpClient client, Uri? requestUri, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken = default) =>
20FromJsonAsyncCore(getMethod, client, requestUri, static (stream, options, cancellation) => JsonSerializer.DeserializeAsync(stream, options.type, options.options ?? JsonSerializerOptions.Web, cancellation), (type, options), cancellationToken);
24private static Task<TValue?> FromJsonAsyncCore<TValue>(Func<HttpClient, Uri?, CancellationToken, Task<HttpResponseMessage>> getMethod, HttpClient client, Uri? requestUri, JsonSerializerOptions? options, CancellationToken cancellationToken = default) =>
25FromJsonAsyncCore(getMethod, client, requestUri, static (stream, options, cancellation) => JsonSerializer.DeserializeAsync<TValue>(stream, options ?? JsonSerializerOptions.Web, cancellation), options, cancellationToken);
System\Net\Http\Json\HttpClientJsonExtensions.Delete.cs (4)
33public static Task<object?> DeleteFromJsonAsync(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken = default) =>
48public static Task<object?> DeleteFromJsonAsync(this HttpClient client, Uri? requestUri, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken = default) =>
63public static Task<TValue?> DeleteFromJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, JsonSerializerOptions? options, CancellationToken cancellationToken = default) =>
78public static Task<TValue?> DeleteFromJsonAsync<TValue>(this HttpClient client, Uri? requestUri, JsonSerializerOptions? options, CancellationToken cancellationToken = default) =>
System\Net\Http\Json\HttpClientJsonExtensions.Get.cs (4)
23public static Task<object?> GetFromJsonAsync(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken = default) =>
28public static Task<object?> GetFromJsonAsync(this HttpClient client, Uri? requestUri, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken = default) =>
33public static Task<TValue?> GetFromJsonAsync<TValue>(this HttpClient client, [StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, JsonSerializerOptions? options, CancellationToken cancellationToken = default) =>
38public static Task<TValue?> GetFromJsonAsync<TValue>(this HttpClient client, Uri? requestUri, JsonSerializerOptions? options, CancellationToken cancellationToken = default) =>
System\Net\Http\Json\HttpContentJsonExtensions.cs (6)
30public static Task<object?> ReadFromJsonAsync(this HttpContent content, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken = default)
64public static Task<T?> ReadFromJsonAsync<T>(this HttpContent content, JsonSerializerOptions? options, CancellationToken cancellationToken = default)
90private static async Task<object?> ReadFromJsonAsyncCore(HttpContent content, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken)
94return await JsonSerializer.DeserializeAsync(contentStream, type, options ?? JsonSerializerOptions.Web, cancellationToken).ConfigureAwait(false);
100private static async Task<T?> ReadFromJsonAsyncCore<T>(HttpContent content, JsonSerializerOptions? options, CancellationToken cancellationToken)
104return await JsonSerializer.DeserializeAsync<T>(contentStream, options ?? JsonSerializerOptions.Web, cancellationToken).ConfigureAwait(false);
System.Text.Json (609)
System\Text\Json\Serialization\Converters\CastingConverter.cs (9)
44public override T? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
47public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options)
50internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out T? value)
57internal override bool OnTryWrite(Utf8JsonWriter writer, T value, JsonSerializerOptions options, ref WriteStack state)
60public override T ReadAsPropertyName(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
63internal override T ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
66public override void WriteAsPropertyName(Utf8JsonWriter writer, [DisallowNull] T value, JsonSerializerOptions options)
69internal override void WriteAsPropertyNameCore(Utf8JsonWriter writer, T value, JsonSerializerOptions options, bool isWritingExtensionDataProperty)
72internal override T ReadNumberWithCustomHandling(ref Utf8JsonReader reader, JsonNumberHandling handling, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Collection\IAsyncEnumerableOfTConverter.cs (4)
15internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out TAsyncEnumerable value)
31protected override void CreateCollection(ref Utf8JsonReader reader, scoped ref ReadStack state, JsonSerializerOptions options)
36internal override bool OnTryWrite(Utf8JsonWriter writer, TAsyncEnumerable value, JsonSerializerOptions options, ref WriteStack state)
47protected override bool OnWriteResume(Utf8JsonWriter writer, TAsyncEnumerable value, JsonSerializerOptions options, ref WriteStack state)
System\Text\Json\Serialization\Converters\Collection\JsonDictionaryConverter.cs (6)
18protected internal abstract bool OnWriteResume(Utf8JsonWriter writer, TDictionary dictionary, JsonSerializerOptions options, ref WriteStack state);
30protected abstract void Add(TKey key, in TValue value, JsonSerializerOptions options, ref ReadStack state);
36protected virtual void ConvertCollection(ref ReadStack state, JsonSerializerOptions options) { }
75JsonSerializerOptions options,
314static TKey ReadDictionaryKey(JsonConverter<TKey> keyConverter, ref Utf8JsonReader reader, scoped ref ReadStack state, JsonSerializerOptions options)
337JsonSerializerOptions options,
System\Text\Json\Serialization\Converters\Collection\ReadOnlyMemoryConverter.cs (5)
17JsonSerializerOptions options,
35protected override void CreateCollection(ref Utf8JsonReader reader, scoped ref ReadStack state, JsonSerializerOptions options)
41protected override void ConvertCollection(ref ReadStack state, JsonSerializerOptions options)
47protected override bool OnWriteResume(Utf8JsonWriter writer, ReadOnlyMemory<T> value, JsonSerializerOptions options, ref WriteStack state)
52internal static bool OnWriteResume(Utf8JsonWriter writer, ReadOnlySpan<T> value, JsonSerializerOptions options, ref WriteStack state)
System\Text\Json\Serialization\Converters\FSharp\FSharpOptionConverter.cs (4)
33internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out TOption? value)
53internal override bool OnTryWrite(Utf8JsonWriter writer, TOption value, JsonSerializerOptions options, ref WriteStack state)
70public override void Write(Utf8JsonWriter writer, TOption value, JsonSerializerOptions options)
83public override TOption? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\FSharp\FSharpValueOptionConverter.cs (4)
33internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out TValueOption value)
53internal override bool OnTryWrite(Utf8JsonWriter writer, TValueOption value, JsonSerializerOptions options, ref WriteStack state)
71public override void Write(Utf8JsonWriter writer, TValueOption value, JsonSerializerOptions options)
85public override TValueOption Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Object\ObjectConverter.cs (8)
20public sealed override object ReadAsPropertyName(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
26internal sealed override object ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
32public sealed override void Write(Utf8JsonWriter writer, object? value, JsonSerializerOptions options)
44public sealed override void WriteAsPropertyName(Utf8JsonWriter writer, object value, JsonSerializerOptions options)
49internal sealed override void WriteAsPropertyNameCore(Utf8JsonWriter writer, object value, JsonSerializerOptions options, bool isWritingExtensionDataProperty)
81public override object? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
100public override object? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
111internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out object? value)
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.cs (6)
24internal sealed override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, [MaybeNullWhen(false)] out T value)
273protected abstract void InitializeConstructorArgumentCaches(ref ReadStack state, JsonSerializerOptions options);
283private void ReadConstructorArguments(scoped ref ReadStack state, ref Utf8JsonReader reader, JsonSerializerOptions options)
381private bool ReadConstructorArgumentsWithContinuation(scoped ref ReadStack state, ref Utf8JsonReader reader, JsonSerializerOptions options)
573private void BeginRead(scoped ref ReadStack state, JsonSerializerOptions options)
600JsonSerializerOptions options,
System\Text\Json\Serialization\Converters\Value\ByteConverter.cs (5)
17public override byte Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
22public override void Write(Utf8JsonWriter writer, byte value, JsonSerializerOptions options)
27internal override byte ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
33internal override void WriteAsPropertyNameCore(Utf8JsonWriter writer, byte value, JsonSerializerOptions options, bool isWritingExtensionDataProperty)
38internal override byte ReadNumberWithCustomHandling(ref Utf8JsonReader reader, JsonNumberHandling handling, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\DecimalConverter.cs (5)
16public override decimal Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
21public override void Write(Utf8JsonWriter writer, decimal value, JsonSerializerOptions options)
26internal override decimal ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
32internal override void WriteAsPropertyNameCore(Utf8JsonWriter writer, decimal value, JsonSerializerOptions options, bool isWritingExtensionDataProperty)
37internal override decimal ReadNumberWithCustomHandling(ref Utf8JsonReader reader, JsonNumberHandling handling, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\DoubleConverter.cs (5)
17public override double Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
22public override void Write(Utf8JsonWriter writer, double value, JsonSerializerOptions options)
27internal override double ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
33internal override void WriteAsPropertyNameCore(Utf8JsonWriter writer, double value, JsonSerializerOptions options, bool isWritingExtensionDataProperty)
38internal override double ReadNumberWithCustomHandling(ref Utf8JsonReader reader, JsonNumberHandling handling, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (5)
56public EnumConverter(EnumConverterOptions converterOptions, JsonNamingPolicy? namingPolicy, JsonSerializerOptions options)
102public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
132public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options)
181internal override T ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
194internal override void WriteAsPropertyNameCore(Utf8JsonWriter writer, T value, JsonSerializerOptions options, bool isWritingExtensionDataProperty)
System\Text\Json\Serialization\Converters\Value\HalfConverter.cs (5)
21public override Half Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
31public override void Write(Utf8JsonWriter writer, Half value, JsonSerializerOptions options)
72internal override Half ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
78internal override void WriteAsPropertyNameCore(Utf8JsonWriter writer, Half value, JsonSerializerOptions options, bool isWritingExtensionDataProperty)
85internal override Half ReadNumberWithCustomHandling(ref Utf8JsonReader reader, JsonNumberHandling handling, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\Int128Converter.cs (5)
21public override Int128 Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
31public override void Write(Utf8JsonWriter writer, Int128 value, JsonSerializerOptions options)
66internal override Int128 ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
72internal override void WriteAsPropertyNameCore(Utf8JsonWriter writer, Int128 value, JsonSerializerOptions options, bool isWritingExtensionDataProperty)
79internal override Int128 ReadNumberWithCustomHandling(ref Utf8JsonReader reader, JsonNumberHandling handling, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\Int16Converter.cs (5)
17public override short Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
22public override void Write(Utf8JsonWriter writer, short value, JsonSerializerOptions options)
28internal override short ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
34internal override void WriteAsPropertyNameCore(Utf8JsonWriter writer, short value, JsonSerializerOptions options, bool isWritingExtensionDataProperty)
39internal override short ReadNumberWithCustomHandling(ref Utf8JsonReader reader, JsonNumberHandling handling, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\Int32Converter.cs (5)
17public override int Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
22public override void Write(Utf8JsonWriter writer, int value, JsonSerializerOptions options)
28internal override int ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
34internal override void WriteAsPropertyNameCore(Utf8JsonWriter writer, int value, JsonSerializerOptions options, bool isWritingExtensionDataProperty)
39internal override int ReadNumberWithCustomHandling(ref Utf8JsonReader reader, JsonNumberHandling handling, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\Int64Converter.cs (5)
17public override long Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
22public override void Write(Utf8JsonWriter writer, long value, JsonSerializerOptions options)
27internal override long ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
33internal override void WriteAsPropertyNameCore(Utf8JsonWriter writer, long value, JsonSerializerOptions options, bool isWritingExtensionDataProperty)
38internal override long ReadNumberWithCustomHandling(ref Utf8JsonReader reader, JsonNumberHandling handling, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\NullableConverter.cs (5)
28internal override bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out T? value)
50internal override bool OnTryWrite(Utf8JsonWriter writer, T? value, JsonSerializerOptions options, ref WriteStack state)
62public override T? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
73public override void Write(Utf8JsonWriter writer, T? value, JsonSerializerOptions options)
85internal override T? ReadNumberWithCustomHandling(ref Utf8JsonReader reader, JsonNumberHandling numberHandling, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\SByteConverter.cs (5)
17public override sbyte Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
22public override void Write(Utf8JsonWriter writer, sbyte value, JsonSerializerOptions options)
27internal override sbyte ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
33internal override void WriteAsPropertyNameCore(Utf8JsonWriter writer, sbyte value, JsonSerializerOptions options, bool isWritingExtensionDataProperty)
38internal override sbyte ReadNumberWithCustomHandling(ref Utf8JsonReader reader, JsonNumberHandling handling, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\SingleConverter.cs (5)
18public override float Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
23public override void Write(Utf8JsonWriter writer, float value, JsonSerializerOptions options)
28internal override float ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
34internal override void WriteAsPropertyNameCore(Utf8JsonWriter writer, float value, JsonSerializerOptions options, bool isWritingExtensionDataProperty)
39internal override float ReadNumberWithCustomHandling(ref Utf8JsonReader reader, JsonNumberHandling handling, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\UInt128Converter.cs (5)
21public override UInt128 Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
31public override void Write(Utf8JsonWriter writer, UInt128 value, JsonSerializerOptions options)
66internal override UInt128 ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
72internal override void WriteAsPropertyNameCore(Utf8JsonWriter writer, UInt128 value, JsonSerializerOptions options, bool isWritingExtensionDataProperty)
79internal override UInt128 ReadNumberWithCustomHandling(ref Utf8JsonReader reader, JsonNumberHandling handling, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\UInt16Converter.cs (5)
17public override ushort Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
22public override void Write(Utf8JsonWriter writer, ushort value, JsonSerializerOptions options)
28internal override ushort ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
34internal override void WriteAsPropertyNameCore(Utf8JsonWriter writer, ushort value, JsonSerializerOptions options, bool isWritingExtensionDataProperty)
39internal override ushort ReadNumberWithCustomHandling(ref Utf8JsonReader reader, JsonNumberHandling handling, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\UInt32Converter.cs (5)
17public override uint Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
22public override void Write(Utf8JsonWriter writer, uint value, JsonSerializerOptions options)
28internal override uint ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
34internal override void WriteAsPropertyNameCore(Utf8JsonWriter writer, uint value, JsonSerializerOptions options, bool isWritingExtensionDataProperty)
39internal override uint ReadNumberWithCustomHandling(ref Utf8JsonReader reader, JsonNumberHandling handling, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\UInt64Converter.cs (5)
17public override ulong Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
22public override void Write(Utf8JsonWriter writer, ulong value, JsonSerializerOptions options)
27internal override ulong ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
33internal override void WriteAsPropertyNameCore(Utf8JsonWriter writer, ulong value, JsonSerializerOptions options, bool isWritingExtensionDataProperty)
38internal override ulong ReadNumberWithCustomHandling(ref Utf8JsonReader reader, JsonNumberHandling handling, JsonSerializerOptions options)
System\Text\Json\Serialization\JsonConverter.cs (17)
105JsonSerializerOptions options,
113internal virtual JsonTypeInfo CreateJsonTypeInfo(JsonSerializerOptions options)
130JsonSerializerOptions.CheckConverterNullabilityIsSameAsPropertyType(this, typeof(TTarget));
185/// Used in conjunction with <see cref="JsonCollectionConverter{TCollection, TElement}.ConvertCollection(ref ReadStack, JsonSerializerOptions)"/>.
202internal abstract object? ReadAsObject(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options);
203internal abstract bool OnTryReadAsObject(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out object? value);
204internal abstract bool TryReadAsObject(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out object? value);
205internal abstract object? ReadAsPropertyNameAsObject(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options);
206internal abstract object? ReadAsPropertyNameCoreAsObject(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options);
207internal abstract object? ReadNumberWithCustomHandlingAsObject(ref Utf8JsonReader reader, JsonNumberHandling handling, JsonSerializerOptions options);
209internal abstract void WriteAsObject(Utf8JsonWriter writer, object? value, JsonSerializerOptions options);
210internal abstract bool OnTryWriteAsObject(Utf8JsonWriter writer, object? value, JsonSerializerOptions options, ref WriteStack state);
211internal abstract bool TryWriteAsObject(Utf8JsonWriter writer, object? value, JsonSerializerOptions options, ref WriteStack state);
212internal abstract void WriteAsPropertyNameAsObject(Utf8JsonWriter writer, object? value, JsonSerializerOptions options);
213internal abstract void WriteAsPropertyNameCoreAsObject(Utf8JsonWriter writer, object? value, JsonSerializerOptions options, bool isWritingExtensionDataProperty);
229internal virtual void ConfigureJsonTypeInfo(JsonTypeInfo jsonTypeInfo, JsonSerializerOptions options) { }
236internal virtual void ConfigureJsonTypeInfoUsingReflection(JsonTypeInfo jsonTypeInfo, JsonSerializerOptions options) { }
System\Text\Json\Serialization\JsonConverterFactory.cs (14)
28/// <param name="options">The <see cref="JsonSerializerOptions"/> being used.</param>
33public abstract JsonConverter? CreateConverter(Type typeToConvert, JsonSerializerOptions options);
35internal JsonConverter GetConverterInternal(Type typeToConvert, JsonSerializerOptions options)
53internal sealed override object? ReadAsObject(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
63JsonSerializerOptions options,
75JsonSerializerOptions options,
84internal sealed override object? ReadAsPropertyNameAsObject(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
91internal sealed override object? ReadAsPropertyNameCoreAsObject(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
98internal sealed override object? ReadNumberWithCustomHandlingAsObject(ref Utf8JsonReader reader, JsonNumberHandling handling, JsonSerializerOptions options)
105internal sealed override void WriteAsObject(Utf8JsonWriter writer, object? value, JsonSerializerOptions options)
115JsonSerializerOptions options,
126JsonSerializerOptions options,
134internal sealed override void WriteAsPropertyNameAsObject(Utf8JsonWriter writer, object? value, JsonSerializerOptions options)
147JsonSerializerOptions options,
System\Text\Json\Serialization\JsonConverterOfT.cs (29)
55internal sealed override JsonTypeInfo CreateJsonTypeInfo(JsonSerializerOptions options)
77internal sealed override void WriteAsObject(Utf8JsonWriter writer, object? value, JsonSerializerOptions options)
84internal sealed override bool OnTryWriteAsObject(Utf8JsonWriter writer, object? value, JsonSerializerOptions options, ref WriteStack state)
91internal sealed override void WriteAsPropertyNameAsObject(Utf8JsonWriter writer, object? value, JsonSerializerOptions options)
97internal sealed override void WriteAsPropertyNameCoreAsObject(Utf8JsonWriter writer, object? value, JsonSerializerOptions options, bool isWritingExtensionDataProperty)
110internal sealed override bool TryWriteAsObject(Utf8JsonWriter writer, object? value, JsonSerializerOptions options, ref WriteStack state)
121JsonSerializerOptions options,
129internal virtual bool OnTryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out T? value)
143/// <param name="options">The <see cref="JsonSerializerOptions"/> being used.</param>
146public abstract T? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options);
148internal bool TryRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out T? value, out bool isPopulatedValue)
282internal sealed override bool OnTryReadAsObject(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out object? value)
289internal sealed override bool TryReadAsObject(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options, scoped ref ReadStack state, out object? value)
296internal sealed override object? ReadAsObject(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
302internal sealed override object? ReadAsPropertyNameAsObject(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
308internal sealed override object? ReadAsPropertyNameCoreAsObject(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
314internal sealed override object? ReadNumberWithCustomHandlingAsObject(ref Utf8JsonReader reader, JsonNumberHandling handling, JsonSerializerOptions options)
327internal bool TryWrite(Utf8JsonWriter writer, in T? value, JsonSerializerOptions options, ref WriteStack state)
445internal bool TryWriteDataExtensionProperty(Utf8JsonWriter writer, T value, JsonSerializerOptions options, ref WriteStack state)
575/// <param name="options">The <see cref="JsonSerializerOptions"/> being used.</param>
581JsonSerializerOptions options);
588/// <param name="options">The <see cref="JsonSerializerOptions"/> being used.</param>
591public virtual T ReadAsPropertyName(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
603internal virtual T ReadAsPropertyNameCore(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
622/// <param name="options">The <see cref="JsonSerializerOptions"/> being used.</param>
624public virtual void WriteAsPropertyName(Utf8JsonWriter writer, [DisallowNull] T value, JsonSerializerOptions options)
636internal virtual void WriteAsPropertyNameCore(Utf8JsonWriter writer, [DisallowNull] T value, JsonSerializerOptions options, bool isWritingExtensionDataProperty)
661private JsonConverter<T>? GetFallbackConverterForPropertyNameSerialization(JsonSerializerOptions options)
683internal virtual T ReadNumberWithCustomHandling(ref Utf8JsonReader reader, JsonNumberHandling handling, JsonSerializerOptions options)
System\Text\Json\Serialization\JsonSerializer.Write.String.cs (6)
25/// encoding since the implementation internally uses UTF-8. See also <see cref="SerializeToUtf8Bytes{TValue}(TValue, JsonSerializerOptions?)"/>
26/// and <see cref="SerializeAsync{TValue}(IO.Stream, TValue, JsonSerializerOptions?, Threading.CancellationToken)"/>.
30public static string Serialize<TValue>(TValue value, JsonSerializerOptions? options = null)
54/// encoding since the implementation internally uses UTF-8. See also <see cref="SerializeToUtf8Bytes(object?, Type, JsonSerializerOptions?)"/>
55/// and <see cref="SerializeAsync(IO.Stream, object?, Type, JsonSerializerOptions?, Threading.CancellationToken)"/>.
62JsonSerializerOptions? options = null)
System\Text\Json\Serialization\JsonSerializerOptions.cs (29)
31/// Gets a read-only, singleton instance of <see cref="JsonSerializerOptions" /> that uses the default configuration.
34/// Each <see cref="JsonSerializerOptions" /> instance encapsulates its own serialization metadata caches,
38public static JsonSerializerOptions Default
48private static JsonSerializerOptions? s_defaultOptions;
51/// Gets a read-only, singleton instance of <see cref="JsonSerializerOptions" /> that uses the web configuration.
54/// Each <see cref="JsonSerializerOptions" /> instance encapsulates its own serialization metadata caches,
58public static JsonSerializerOptions Web
68private static JsonSerializerOptions? s_webOptions;
102/// Constructs a new <see cref="JsonSerializerOptions"/> instance.
110/// Copies the options from a <see cref="JsonSerializerOptions"/> instance to a new instance.
112/// <param name="options">The <see cref="JsonSerializerOptions"/> instance to copy options from.</param>
116public JsonSerializerOptions(JsonSerializerOptions options)
163/// Constructs a new <see cref="JsonSerializerOptions"/> instance with a predefined set of options determined by the specified <see cref="JsonSerializerDefaults"/>.
183private static void TrackOptionsInstance(JsonSerializerOptions options) => TrackedOptionsInstances.All.Add(options, null);
189public static ConditionalWeakTable<JsonSerializerOptions, object?> All { get; } =
192new ConditionalWeakTable<JsonSerializerOptions, object?>();
196/// Binds current <see cref="JsonSerializerOptions"/> instance with a new instance of the specified <see cref="Serialization.JsonSerializerContext"/> type.
250/// The ordering of the chain is significant: <see cref="JsonSerializerOptions "/> will query each
252/// If all resolvers in the chain return null, then <see cref="JsonSerializerOptions"/> will also return null.
824/// This flag allows users to toggle that behavior as necessary for each <see cref="JsonSerializerOptions"/> instance.
862/// A <see cref="JsonSerializerOptions"/> instance can be locked either if
898/// the semantics of the <see cref="JsonSerializer"/> methods accepting <see cref="JsonSerializerOptions"/> parameters.
1076private readonly JsonSerializerOptions _options;
1078public ConverterList(JsonSerializerOptions options, IList<JsonConverter>? source = null)
1090private readonly JsonSerializerOptions _options;
1092public OptionsBoundJsonTypeInfoResolverChain(JsonSerializerOptions options)
1124private static JsonSerializerOptions GetOrCreateSingleton(
1125ref JsonSerializerOptions? location,
1128var options = new JsonSerializerOptions(defaults)
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Collections.cs (28)
17/// <param name="options">The <see cref="JsonSerializerOptions"/> to use.</param>
21public static JsonTypeInfo<TElement[]> CreateArrayInfo<TElement>(JsonSerializerOptions options, JsonCollectionInfoValues<TElement[]> collectionInfo)
32/// <param name="options">The <see cref="JsonSerializerOptions"/> to use.</param>
37JsonSerializerOptions options,
56JsonSerializerOptions options,
81JsonSerializerOptions options,
110JsonSerializerOptions options,
130JsonSerializerOptions options,
150JsonSerializerOptions options,
176JsonSerializerOptions options,
194JsonSerializerOptions options,
212JsonSerializerOptions options,
230JsonSerializerOptions options,
248JsonSerializerOptions options,
266JsonSerializerOptions options,
284JsonSerializerOptions options,
302JsonSerializerOptions options,
320JsonSerializerOptions options,
338JsonSerializerOptions options,
355JsonSerializerOptions options,
375JsonSerializerOptions options,
393JsonSerializerOptions options,
400JsonSerializerOptions options,
427JsonSerializerOptions options,
439/// <param name="options">The <see cref="JsonSerializerOptions"/> to use.</param>
443public static JsonTypeInfo<Memory<TElement>> CreateMemoryInfo<TElement>(JsonSerializerOptions options, JsonCollectionInfoValues<Memory<TElement>> collectionInfo)
453/// <param name="options">The <see cref="JsonSerializerOptions"/> to use.</param>
457public static JsonTypeInfo<ReadOnlyMemory<TElement>> CreateReadOnlyMemoryInfo<TElement>(JsonSerializerOptions options, JsonCollectionInfoValues<ReadOnlyMemory<TElement>> collectionInfo)
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (16)
42internal JsonTypeInfo(Type type, JsonConverter converter, JsonSerializerOptions options)
436/// Gets the <see cref="JsonSerializerOptions"/> value associated with the current <see cref="JsonTypeInfo" /> instance.
438public JsonSerializerOptions Options { get; }
465/// User-defined custom converters (specified either via <see cref="JsonConverterAttribute"/> or <see cref="JsonSerializerOptions.Converters"/>)
486/// Gets or sets the type-level <see cref="JsonSerializerOptions.NumberHandling"/> override.
892/// <param name="options">The <see cref="JsonSerializerOptions"/> instance the metadata is associated with.</param>
898/// <see cref="JsonSerializerOptions.Converters"/> or the built-in converters for the type.
907public static JsonTypeInfo<T> CreateJsonTypeInfo<T>(JsonSerializerOptions options)
922/// <param name="options">The <see cref="JsonSerializerOptions"/> instance the metadata is associated with.</param>
929/// <see cref="JsonSerializerOptions.Converters"/> or the built-in converters for the type.
938public static JsonTypeInfo CreateJsonTypeInfo(Type type, JsonSerializerOptions options)
961internal static JsonTypeInfo CreateJsonTypeInfo(Type type, JsonConverter converter, JsonSerializerOptions options)
975parameterTypes: [typeof(JsonConverter), typeof(JsonSerializerOptions)],
1037parameterTypes: [typeof(Type), typeof(JsonTypeInfo), typeof(JsonSerializerOptions)],
1048private protected abstract JsonPropertyInfo CreateJsonPropertyInfo(JsonTypeInfo declaringTypeInfo, Type? declaringType, JsonSerializerOptions options);
1064internal ref struct PropertyHierarchyResolutionState(JsonSerializerOptions options)
TestProject.AppHost (1)