29 instantiations of JsonOptions
Microsoft.AspNetCore.Diagnostics (1)
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (1)
80jsonOptions ??= new JsonOptions();
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.Tests (16)
ProblemDetailsDefaultWriterTest.cs (8)
168var options = new JsonOptions(); 208var options = new JsonOptions(); 288var options = new JsonOptions(); 331var options = new JsonOptions(); 374var options = new JsonOptions(); 417var options = new JsonOptions(); 503var options = new JsonOptions(); 704jsonOptions ??= new JsonOptions();
RequestDelegateFactoryTests.cs (3)
858var jsonOptions = new JsonOptions(); 1344.AddSingleton(Options.Create(new JsonOptions())) 1376.AddSingleton(Options.Create(new JsonOptions()))
RequestDelegateGenerator\RequestDelegateCreationTests.BindAsync.cs (2)
219var jsonOptions = new JsonOptions(); 275var jsonOptions = new JsonOptions();
RequestDelegateGenerator\RequestDelegateCreationTests.Responses.cs (3)
648.AddSingleton(Options.Create(new JsonOptions())) 671.AddSingleton(Options.Create(new JsonOptions())) 759.AddSingleton(Options.Create(new JsonOptions()))
Microsoft.AspNetCore.Http.Results (1)
HttpResultsHelper.cs (1)
153return httpContext.RequestServices.GetService<IOptions<JsonOptions>>()?.Value ?? new JsonOptions();
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.OpenApi.Tests (2)
Services\OpenApiDocumentServiceTestsBase.cs (2)
88var schemaService = new OpenApiSchemaService("Test", Options.Create(new Microsoft.AspNetCore.Http.Json.JsonOptions()), builder.ServiceProvider, openApiOptions.Object); 129var jsonOptions = builder.ServiceProvider.GetService<IOptions<Microsoft.AspNetCore.Http.Json.JsonOptions>>() ?? Options.Create(new Microsoft.AspNetCore.Http.Json.JsonOptions());
Microsoft.AspNetCore.Routing (1)
RequestDelegateFilterPipelineBuilder.cs (1)
22var jsonOptions = serviceProvider?.GetService<IOptions<JsonOptions>>()?.Value ?? new JsonOptions();
73 references to JsonOptions
Microsoft.AspNetCore.Authentication.BearerToken (4)
BearerTokenConfigureJsonOptions.cs (2)
9internal sealed class BearerTokenConfigureJsonOptions : IConfigureOptions<JsonOptions> 11public void Configure(JsonOptions options)
BearerTokenExtensions.cs (1)
68builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<JsonOptions>, BearerTokenConfigureJsonOptions>());
BearerTokenHandler.cs (1)
86var typeInfo = httpContext.RequestServices.GetService<IOptions<JsonOptions>>()
Microsoft.AspNetCore.Diagnostics (2)
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (2)
53IOptions<JsonOptions>? jsonOptions = null, 77private static ExtensionsExceptionJsonContext CreateSerializationContext(JsonOptions? jsonOptions)
Microsoft.AspNetCore.Http.Extensions (14)
DefaultProblemDetailsWriter.cs (1)
20public DefaultProblemDetailsWriter(IOptions<ProblemDetailsOptions> options, IOptions<JsonOptions> jsonOptions)
HttpJsonServiceExtensions.cs (4)
17/// <see cref="JsonOptions"/> uses default values from <c>JsonSerializerDefaults.Web</c>. 21/// <see cref="JsonOptions"/>, uses default values from <c>JsonSerializerDefaults.Web</c>.</param> 23public static IServiceCollection ConfigureHttpJsonOptions(this IServiceCollection services, Action<JsonOptions> configureOptions) 25services.Configure<JsonOptions>(configureOptions);
HttpRequestJsonExtensions.cs (2)
306return httpContext.RequestServices?.GetService<IOptions<JsonOptions>>()?.Value?.SerializerOptions ?? JsonOptions.DefaultSerializerOptions;
HttpResponseJsonExtensions.cs (2)
345return httpContext.RequestServices?.GetService<IOptions<JsonOptions>>()?.Value?.SerializerOptions ?? JsonOptions.DefaultSerializerOptions;
ProblemDetailsJsonOptionsSetup.cs (2)
15internal sealed class ProblemDetailsJsonOptionsSetup : IConfigureOptions<JsonOptions> 17public void Configure(JsonOptions options)
ProblemDetailsServiceCollectionExtensions.cs (1)
44services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<JsonOptions>, ProblemDetailsJsonOptionsSetup>());
RequestDelegateFactory.cs (2)
276var jsonSerializerOptions = serviceProvider.GetService<IOptions<JsonOptions>>()?.Value.SerializerOptions ?? JsonOptions.DefaultSerializerOptions;
Microsoft.AspNetCore.Http.Extensions.Tests (41)
JsonOptionsTests.cs (2)
23var options = JsonOptions.DefaultSerializerOptions; 41var options = JsonOptions.DefaultSerializerOptions;
ProblemDetailsDefaultWriterTest.cs (10)
13using JsonOptions = Microsoft.AspNetCore.Http.Json.JsonOptions; 19private static readonly JsonSerializerOptions SerializerOptions = JsonOptions.DefaultSerializerOptions; 168var options = new JsonOptions(); 208var options = new JsonOptions(); 288var options = new JsonOptions(); 331var options = new JsonOptions(); 374var options = new JsonOptions(); 417var options = new JsonOptions(); 503var options = new JsonOptions(); 701private static DefaultProblemDetailsWriter GetWriter(ProblemDetailsOptions options = null, JsonOptions jsonOptions = null)
ProblemDetailsServiceCollectionExtensionsTest.cs (23)
12using JsonOptions = Microsoft.AspNetCore.Http.Json.JsonOptions; 30Assert.Single(collection, (sd) => sd.ServiceType == typeof(IConfigureOptions<JsonOptions>) && sd.ImplementationType == typeof(ProblemDetailsJsonOptionsSetup)); 46Assert.Single(collection, (sd) => sd.ServiceType == typeof(IConfigureOptions<JsonOptions>) && sd.ImplementationType == typeof(ProblemDetailsJsonOptionsSetup)); 90collection.AddOptions<JsonOptions>(); 91collection.ConfigureAll<JsonOptions>(options => options.SerializerOptions.TypeInfoResolver = new TestExtensionsJsonContext()); 98var jsonOptions = services.GetService<IOptions<JsonOptions>>(); 111collection.AddOptions<JsonOptions>(); 112collection.ConfigureAll<JsonOptions>(options => 123var jsonOptions = services.GetService<IOptions<JsonOptions>>(); 143collection.AddOptions<JsonOptions>(); 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); 163var jsonOptions = services.GetService<IOptions<JsonOptions>>(); 176collection.AddOptions<JsonOptions>(); 177collection.ConfigureAll<JsonOptions>(options => options.SerializerOptions.TypeInfoResolver = null); 184var jsonOptions = services.GetService<IOptions<JsonOptions>>(); 196collection.AddOptions<JsonOptions>(); 197collection.ConfigureAll<JsonOptions>(options => options.SerializerOptions.TypeInfoResolver = new DefaultJsonTypeInfoResolver()); 204var jsonOptions = services.GetService<IOptions<JsonOptions>>(); 218collection.AddOptions<JsonOptions>(); 225collection.ConfigureAll<JsonOptions>(options => options.SerializerOptions.TypeInfoResolverChain.Insert(0, customProblemDetailsResolver)); 229var jsonOptions = services.GetService<IOptions<JsonOptions>>();
RequestDelegateFactoryTests.cs (2)
858var jsonOptions = new JsonOptions(); 864if (t == typeof(IOptions<JsonOptions>))
RequestDelegateGenerator\RequestDelegateCreationTests.BindAsync.cs (4)
219var jsonOptions = new JsonOptions(); 225if (t == typeof(IOptions<JsonOptions>)) 275var jsonOptions = new JsonOptions(); 281if (t == typeof(IOptions<JsonOptions>))
Microsoft.AspNetCore.Http.Results (2)
HttpResultsHelper.cs (2)
150private static JsonOptions ResolveJsonOptions(HttpContext httpContext) 153return httpContext.RequestServices.GetService<IOptions<JsonOptions>>()?.Value ?? new JsonOptions();
Microsoft.AspNetCore.Identity (3)
IdentityBuilderExtensions.cs (1)
102builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<JsonOptions>, IdentityEndpointsJsonOptionsSetup>());
IdentityEndpointsJsonOptionsSetup.cs (2)
10internal sealed class IdentityEndpointsJsonOptionsSetup : IConfigureOptions<JsonOptions> 12public void Configure(JsonOptions options)
Microsoft.AspNetCore.OpenApi (4)
Extensions\OpenApiServiceCollectionExtensions.cs (1)
75services.TryAddEnumerable(ServiceDescriptor.Singleton<IConfigureOptions<JsonOptions>, OpenApiSchemaJsonOptions>());
Schemas\OpenApiSchemaJsonOptions.cs (2)
9internal sealed class OpenApiSchemaJsonOptions : IConfigureOptions<JsonOptions> 11public void Configure(JsonOptions options)
Services\Schemas\OpenApiSchemaService.cs (1)
30IOptions<JsonOptions> jsonOptions,
Microsoft.AspNetCore.OpenApi.Tests (1)
Services\OpenApiDocumentServiceTestsBase.cs (1)
129var jsonOptions = builder.ServiceProvider.GetService<IOptions<Microsoft.AspNetCore.Http.Json.JsonOptions>>() ?? Options.Create(new Microsoft.AspNetCore.Http.Json.JsonOptions());
Microsoft.AspNetCore.Routing (2)
RequestDelegateFilterPipelineBuilder.cs (2)
22var jsonOptions = serviceProvider?.GetService<IOptions<JsonOptions>>()?.Value ?? new JsonOptions();