44 writes to TypeInfoResolver
Microsoft.AspNetCore.Grpc.JsonTranscoding (1)
Internal\Json\JsonConverterHelper.cs (1)
49
TypeInfoResolver
= typeInfoResolver
Microsoft.AspNetCore.Http.Extensions (1)
JsonOptions.cs (1)
27
TypeInfoResolver
= JsonSerializer.IsReflectionEnabledByDefault ? CreateDefaultTypeResolver() : JsonTypeInfoResolver.Combine()
Microsoft.AspNetCore.Http.Extensions.Tests (22)
HttpRequestJsonExtensionsTests.cs (2)
242
options.
TypeInfoResolver
= new DefaultJsonTypeInfoResolver();
264
options.
TypeInfoResolver
= new DefaultJsonTypeInfoResolver();
HttpResponseJsonExtensionsTests.cs (2)
455
options.
TypeInfoResolver
= new DefaultJsonTypeInfoResolver();
476
options.
TypeInfoResolver
= new DefaultJsonTypeInfoResolver();
ProblemDetailsDefaultWriterTest.cs (7)
169
options.SerializerOptions.
TypeInfoResolver
= ProblemDetailsJsonContext.Default;
209
options.SerializerOptions.
TypeInfoResolver
= JsonTypeInfoResolver.Combine(CustomProblemDetailsContext.Default, CustomProblemDetailsContext2.Default, ProblemDetailsJsonContext.Default);
289
options.SerializerOptions.
TypeInfoResolver
= ProblemDetailsJsonContext.Default;
332
options.SerializerOptions.
TypeInfoResolver
= new DefaultJsonTypeInfoResolver();
375
options.SerializerOptions.
TypeInfoResolver
= CustomProblemDetailsContext.Default;
418
options.SerializerOptions.
TypeInfoResolver
= JsonTypeInfoResolver.Combine(CustomProblemDetailsContext.Default, ProblemDetailsJsonContext.Default);
504
options.SerializerOptions.
TypeInfoResolver
= JsonTypeInfoResolver.Combine(CustomProblemDetailsContext.Default, ProblemDetailsJsonContext.Default);
ProblemDetailsServiceCollectionExtensionsTest.cs (5)
91
collection.ConfigureAll<JsonOptions>(options => options.SerializerOptions.
TypeInfoResolver
= new TestExtensionsJsonContext());
114
options.SerializerOptions.
TypeInfoResolver
= new TestExtensionsJsonContext();
155
collection.ConfigureAll<JsonOptions>(options => options.SerializerOptions.
TypeInfoResolver
= TestExtensionsJsonContext.Default);
177
collection.ConfigureAll<JsonOptions>(options => options.SerializerOptions.
TypeInfoResolver
= null);
197
collection.ConfigureAll<JsonOptions>(options => options.SerializerOptions.
TypeInfoResolver
= new DefaultJsonTypeInfoResolver());
RequestDelegateFactoryTests.cs (1)
1405
.ConfigureHttpJsonOptions(o => o.SerializerOptions.
TypeInfoResolver
= TestJsonContext.Default)
RequestDelegateGenerator\CompileTimeCreationTests.cs (1)
426
serviceCollection.ConfigureHttpJsonOptions(o => o.SerializerOptions.
TypeInfoResolver
= null);
RequestDelegateGenerator\RequestDelegateCreationTests.JsonBodyOrService.cs (1)
216
serviceCollection.ConfigureHttpJsonOptions(o => o.SerializerOptions.
TypeInfoResolver
= SharedTestJsonContext.Default);
RequestDelegateGenerator\RequestDelegateCreationTests.Responses.cs (3)
307
serviceCollection.ConfigureHttpJsonOptions(o => o.SerializerOptions.
TypeInfoResolver
= SharedTestJsonContext.Default);
350
o.SerializerOptions.
TypeInfoResolver
= SharedTestJsonContext.Default;
382
serviceCollection.ConfigureHttpJsonOptions(o => o.SerializerOptions.
TypeInfoResolver
= SharedTestJsonContext.Default);
Microsoft.AspNetCore.Http.Results (1)
JsonHttpResultOfT.cs (1)
41
jsonSerializerOptions.
TypeInfoResolver
??= new DefaultJsonTypeInfoResolver();
Microsoft.AspNetCore.Http.Results.Tests (6)
HttpResultsHelperTests.cs (6)
33
serializerOptions.
TypeInfoResolver
= TestJsonContext.Default;
64
serializerOptions.
TypeInfoResolver
= TestJsonContext.Default;
97
serializerOptions.
TypeInfoResolver
= TestJsonContext.Default;
131
serializerOptions.
TypeInfoResolver
= TestJsonContext.Default;
165
serializerOptions.
TypeInfoResolver
= TestJsonContext.Default;
193
serializerOptions.
TypeInfoResolver
= TestJsonContext.Default;
Microsoft.AspNetCore.Mvc.Core (1)
JsonOptions.cs (1)
45
TypeInfoResolver
= JsonSerializer.IsReflectionEnabledByDefault ? CreateDefaultTypeResolver() : JsonTypeInfoResolver.Combine()
Microsoft.AspNetCore.Mvc.Core.Test (3)
Formatters\SystemTextJsonOutputFormatterTest.cs (3)
174
jsonOptions.JsonSerializerOptions.
TypeInfoResolver
= TestJsonContext.Default;
218
jsonOptions.JsonSerializerOptions.
TypeInfoResolver
= TestJsonContext.Default;
263
jsonOptions.JsonSerializerOptions.
TypeInfoResolver
= null;
Microsoft.AspNetCore.OpenApi (1)
Services\Schemas\OpenApiSchemaService.cs (1)
40
TypeInfoResolver
= jsonOptions.Value.SerializerOptions.TypeInfoResolver?.WithAddedModifier(jsonTypeInfo =>
Microsoft.AspNetCore.OpenApi.Tests (1)
Services\OpenApiSchemaService\OpenApiSchemaService.RequestBodySchemas.cs (1)
494
options.SerializerOptions.
TypeInfoResolver
= options.SerializerOptions.TypeInfoResolver?.WithAddedModifier(jsonTypeInfo =>
Microsoft.Extensions.AI.Abstractions (1)
Utilities\AIJsonUtilities.Defaults.cs (1)
33
TypeInfoResolver
= new DefaultJsonTypeInfoResolver(),
Microsoft.Extensions.AI.Tests (1)
ChatCompletion\DistributedCachingChatClientTest.cs (1)
630
serializerOptions.
TypeInfoResolver
= serializerOptions.TypeInfoResolver!.WithAddedModifier(typeInfo =>
Shared.Tests (2)
JsonSchemaExporter\JsonSchemaExporterTests.cs (2)
31
? new(opts) {
TypeInfoResolver
= Options.TypeInfoResolver }
43
? new(opts) {
TypeInfoResolver
= Options.TypeInfoResolver }
System.Text.Json (3)
System\Text\Json\Serialization\JsonSerializerContext.cs (2)
31
options = new JsonSerializerOptions {
TypeInfoResolver
= this };
43
options.
TypeInfoResolver
= this;
System\Text\Json\Serialization\JsonSerializerOptions.cs (1)
1134
TypeInfoResolver
= JsonSerializer.IsReflectionEnabledByDefault
39 references to TypeInfoResolver
Microsoft.AspNetCore.Http.Extensions.Tests (17)
JsonOptionsTests.cs (4)
26
Assert.NotNull(options.
TypeInfoResolver
);
27
Assert.IsAssignableFrom<IJsonTypeInfoResolver>(options.
TypeInfoResolver
);
44
Assert.NotNull(options.
TypeInfoResolver
);
45
Assert.IsType<DefaultJsonTypeInfoResolver>(options.
TypeInfoResolver
);
ProblemDetailsServiceCollectionExtensionsTest.cs (13)
101
Assert.NotNull(jsonOptions.Value.SerializerOptions.
TypeInfoResolver
);
102
Assert.NotNull(jsonOptions.Value.SerializerOptions.
TypeInfoResolver
.GetTypeInfo(typeof(ProblemDetails), jsonOptions.Value.SerializerOptions));
103
Assert.NotNull(jsonOptions.Value.SerializerOptions.
TypeInfoResolver
.GetTypeInfo(typeof(TypeA), jsonOptions.Value.SerializerOptions));
166
Assert.NotNull(jsonOptions.Value.SerializerOptions.
TypeInfoResolver
);
167
Assert.NotNull(jsonOptions.Value.SerializerOptions.
TypeInfoResolver
.GetTypeInfo(typeof(ProblemDetails), jsonOptions.Value.SerializerOptions));
168
Assert.NotNull(jsonOptions.Value.SerializerOptions.
TypeInfoResolver
.GetTypeInfo(typeof(TypeA), jsonOptions.Value.SerializerOptions));
187
Assert.NotNull(jsonOptions.Value.SerializerOptions.
TypeInfoResolver
);
188
Assert.NotNull(jsonOptions.Value.SerializerOptions.
TypeInfoResolver
.GetTypeInfo(typeof(ProblemDetails), jsonOptions.Value.SerializerOptions));
207
Assert.NotNull(jsonOptions.Value.SerializerOptions.
TypeInfoResolver
);
208
Assert.IsNotType<DefaultJsonTypeInfoResolver>(jsonOptions.Value.SerializerOptions.
TypeInfoResolver
);
209
Assert.NotNull(jsonOptions.Value.SerializerOptions.
TypeInfoResolver
.GetTypeInfo(typeof(ProblemDetails), jsonOptions.Value.SerializerOptions));
210
Assert.NotNull(jsonOptions.Value.SerializerOptions.
TypeInfoResolver
.GetTypeInfo(typeof(TypeA), jsonOptions.Value.SerializerOptions));
232
Assert.NotNull(jsonOptions.Value.SerializerOptions.
TypeInfoResolver
);
Microsoft.AspNetCore.Mvc.Core.Test (6)
Formatters\SystemTextJsonOutputFormatterTest.cs (2)
285
Assert.IsAssignableFrom<IJsonTypeInfoResolver>(stjOutputFormatter.SerializerOptions.
TypeInfoResolver
);
289
Assert.IsType<DefaultJsonTypeInfoResolver>(stjOutputFormatter.SerializerOptions.
TypeInfoResolver
);
JsonOptionsTest.cs (4)
25
Assert.NotNull(options.
TypeInfoResolver
);
26
Assert.IsAssignableFrom<IJsonTypeInfoResolver>(options.
TypeInfoResolver
);
43
Assert.NotNull(options.
TypeInfoResolver
);
44
Assert.IsType<DefaultJsonTypeInfoResolver>(options.
TypeInfoResolver
);
Microsoft.AspNetCore.OpenApi.Tests (1)
Services\OpenApiSchemaService\OpenApiSchemaService.RequestBodySchemas.cs (1)
494
options.SerializerOptions.TypeInfoResolver = options.SerializerOptions.
TypeInfoResolver
?.WithAddedModifier(jsonTypeInfo =>
Microsoft.Extensions.AI.Tests (1)
ChatCompletion\DistributedCachingChatClientTest.cs (1)
630
serializerOptions.TypeInfoResolver = serializerOptions.
TypeInfoResolver
!.WithAddedModifier(typeInfo =>
Shared.Tests (2)
JsonSchemaExporter\JsonSchemaExporterTests.cs (2)
31
? new(opts) { TypeInfoResolver = Options.
TypeInfoResolver
}
43
? new(opts) { TypeInfoResolver = Options.
TypeInfoResolver
}
System.Text.Json (12)
System\Text\Json\Serialization\JsonConverterOfT.cs (1)
667
if (!IsInternalConverter && options.
TypeInfoResolver
is not JsonSerializerContext)
System\Text\Json\Serialization\JsonSerializerOptions.Caching.cs (1)
132
ThrowHelper.ThrowNotSupportedException_NoMetadataForType(type,
TypeInfoResolver
);
System\Text\Json\Serialization\JsonSerializerOptions.cs (8)
254
/// This property is auxiliary to and is kept in sync with the <see cref="
TypeInfoResolver
"/> property.
255
/// Any change made to this property will be reflected by <see cref="
TypeInfoResolver
"/> and vice versa.
848
Debug.Assert(
TypeInfoResolver
!= null);
849
return _canUseFastPathSerializationLogic ??=
TypeInfoResolver
.IsCompatibleWithOptions(this);
875
/// <exception cref="InvalidOperationException">The instance does not specify a <see cref="
TypeInfoResolver
"/> setting.</exception>
890
/// <param name="populateMissingResolver">Populates unconfigured <see cref="
TypeInfoResolver
"/> properties with the reflection-based default.</param>
892
/// The instance does not specify a <see cref="
TypeInfoResolver
"/> setting. Thrown if <paramref name="populateMissingResolver"/> is <see langword="false"/>.
1145
private string DebuggerDisplay => $"TypeInfoResolver = {(
TypeInfoResolver
?.ToString() ?? "<null>")}, IsReadOnly = {IsReadOnly}";
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Helpers.cs (1)
141
JsonSerializerContext? context = typeInfo.Options.
TypeInfoResolver
as JsonSerializerContext;
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (1)
376
ThrowHelper.ThrowInvalidOperationException_NoMetadataForTypeProperties(Options.
TypeInfoResolver
, Type);