81 references to SerializerOptions
Microsoft.AspNetCore.Authentication.BearerToken (2)
BearerTokenConfigureJsonOptions.cs (1)
14options.SerializerOptions.TypeInfoResolverChain.Insert(0, BearerTokenJsonSerializerContext.Default);
BearerTokenHandler.cs (1)
87?.Value?.SerializerOptions?.GetTypeInfo(typeof(AccessTokenResponse)) as JsonTypeInfo<AccessTokenResponse>;
Microsoft.AspNetCore.Diagnostics (1)
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (1)
81return new ExtensionsExceptionJsonContext(new JsonSerializerOptions(jsonOptions.SerializerOptions));
Microsoft.AspNetCore.Http.Abstractions.Tests (2)
HttpValidationProblemDetailsJsonConverterTest.cs (1)
12private static JsonSerializerOptions JsonSerializerOptions => new JsonOptions().SerializerOptions;
ProblemDetailsJsonConverterTest.cs (1)
14private static JsonSerializerOptions JsonSerializerOptions => new JsonOptions().SerializerOptions;
Microsoft.AspNetCore.Http.Extensions (5)
DefaultProblemDetailsWriter.cs (1)
23_serializerOptions = jsonOptions.Value.SerializerOptions;
HttpRequestJsonExtensions.cs (1)
306return httpContext.RequestServices?.GetService<IOptions<JsonOptions>>()?.Value?.SerializerOptions ?? JsonOptions.DefaultSerializerOptions;
HttpResponseJsonExtensions.cs (1)
345return httpContext.RequestServices?.GetService<IOptions<JsonOptions>>()?.Value?.SerializerOptions ?? JsonOptions.DefaultSerializerOptions;
ProblemDetailsJsonOptionsSetup.cs (1)
24options.SerializerOptions.TypeInfoResolverChain.Insert(0, new ProblemDetailsJsonContext());
RequestDelegateFactory.cs (1)
276var jsonSerializerOptions = serviceProvider.GetService<IOptions<JsonOptions>>()?.Value.SerializerOptions ?? JsonOptions.DefaultSerializerOptions;
Microsoft.AspNetCore.Http.Extensions.Tests (56)
ProblemDetailsDefaultWriterTest.cs (12)
169options.SerializerOptions.TypeInfoResolver = ProblemDetailsJsonContext.Default; 209options.SerializerOptions.TypeInfoResolver = JsonTypeInfoResolver.Combine(CustomProblemDetailsContext.Default, CustomProblemDetailsContext2.Default, ProblemDetailsJsonContext.Default); 289options.SerializerOptions.TypeInfoResolver = ProblemDetailsJsonContext.Default; 332options.SerializerOptions.TypeInfoResolver = new DefaultJsonTypeInfoResolver(); 359var problemDetails = await JsonSerializer.DeserializeAsync<CustomProblemDetails>(stream, options.SerializerOptions); 375options.SerializerOptions.TypeInfoResolver = CustomProblemDetailsContext.Default; 402var problemDetails = await JsonSerializer.DeserializeAsync<CustomProblemDetails>(stream, options.SerializerOptions); 418options.SerializerOptions.TypeInfoResolver = JsonTypeInfoResolver.Combine(CustomProblemDetailsContext.Default, ProblemDetailsJsonContext.Default); 445var problemDetails = await JsonSerializer.DeserializeAsync<CustomProblemDetails>(stream, options.SerializerOptions); 504options.SerializerOptions.TypeInfoResolver = JsonTypeInfoResolver.Combine(CustomProblemDetailsContext.Default, ProblemDetailsJsonContext.Default); 526var problemDetails = await JsonSerializer.DeserializeAsync<ProblemDetails>(stream, options.SerializerOptions); 533var expectedExtension = JsonSerializer.SerializeToElement(customExtensionData, options.SerializerOptions);
ProblemDetailsServiceCollectionExtensionsTest.cs (34)
91collection.ConfigureAll<JsonOptions>(options => options.SerializerOptions.TypeInfoResolver = new TestExtensionsJsonContext()); 101Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver); 102Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver.GetTypeInfo(typeof(ProblemDetails), jsonOptions.Value.SerializerOptions)); 103Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver.GetTypeInfo(typeof(TypeA), jsonOptions.Value.SerializerOptions)); 114options.SerializerOptions.TypeInfoResolver = new TestExtensionsJsonContext(); 115options.SerializerOptions.MakeReadOnly(); 147collection.ConfigureAll<JsonOptions>(options => options.SerializerOptions.TypeInfoResolverChain.Insert(0, TestExtensionsJsonContext.Default)); 151collection.ConfigureAll<JsonOptions>(options => options.SerializerOptions.TypeInfoResolverChain.Add(TestExtensionsJsonContext.Default)); 155collection.ConfigureAll<JsonOptions>(options => options.SerializerOptions.TypeInfoResolver = TestExtensionsJsonContext.Default); 166Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver); 167Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver.GetTypeInfo(typeof(ProblemDetails), jsonOptions.Value.SerializerOptions)); 168Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver.GetTypeInfo(typeof(TypeA), jsonOptions.Value.SerializerOptions)); 177collection.ConfigureAll<JsonOptions>(options => options.SerializerOptions.TypeInfoResolver = null); 187Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver); 188Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver.GetTypeInfo(typeof(ProblemDetails), jsonOptions.Value.SerializerOptions)); 197collection.ConfigureAll<JsonOptions>(options => options.SerializerOptions.TypeInfoResolver = new DefaultJsonTypeInfoResolver()); 207Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver); 208Assert.IsNotType<DefaultJsonTypeInfoResolver>(jsonOptions.Value.SerializerOptions.TypeInfoResolver); 209Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver.GetTypeInfo(typeof(ProblemDetails), jsonOptions.Value.SerializerOptions)); 210Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver.GetTypeInfo(typeof(TypeA), jsonOptions.Value.SerializerOptions)); 225collection.ConfigureAll<JsonOptions>(options => options.SerializerOptions.TypeInfoResolverChain.Insert(0, customProblemDetailsResolver)); 232Assert.NotNull(jsonOptions.Value.SerializerOptions.TypeInfoResolver); 234Assert.Equal(3, jsonOptions.Value.SerializerOptions.TypeInfoResolverChain.Count); 235Assert.IsType<CustomProblemDetailsTypeInfoResolver>(jsonOptions.Value.SerializerOptions.TypeInfoResolverChain[0]); 236Assert.Equal("Microsoft.AspNetCore.Http.ProblemDetailsJsonContext", jsonOptions.Value.SerializerOptions.TypeInfoResolverChain[1].GetType().FullName); 237Assert.IsType<DefaultJsonTypeInfoResolver>(jsonOptions.Value.SerializerOptions.TypeInfoResolverChain[2]); 239var pdTypeInfo = jsonOptions.Value.SerializerOptions.GetTypeInfo(typeof(ProblemDetails));
RequestDelegateFactoryTests.cs (2)
859jsonOptions.SerializerOptions.Converters.Add(new TodoJsonConverter()); 1405.ConfigureHttpJsonOptions(o => o.SerializerOptions.TypeInfoResolver = TestJsonContext.Default)
RequestDelegateGenerator\CompileTimeCreationTests.cs (1)
426serviceCollection.ConfigureHttpJsonOptions(o => o.SerializerOptions.TypeInfoResolver = null);
RequestDelegateGenerator\RequestDelegateCreationTests.BindAsync.cs (2)
220jsonOptions.SerializerOptions.Converters.Add(new TodoJsonConverter()); 276jsonOptions.SerializerOptions.Converters.Add(new TodoJsonConverter());
RequestDelegateGenerator\RequestDelegateCreationTests.JsonBodyOrService.cs (1)
216serviceCollection.ConfigureHttpJsonOptions(o => o.SerializerOptions.TypeInfoResolver = SharedTestJsonContext.Default);
RequestDelegateGenerator\RequestDelegateCreationTests.Responses.cs (4)
307serviceCollection.ConfigureHttpJsonOptions(o => o.SerializerOptions.TypeInfoResolver = SharedTestJsonContext.Default); 349o.SerializerOptions.TypeInfoResolverChain.Insert(0, SharedTestJsonContext.Default); 350o.SerializerOptions.TypeInfoResolver = SharedTestJsonContext.Default; 382serviceCollection.ConfigureHttpJsonOptions(o => o.SerializerOptions.TypeInfoResolver = SharedTestJsonContext.Default);
Microsoft.AspNetCore.Http.Results (1)
HttpResultsHelper.cs (1)
37jsonSerializerOptions ??= ResolveJsonOptions(httpContext).SerializerOptions;
Microsoft.AspNetCore.Http.Results.Tests (6)
HttpResultsHelperTests.cs (6)
29var serializerOptions = new JsonOptions().SerializerOptions; 60var serializerOptions = new JsonOptions().SerializerOptions; 93var serializerOptions = new JsonOptions().SerializerOptions; 127var serializerOptions = new JsonOptions().SerializerOptions; 161var serializerOptions = new JsonOptions().SerializerOptions; 189var serializerOptions = new JsonOptions().SerializerOptions;
Microsoft.AspNetCore.Identity (1)
IdentityEndpointsJsonOptionsSetup.cs (1)
15options.SerializerOptions.TypeInfoResolverChain.Insert(0, IdentityEndpointsJsonSerializerContext.Default);
Microsoft.AspNetCore.Identity.FunctionalTests (1)
MapIdentityApiTests.cs (1)
137options.SerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower;
Microsoft.AspNetCore.OpenApi (1)
Schemas\OpenApiSchemaJsonOptions.cs (1)
14options.SerializerOptions.TypeInfoResolverChain.Insert(0, OpenApiJsonSchemaContext.Default);
Microsoft.AspNetCore.OpenApi.Tests (4)
Services\OpenApiSchemaService\OpenApiSchemaService.ParameterSchemas.cs (1)
482options.SerializerOptions.Converters.Add(new CustomTypeConverter());
Services\OpenApiSchemaService\OpenApiSchemaService.RequestBodySchemas.cs (2)
494options.SerializerOptions.TypeInfoResolver = options.SerializerOptions.TypeInfoResolver?.WithAddedModifier(jsonTypeInfo =>
Transformers\Implementations\OpenApiSchemaReferenceTransformerTests.cs (1)
429options.SerializerOptions.MaxDepth = 124;
Microsoft.AspNetCore.Routing (1)
RequestDelegateFilterPipelineBuilder.cs (1)
23var jsonSerializerOptions = jsonOptions.SerializerOptions;