1 type derived from JsonTypeInfo
System.Text.Json (1)
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.cs (1)
13public sealed partial class JsonTypeInfo<T> : JsonTypeInfo
493 references to JsonTypeInfo
Microsoft.AspNetCore.Components.Web (1)
src\Components\Shared\src\JsonSerialization\JsonConverterFactoryTypeInfoResolver.cs (1)
21public JsonTypeInfo? GetTypeInfo(Type type, JsonSerializerOptions options)
Microsoft.AspNetCore.Grpc.JsonTranscoding (4)
Internal\Json\MessageTypeInfoResolver.cs (4)
26public JsonTypeInfo? GetTypeInfo(Type type, JsonSerializerOptions options) 33var typeInfo = JsonTypeInfo.CreateJsonTypeInfo(type, options); 91private JsonPropertyInfo CreatePropertyInfo(JsonTypeInfo typeInfo, string name, FieldDescriptor field, bool isSerializable)
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (1)
ConverterTests\MessageTypeInfoResolverTests.cs (1)
47var typeInfo = resolver.GetTypeInfo(typeof(HelloRequest), new JsonSerializerOptions());
Microsoft.AspNetCore.Http.Extensions (12)
HttpRequestJsonExtensions.cs (1)
136JsonTypeInfo jsonTypeInfo,
HttpResponseJsonExtensions.cs (2)
158JsonTypeInfo jsonTypeInfo, 174static async Task WriteAsJsonAsyncSlow(HttpResponse response, object? value, JsonTypeInfo jsonTypeInfo,
RequestDelegateFactory.cs (5)
1141var jsonTypeInfo = factoryContext.JsonSerializerOptions.GetReadOnlyTypeInfo(typeArg); 1189var jsonTypeInfo = factoryContext.JsonSerializerOptions.GetReadOnlyTypeInfo(typeArg); 1232var jsonTypeInfo = factoryContext.JsonSerializerOptions.GetReadOnlyTypeInfo(returnType); 1298var jsonTypeInfo = factoryContext.JsonSerializerOptions.GetReadOnlyTypeInfo(bodyType); 1374JsonTypeInfo jsonTypeInfo)
src\Shared\Json\JsonSerializerExtensions.cs (4)
13public static bool HasKnownPolymorphism(this JsonTypeInfo jsonTypeInfo) 16public static bool ShouldUseWith(this JsonTypeInfo jsonTypeInfo, [NotNullWhen(false)] Type? runtimeType) 19public static JsonTypeInfo GetReadOnlyTypeInfo(this JsonSerializerOptions options, Type type) 25public static JsonTypeInfo GetRequiredTypeInfo(this JsonSerializerContext context, Type type)
Microsoft.AspNetCore.Http.Extensions.Tests (4)
ProblemDetailsServiceCollectionExtensionsTest.cs (4)
239var pdTypeInfo = jsonOptions.Value.SerializerOptions.GetTypeInfo(typeof(ProblemDetails)); 251public JsonTypeInfo LastProblemDetailsInfo { get; set; } 253public JsonTypeInfo GetTypeInfo(Type type, JsonSerializerOptions options) 257LastProblemDetailsInfo = JsonTypeInfo.CreateJsonTypeInfo<ProblemDetails>(options);
Microsoft.AspNetCore.Http.Results (8)
JsonHttpResultOfT.cs (1)
69internal JsonTypeInfo? JsonTypeInfo { get; init; }
Results.cs (1)
201public static IResult Json(object? data, JsonTypeInfo jsonTypeInfo, string? contentType = null, int? statusCode = null)
ServerSentEventsResult.cs (2)
83var jsonTypeInfo = jsonOptions.SerializerOptions.GetTypeInfo(typeof(T)); 86var typeInfo = jsonTypeInfo.ShouldUseWith(runtimeType)
src\Shared\Json\JsonSerializerExtensions.cs (4)
13public static bool HasKnownPolymorphism(this JsonTypeInfo jsonTypeInfo) 16public static bool ShouldUseWith(this JsonTypeInfo jsonTypeInfo, [NotNullWhen(false)] Type? runtimeType) 19public static JsonTypeInfo GetReadOnlyTypeInfo(this JsonSerializerOptions options, Type type) 25public static JsonTypeInfo GetRequiredTypeInfo(this JsonSerializerContext context, Type type)
Microsoft.AspNetCore.Http.Results.Tests (1)
ResultsTests.cs (1)
984var result = Results.Json(null, StringJsonContext.Default.String as JsonTypeInfo) as JsonHttpResult<object>;
Microsoft.AspNetCore.JsonPatch.SystemTextJson (2)
Internal\PocoAdapter.cs (1)
204var typeInfo = serializerOptions.GetTypeInfo(target.GetType());
JsonPatchDocumentOfT.cs (1)
716var jsonTypeInfo = SerializerOptions.GetTypeInfo(memberExpression.Expression.Type);
Microsoft.AspNetCore.JsonPatch.SystemTextJson.Tests (3)
IntegrationTests\HeterogenousCollectionTests.cs (2)
54public override JsonTypeInfo GetTypeInfo(Type type, JsonSerializerOptions options) 57var jsonTypeInfo = base.GetTypeInfo(type, options);
TestObjectModels\HeterogenousCollection.cs (1)
39public override JsonTypeInfo GetTypeInfo(Type type, JsonSerializerOptions options)
Microsoft.AspNetCore.Mvc.Core (6)
Formatters\SystemTextJsonOutputFormatter.cs (2)
74JsonTypeInfo? jsonTypeInfo = null; 77var declaredTypeJsonInfo = SerializerOptions.GetTypeInfo(context.ObjectType);
src\Shared\Json\JsonSerializerExtensions.cs (4)
13public static bool HasKnownPolymorphism(this JsonTypeInfo jsonTypeInfo) 16public static bool ShouldUseWith(this JsonTypeInfo jsonTypeInfo, [NotNullWhen(false)] Type? runtimeType) 19public static JsonTypeInfo GetReadOnlyTypeInfo(this JsonSerializerOptions options, Type type) 25public static JsonTypeInfo GetRequiredTypeInfo(this JsonSerializerContext context, Type type)
Microsoft.AspNetCore.OpenApi (22)
Extensions\JsonNodeSchemaExtensions.cs (8)
153/// <param name="jsonTypeInfo">The <see cref="JsonTypeInfo"/> associated with the target type.</param> 154internal static void ApplyDefaultValue(this JsonNode schema, object? defaultValue, JsonTypeInfo? jsonTypeInfo) 191internal static void ApplyPrimitiveTypesAndFormats(this JsonNode schema, JsonSchemaExporterContext context, Func<JsonTypeInfo, string?> createSchemaReferenceId) 288/// <param name="jsonTypeInfo">The <see cref="JsonTypeInfo"/> associated with the <see paramref="schema"/>.</param> 289internal static void ApplyParameterInfo(this JsonNode schema, ApiParameterDescription parameterDescription, JsonTypeInfo? jsonTypeInfo) 363internal static void MapPolymorphismOptionsToDiscriminator(this JsonNode schema, JsonSchemaExporterContext context, Func<JsonTypeInfo, string?> createSchemaReferenceId) 383var jsonDerivedType = context.TypeInfo.Options.GetTypeInfo(derivedType.DerivedType); 403internal static void ApplySchemaReferenceId(this JsonNode schema, JsonSchemaExporterContext context, Func<JsonTypeInfo, string?> createSchemaReferenceId)
Extensions\JsonTypeInfoExtensions.cs (4)
47/// <param name="jsonTypeInfo">The <see cref="JsonTypeInfo"/> associated with the target schema.</param> 53internal static string? GetSchemaReferenceId(this JsonTypeInfo jsonTypeInfo, bool isTopLevel = true) 72if (jsonTypeInfo is JsonTypeInfo { Kind: JsonTypeInfoKind.Enumerable } || type.IsArray) 77if (jsonTypeInfo is JsonTypeInfo { Kind: JsonTypeInfoKind.Dictionary })
Services\OpenApiOptions.cs (5)
22/// A default implementation for creating a schema reference ID for a given <see cref="JsonTypeInfo"/>. 24/// <param name="jsonTypeInfo">The <see cref="JsonTypeInfo"/> associated with the schema we are generating a reference ID for.</param> 26public static string? CreateDefaultSchemaReferenceId(JsonTypeInfo jsonTypeInfo) => jsonTypeInfo.GetSchemaReferenceId(); 57/// the provided delegate returns <see langword="null"/>, the schema associated with the <see cref="JsonTypeInfo"/> will always be inlined. 59public Func<JsonTypeInfo, string?> CreateSchemaReferenceId { get; set; } = CreateDefaultSchemaReferenceId;
Services\Schemas\OpenApiSchemaService.cs (1)
283JsonTypeInfo jsonTypeInfo,
Transformers\OpenApiSchemaTransformerContext.cs (4)
16private JsonTypeInfo? _jsonTypeInfo; 31/// Gets the <see cref="JsonTypeInfo"/> associated with the target schema. 33public required JsonTypeInfo JsonTypeInfo { get => _jsonTypeInfo!; init => _jsonTypeInfo = value; } 53internal void UpdateJsonTypeInfo(JsonTypeInfo jsonTypeInfo, JsonPropertyInfo? jsonPropertyInfo)
Microsoft.AspNetCore.OpenApi.Tests (2)
Extensions\JsonTypeInfoExtensionsTests.cs (1)
83var jsonTypeInfo = JsonSerializerOptions.Default.GetTypeInfo(type);
Services\CreateSchemaReferenceIdTests.cs (1)
22string createReferenceId(JsonTypeInfo jsonTypeInfo)
Microsoft.AspNetCore.Routing (4)
src\Shared\Json\JsonSerializerExtensions.cs (4)
13public static bool HasKnownPolymorphism(this JsonTypeInfo jsonTypeInfo) 16public static bool ShouldUseWith(this JsonTypeInfo jsonTypeInfo, [NotNullWhen(false)] Type? runtimeType) 19public static JsonTypeInfo GetReadOnlyTypeInfo(this JsonSerializerOptions options, Type type) 25public static JsonTypeInfo GetRequiredTypeInfo(this JsonSerializerContext context, Type type)
Microsoft.Extensions.AI (4)
Functions\AIFunctionFactory.cs (3)
966JsonTypeInfo? typeInfo = serializerOptions.GetTypeInfo(parameterType); 1019JsonTypeInfo returnTypeInfo; 1133static async ValueTask<object?> SerializeResultAsync(object? result, JsonTypeInfo returnTypeInfo, CancellationToken cancellationToken)
LoggingHelpers.cs (1)
18if (options?.TryGetTypeInfo(typeof(T), out var typeInfo) is true ||
Microsoft.Extensions.AI.Abstractions (29)
src\Shared\JsonSchemaExporter\JsonSchemaExporter.cs (17)
26/// Maps .NET types to JSON schema objects using contract metadata from <see cref="JsonTypeInfo"/> instances. 57JsonTypeInfo typeInfo = options.GetTypeInfo(type); 70public static JsonNode GetJsonSchemaAsNode(this JsonTypeInfo typeInfo, JsonSchemaExporterOptions? exporterOptions = null) 80private static JsonNode MapRootTypeJsonSchema(JsonTypeInfo typeInfo, JsonSchemaExporterOptions exporterOptions) 90JsonTypeInfo typeInfo, 98JsonTypeInfo? parentPolymorphicTypeInfo = null, 163JsonTypeInfo derivedTypeInfo = typeInfo.Options.GetTypeInfo(derivedType.DerivedType); 224JsonTypeInfo elementTypeInfo = typeInfo.Options.GetTypeInfo(nullableElementType); 273JsonTypeInfo propertyTypeInfo = typeInfo.Options.GetTypeInfo(property.PropertyType); 347JsonTypeInfo elementTypeInfo = typeInfo.Options.GetTypeInfo(elementType); 398JsonTypeInfo valueTypeInfo = typeInfo.Options.GetTypeInfo(valueType); 486private readonly Dictionary<(JsonTypeInfo, JsonPropertyInfo?), string[]> _generated = new(); 520(JsonTypeInfo, JsonPropertyInfo?) key = (context.TypeInfo, context.PropertyInfo); 541JsonTypeInfo typeInfo, 542JsonTypeInfo? baseTypeInfo, 701JsonTypeInfo parameterTypeInfo, 730private static JsonSchema GetEnumConverterSchema(JsonTypeInfo typeInfo, JsonConverter converter)
src\Shared\JsonSchemaExporter\JsonSchemaExporter.ReflectionHelpers.cs (3)
36public static Type GetElementType(JsonTypeInfo typeInfo) 43PropertyInfo? elementTypeProperty = typeof(JsonTypeInfo).GetProperty("ElementType", AllInstance); 145JsonTypeInfo typeInfo)
src\Shared\JsonSchemaExporter\JsonSchemaExporterContext.cs (5)
24JsonTypeInfo typeInfo, 25JsonTypeInfo? baseTypeInfo, 47/// Gets the <see cref="JsonTypeInfo"/> for the type being processed. 49public JsonTypeInfo TypeInfo { get; } 59public JsonTypeInfo? BaseTypeInfo { get; }
Utilities\AIJsonSchemaCreateContext.cs (3)
36/// Gets the <see cref="JsonTypeInfo"/> for the type being processed. 38public JsonTypeInfo TypeInfo => _exporterContext.TypeInfo; 43public JsonTypeInfo? BaseTypeInfo => _exporterContext.BaseTypeInfo;
Utilities\AIJsonUtilities.cs (1)
89JsonTypeInfo jti = serializerOptions.GetTypeInfo(typeof(object));
Microsoft.Extensions.AI.Abstractions.Tests (2)
Utilities\AIJsonUtilitiesTests.cs (2)
424JsonTypeInfo typeInfo = options.GetTypeInfo(testData.Type); 719JsonTypeInfo typeInfo = options.GetTypeInfo(testData.Type);
Microsoft.Extensions.AI.Evaluation.Reporting (2)
JsonSerialization\EvaluationContextConverter.cs (2)
68JsonTypeInfo contentsTypeInfo = options.GetTypeInfo(typeof(IReadOnlyList<AIContent>)); 90JsonTypeInfo contentsTypeInfo = options.GetTypeInfo(typeof(IReadOnlyList<AIContent>));
Microsoft.Maui (5)
Core\IHybridWebView.cs (1)
67 JsonTypeInfo?[]? paramJsonTypeInfos = null);
Primitives\HybridWebViewInvokeJavaScriptRequest.cs (4)
6 public class HybridWebViewInvokeJavaScriptRequest(string methodName, JsonTypeInfo? returnTypeJsonTypeInfo, object?[]? paramValues, JsonTypeInfo?[]? paramJsonTypeInfos) 10 public JsonTypeInfo? ReturnTypeJsonTypeInfo { get; } = returnTypeJsonTypeInfo; 12 public JsonTypeInfo?[]? ParamJsonTypeInfos { get; } = paramJsonTypeInfos;
Microsoft.Maui.Controls (2)
HybridWebView\HybridWebView.cs (2)
88 JsonTypeInfo?[]? paramJsonTypeInfos = null) 117 JsonTypeInfo?[]? paramJsonTypeInfos = null)
Shared (25)
JsonSchemaExporter\JsonSchemaExporter.cs (17)
26/// Maps .NET types to JSON schema objects using contract metadata from <see cref="JsonTypeInfo"/> instances. 57JsonTypeInfo typeInfo = options.GetTypeInfo(type); 70public static JsonNode GetJsonSchemaAsNode(this JsonTypeInfo typeInfo, JsonSchemaExporterOptions? exporterOptions = null) 80private static JsonNode MapRootTypeJsonSchema(JsonTypeInfo typeInfo, JsonSchemaExporterOptions exporterOptions) 90JsonTypeInfo typeInfo, 98JsonTypeInfo? parentPolymorphicTypeInfo = null, 163JsonTypeInfo derivedTypeInfo = typeInfo.Options.GetTypeInfo(derivedType.DerivedType); 224JsonTypeInfo elementTypeInfo = typeInfo.Options.GetTypeInfo(nullableElementType); 273JsonTypeInfo propertyTypeInfo = typeInfo.Options.GetTypeInfo(property.PropertyType); 347JsonTypeInfo elementTypeInfo = typeInfo.Options.GetTypeInfo(elementType); 398JsonTypeInfo valueTypeInfo = typeInfo.Options.GetTypeInfo(valueType); 486private readonly Dictionary<(JsonTypeInfo, JsonPropertyInfo?), string[]> _generated = new(); 520(JsonTypeInfo, JsonPropertyInfo?) key = (context.TypeInfo, context.PropertyInfo); 541JsonTypeInfo typeInfo, 542JsonTypeInfo? baseTypeInfo, 701JsonTypeInfo parameterTypeInfo, 730private static JsonSchema GetEnumConverterSchema(JsonTypeInfo typeInfo, JsonConverter converter)
JsonSchemaExporter\JsonSchemaExporter.ReflectionHelpers.cs (3)
36public static Type GetElementType(JsonTypeInfo typeInfo) 43PropertyInfo? elementTypeProperty = typeof(JsonTypeInfo).GetProperty("ElementType", AllInstance); 145JsonTypeInfo typeInfo)
JsonSchemaExporter\JsonSchemaExporterContext.cs (5)
24JsonTypeInfo typeInfo, 25JsonTypeInfo? baseTypeInfo, 47/// Gets the <see cref="JsonTypeInfo"/> for the type being processed. 49public JsonTypeInfo TypeInfo { get; } 59public JsonTypeInfo? BaseTypeInfo { get; }
Shared.Tests (1)
JsonSchemaExporter\JsonSchemaExporterTests.cs (1)
143Assert.Throws<ArgumentNullException>(() => ((JsonTypeInfo)null!).GetJsonSchemaAsNode());
System.Memory.Data (2)
System\BinaryData.cs (2)
391/// <param name="jsonTypeInfo">The <see cref="JsonTypeInfo"/> to use when serializing to JSON.</param> 471/// <param name="jsonTypeInfo">The <see cref="JsonTypeInfo"/> to use when serializing to JSON.</param>
System.Net.Http.Json (4)
System\Net\Http\Json\JsonContent.cs (3)
18private readonly JsonTypeInfo _typeInfo; 24JsonTypeInfo jsonTypeInfo, 96public static JsonContent Create(object? inputValue, JsonTypeInfo jsonTypeInfo, MediaTypeHeaderValue? mediaType = null)
System\Net\Http\Json\JsonHelpers.cs (1)
17internal static JsonTypeInfo GetJsonTypeInfo(Type type, JsonSerializerOptions? options)
System.Text.Json (347)
System\Text\Json\Nodes\JsonValue.cs (1)
79/// <param name="jsonTypeInfo">The <see cref="JsonTypeInfo"/> that will be used to serialize the value.</param>
System\Text\Json\Schema\JsonSchemaExporter.cs (12)
16/// Functionality for exporting JSON schema from serialization contracts defined in <see cref="JsonTypeInfo"/>. 33JsonTypeInfo typeInfo = options.GetTypeInfoInternal(type); 43public static JsonNode GetJsonSchemaAsNode(this JsonTypeInfo typeInfo, JsonSchemaExporterOptions? exporterOptions = null) 58JsonTypeInfo typeInfo, 62JsonTypeInfo? parentPolymorphicTypeInfo = null, 124JsonTypeInfo derivedTypeInfo = typeInfo.Options.GetTypeInfoInternal(derivedType.DerivedType); 182JsonTypeInfo elementTypeInfo = typeInfo.Options.GetTypeInfo(elementConverter.Type!); 383private static bool IsPolymorphicTypeThatSpecifiesItselfAsDerivedType(JsonTypeInfo typeInfo) 401private readonly Dictionary<(JsonTypeInfo, JsonPropertyInfo?), string[]> _generated = new(); 428(JsonTypeInfo TypeInfo, JsonPropertyInfo? PropertyInfo) key = (context.TypeInfo, context.PropertyInfo); 448public JsonSchemaExporterContext CreateContext(JsonTypeInfo typeInfo, JsonPropertyInfo? propertyInfo, JsonTypeInfo? baseTypeInfo)
System\Text\Json\Schema\JsonSchemaExporterContext.cs (6)
16JsonTypeInfo typeInfo, 18JsonTypeInfo? baseTypeInfo, 28/// The <see cref="JsonTypeInfo"/> for the type being processed. 30public JsonTypeInfo TypeInfo { get; } 38/// Gets the <see cref="JsonTypeInfo"/> for polymorphic base type if the schema is being generated for a derived type. 40public JsonTypeInfo? BaseTypeInfo { get; }
System\Text\Json\Serialization\Attributes\JsonObjectCreationHandlingAttribute.cs (1)
17/// that support population will be populated. When default resolvers are used this will be mapped to <see cref="JsonTypeInfo.PreferredPropertyObjectCreationHandling"/>.
System\Text\Json\Serialization\Converters\Collection\DictionaryDefaultConverter.cs (1)
43JsonTypeInfo typeInfo = state.Current.JsonTypeInfo;
System\Text\Json\Serialization\Converters\Collection\DictionaryOfTKeyTValueConverter.cs (1)
46JsonTypeInfo typeInfo = state.Current.JsonTypeInfo;
System\Text\Json\Serialization\Converters\Collection\ICollectionOfTConverter.cs (1)
40internal override void ConfigureJsonTypeInfo(JsonTypeInfo jsonTypeInfo, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Collection\IDictionaryConverter.cs (2)
59JsonTypeInfo typeInfo = state.Current.JsonTypeInfo; 99internal override void ConfigureJsonTypeInfo(JsonTypeInfo jsonTypeInfo, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Collection\IDictionaryOfTKeyTValueConverter.cs (1)
42internal override void ConfigureJsonTypeInfo(JsonTypeInfo jsonTypeInfo, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Collection\IEnumerableConverterFactory.cs (3)
189JsonTypeInfo.ValidateType(elementType!); 197JsonTypeInfo.ValidateType(elementType!); 198JsonTypeInfo.ValidateType(dictionaryKeyType!);
System\Text\Json\Serialization\Converters\Collection\IListConverter.cs (1)
79internal override void ConfigureJsonTypeInfo(JsonTypeInfo jsonTypeInfo, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Collection\IListOfTConverter.cs (1)
40internal override void ConfigureJsonTypeInfo(JsonTypeInfo jsonTypeInfo, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Collection\ImmutableDictionaryOfTKeyTValueConverterWithReflection.cs (1)
24internal override void ConfigureJsonTypeInfoUsingReflection(JsonTypeInfo jsonTypeInfo, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Collection\ImmutableEnumerableOfTConverter.cs (1)
30JsonTypeInfo typeInfo = state.Current.JsonTypeInfo;
System\Text\Json\Serialization\Converters\Collection\ImmutableEnumerableOfTConverterWithReflection.cs (1)
23internal override void ConfigureJsonTypeInfoUsingReflection(JsonTypeInfo jsonTypeInfo, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Collection\ISetOfTConverter.cs (1)
37internal override void ConfigureJsonTypeInfo(JsonTypeInfo jsonTypeInfo, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Collection\JsonCollectionConverter.cs (5)
33JsonTypeInfo typeInfo = state.Current.JsonTypeInfo; 50protected static JsonConverter<TElement> GetElementConverter(JsonTypeInfo elementTypeInfo) 68JsonTypeInfo jsonTypeInfo = state.Current.JsonTypeInfo; 69JsonTypeInfo elementTypeInfo = jsonTypeInfo.ElementTypeInfo!; 306JsonTypeInfo jsonTypeInfo = state.Current.JsonTypeInfo;
System\Text\Json\Serialization\Converters\Collection\JsonDictionaryConverter.cs (6)
48JsonTypeInfo typeInfo = state.Current.JsonTypeInfo; 67protected static JsonConverter<T> GetConverter<T>(JsonTypeInfo typeInfo) 79JsonTypeInfo jsonTypeInfo = state.Current.JsonTypeInfo; 80JsonTypeInfo keyTypeInfo = jsonTypeInfo.KeyTypeInfo!; 81JsonTypeInfo elementTypeInfo = jsonTypeInfo.ElementTypeInfo!; 346JsonTypeInfo jsonTypeInfo = state.Current.JsonTypeInfo;
System\Text\Json\Serialization\Converters\Collection\StackOrQueueConverter.cs (1)
30JsonTypeInfo typeInfo = state.Current.JsonTypeInfo;
System\Text\Json\Serialization\Converters\Collection\StackOrQueueConverterWithReflection.cs (1)
21internal override void ConfigureJsonTypeInfoUsingReflection(JsonTypeInfo jsonTypeInfo, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\JsonMetadataServicesConverter.cs (2)
53JsonTypeInfo jsonTypeInfo = state.Current.JsonTypeInfo; 68internal override void ConfigureJsonTypeInfo(JsonTypeInfo jsonTypeInfo, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Node\JsonObjectConverter.cs (1)
13internal override void ConfigureJsonTypeInfo(JsonTypeInfo jsonTypeInfo, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Object\ObjectConverterFactory.cs (2)
65JsonTypeInfo.ValidateType(parameter.ParameterType); 70Type placeHolderType = JsonTypeInfo.ObjectType;
System\Text\Json\Serialization\Converters\Object\ObjectDefaultConverter.cs (3)
22JsonTypeInfo jsonTypeInfo = state.Current.JsonTypeInfo; 271internal static void PopulatePropertiesFastPath(object obj, JsonTypeInfo jsonTypeInfo, JsonSerializerOptions options, ref Utf8JsonReader reader, scoped ref ReadStack state) 322JsonTypeInfo jsonTypeInfo = state.Current.JsonTypeInfo;
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.cs (2)
26JsonTypeInfo jsonTypeInfo = state.Current.JsonTypeInfo; 575JsonTypeInfo jsonTypeInfo = state.Current.JsonTypeInfo;
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.Large.cs (1)
54JsonTypeInfo typeInfo = state.Current.JsonTypeInfo;
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.Large.Reflection.cs (1)
25internal override void ConfigureJsonTypeInfoUsingReflection(JsonTypeInfo jsonTypeInfo, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.Small.cs (3)
19var createObject = (JsonTypeInfo.ParameterizedConstructorDelegate<T, TArg0, TArg1, TArg2, TArg3>) 91JsonTypeInfo typeInfo = state.Current.JsonTypeInfo; 124internal override void ConfigureJsonTypeInfoUsingReflection(JsonTypeInfo jsonTypeInfo, JsonSerializerOptions options)
System\Text\Json\Serialization\Converters\Value\NullableConverter.cs (1)
36JsonTypeInfo previousTypeInfo = state.Current.JsonTypeInfo;
System\Text\Json\Serialization\JsonConverter.cs (4)
60/// Indicates that the converter can consume the <see cref="JsonTypeInfo.CreateObject"/> delegate. 113internal virtual JsonTypeInfo CreateJsonTypeInfo(JsonSerializerOptions options) 229internal virtual void ConfigureJsonTypeInfo(JsonTypeInfo jsonTypeInfo, JsonSerializerOptions options) { } 236internal virtual void ConfigureJsonTypeInfoUsingReflection(JsonTypeInfo jsonTypeInfo, JsonSerializerOptions options) { }
System\Text\Json\Serialization\JsonConverter.MetadataHandling.cs (4)
14internal JsonConverter? ResolvePolymorphicConverter(JsonTypeInfo jsonTypeInfo, ref ReadStack state) 31if (resolver.TryGetDerivedJsonTypeInfo(state.PolymorphicTypeDiscriminator, out JsonTypeInfo? resolvedType)) 69internal JsonConverter? ResolvePolymorphicConverter(object value, JsonTypeInfo jsonTypeInfo, JsonSerializerOptions options, ref WriteStack state) 96if (resolver.TryGetDerivedJsonTypeInfo(runtimeType, out JsonTypeInfo? derivedJsonTypeInfo, out object? typeDiscriminator))
System\Text\Json\Serialization\JsonConverterOfT.cs (4)
55internal sealed override JsonTypeInfo CreateJsonTypeInfo(JsonSerializerOptions options) 232JsonTypeInfo originalJsonTypeInfo = state.Current.JsonTypeInfo; 377JsonTypeInfo jsonTypeInfo = state.PeekNestedJsonTypeInfo(); 412JsonTypeInfo originalJsonTypeInfo = state.Current.JsonTypeInfo;
System\Text\Json\Serialization\JsonResumableConverterOfT.cs (2)
24JsonTypeInfo jsonTypeInfo = options.GetTypeInfoInternal(typeToConvert); 37JsonTypeInfo typeInfo = options.GetTypeInfoInternal(typeof(T));
System\Text\Json\Serialization\JsonSerializer.Helpers.cs (4)
33private static JsonTypeInfo GetTypeInfo(JsonSerializerOptions? options, Type inputType) 43return inputType == JsonTypeInfo.ObjectType 53private static JsonTypeInfo GetTypeInfo(JsonSerializerContext context, Type inputType) 58JsonTypeInfo? info = context.GetTypeInfo(inputType);
System\Text\Json\Serialization\JsonSerializer.Read.Document.cs (3)
64JsonTypeInfo jsonTypeInfo = GetTypeInfo(options, returnType); 109public static object? Deserialize(this JsonDocument document, JsonTypeInfo jsonTypeInfo) 161JsonTypeInfo jsonTypeInfo = GetTypeInfo(context, returnType);
System\Text\Json\Serialization\JsonSerializer.Read.Element.cs (3)
58JsonTypeInfo jsonTypeInfo = GetTypeInfo(options, returnType); 98public static object? Deserialize(this JsonElement element, JsonTypeInfo jsonTypeInfo) 144JsonTypeInfo jsonTypeInfo = GetTypeInfo(context, returnType);
System\Text\Json\Serialization\JsonSerializer.Read.HandleMetadata.cs (1)
25internal static bool TryReadMetadata(JsonConverter converter, JsonTypeInfo jsonTypeInfo, ref Utf8JsonReader reader, scoped ref ReadStack state)
System\Text\Json\Serialization\JsonSerializer.Read.HandlePropertyName.cs (3)
27JsonTypeInfo jsonTypeInfo = state.Current.JsonTypeInfo; 124genericArgs[1].UnderlyingSystemType == JsonTypeInfo.ObjectType || 135if (jsonPropertyInfo.PropertyType.FullName == JsonTypeInfo.JsonObjectTypeName)
System\Text\Json\Serialization\JsonSerializer.Read.Node.cs (4)
56JsonTypeInfo jsonTypeInfo = GetTypeInfo(options, returnType); 90public static object? Deserialize(this JsonNode? node, JsonTypeInfo jsonTypeInfo) 135JsonTypeInfo jsonTypeInfo = GetTypeInfo(context, returnType); 160private static object? ReadFromNodeAsObject(JsonNode? node, JsonTypeInfo jsonTypeInfo)
System\Text\Json\Serialization\JsonSerializer.Read.Span.cs (4)
62JsonTypeInfo jsonTypeInfo = GetTypeInfo(options, returnType); 96public static object? Deserialize(ReadOnlySpan<byte> utf8Json, JsonTypeInfo jsonTypeInfo) 125/// did not return a compatible <see cref="JsonTypeInfo"/> for <paramref name="returnType"/>. 152private static object? ReadFromSpanAsObject(ReadOnlySpan<byte> utf8Json, JsonTypeInfo jsonTypeInfo, int? actualByteCount = null)
System\Text\Json\Serialization\JsonSerializer.Read.Stream.cs (8)
121JsonTypeInfo jsonTypeInfo = GetTypeInfo(options, returnType); 155JsonTypeInfo jsonTypeInfo = GetTypeInfo(options, returnType); 209JsonTypeInfo jsonTypeInfo, 262JsonTypeInfo jsonTypeInfo) 296/// did not return a compatible <see cref="JsonTypeInfo"/> for <paramref name="returnType"/>. 308JsonTypeInfo jsonTypeInfo = GetTypeInfo(context, returnType); 334/// did not return a compatible <see cref="JsonTypeInfo"/> for <paramref name="returnType"/>. 345JsonTypeInfo jsonTypeInfo = GetTypeInfo(context, returnType);
System\Text\Json\Serialization\JsonSerializer.Read.String.cs (7)
121JsonTypeInfo jsonTypeInfo = GetTypeInfo(options, returnType); 160JsonTypeInfo jsonTypeInfo = GetTypeInfo(options, returnType); 257public static object? Deserialize([StringSyntax(StringSyntaxAttribute.Json)] string json, JsonTypeInfo jsonTypeInfo) 284public static object? Deserialize([StringSyntax(StringSyntaxAttribute.Json)] ReadOnlySpan<char> json, JsonTypeInfo jsonTypeInfo) 333JsonTypeInfo jsonTypeInfo = GetTypeInfo(context, returnType); 377JsonTypeInfo jsonTypeInfo = GetTypeInfo(context, returnType); 412private static object? ReadFromSpanAsObject(ReadOnlySpan<char> json, JsonTypeInfo jsonTypeInfo)
System\Text\Json\Serialization\JsonSerializer.Read.Utf8JsonReader.cs (4)
116JsonTypeInfo jsonTypeInfo = GetTypeInfo(options, returnType); 205public static object? Deserialize(ref Utf8JsonReader reader, JsonTypeInfo jsonTypeInfo) 237/// did not return a compatible <see cref="JsonTypeInfo"/> for <paramref name="returnType"/>. 295private static object? ReadAsObject(ref Utf8JsonReader reader, JsonTypeInfo jsonTypeInfo)
System\Text\Json\Serialization\JsonSerializer.Write.ByteArray.cs (4)
58JsonTypeInfo jsonTypeInfo = GetTypeInfo(options, inputType); 91public static byte[] SerializeToUtf8Bytes(object? value, JsonTypeInfo jsonTypeInfo) 125JsonTypeInfo jsonTypeInfo = GetTypeInfo(context, inputType); 146private static byte[] WriteBytesAsObject(object? value, JsonTypeInfo jsonTypeInfo)
System\Text\Json\Serialization\JsonSerializer.Write.Document.cs (3)
54JsonTypeInfo jsonTypeInfo = GetTypeInfo(options, inputType); 88public static JsonDocument SerializeToDocument(object? value, JsonTypeInfo jsonTypeInfo) 143private static JsonDocument WriteDocumentAsObject(object? value, JsonTypeInfo jsonTypeInfo)
System\Text\Json\Serialization\JsonSerializer.Write.Element.cs (4)
54JsonTypeInfo jsonTypeInfo = GetTypeInfo(options, inputType); 88public static JsonElement SerializeToElement(object? value, JsonTypeInfo jsonTypeInfo) 119JsonTypeInfo typeInfo = GetTypeInfo(context, inputType); 141private static JsonElement WriteElementAsObject(object? value, JsonTypeInfo jsonTypeInfo)
System\Text\Json\Serialization\JsonSerializer.Write.Node.cs (4)
55JsonTypeInfo typeInfo = GetTypeInfo(options, inputType); 89public static JsonNode? SerializeToNode(object? value, JsonTypeInfo jsonTypeInfo) 120JsonTypeInfo jsonTypeInfo = GetTypeInfo(context, inputType); 142private static JsonNode? WriteNodeAsObject(object? value, JsonTypeInfo jsonTypeInfo)
System\Text\Json\Serialization\JsonSerializer.Write.Pipe.cs (3)
87JsonTypeInfo jsonTypeInfo, 127JsonTypeInfo jsonTypeInfo = GetTypeInfo(context, inputType); 163JsonTypeInfo jsonTypeInfo = GetTypeInfo(options, inputType);
System\Text\Json\Serialization\JsonSerializer.Write.Stream.cs (6)
111JsonTypeInfo jsonTypeInfo = GetTypeInfo(options, inputType); 143JsonTypeInfo jsonTypeInfo = GetTypeInfo(options, inputType); 211JsonTypeInfo jsonTypeInfo, 236JsonTypeInfo jsonTypeInfo) 275JsonTypeInfo jsonTypeInfo = GetTypeInfo(context, inputType); 306JsonTypeInfo jsonTypeInfo = GetTypeInfo(context, inputType);
System\Text\Json\Serialization\JsonSerializer.Write.String.cs (6)
65JsonTypeInfo jsonTypeInfo = GetTypeInfo(options, inputType); 104/// encoding since the implementation internally uses UTF-8. See also <see cref="SerializeToUtf8Bytes(object?, JsonTypeInfo)"/> 105/// and <see cref="SerializeAsync(IO.Stream, object?, JsonTypeInfo, Threading.CancellationToken)"/>. 107public static string Serialize(object? value, JsonTypeInfo jsonTypeInfo) 142JsonTypeInfo jsonTypeInfo = GetTypeInfo(context, inputType); 163private static string WriteStringAsObject(object? value, JsonTypeInfo jsonTypeInfo)
System\Text\Json\Serialization\JsonSerializer.Write.Utf8JsonWriter.cs (3)
67JsonTypeInfo jsonTypeInfo = GetTypeInfo(options, inputType); 102public static void Serialize(Utf8JsonWriter writer, object? value, JsonTypeInfo jsonTypeInfo) 138JsonTypeInfo jsonTypeInfo = GetTypeInfo(context, inputType);
System\Text\Json\Serialization\JsonSerializerContext.cs (3)
104/// Returns a <see cref="JsonTypeInfo"/> instance representing the given type. 108public abstract JsonTypeInfo? GetTypeInfo(Type type); 110JsonTypeInfo? IJsonTypeInfoResolver.GetTypeInfo(Type type, JsonSerializerOptions options)
System\Text\Json\Serialization\JsonSerializerOptions.Caching.cs (25)
41private volatile JsonTypeInfo? _lastTypeInfo; 44/// Gets the <see cref="JsonTypeInfo"/> contract metadata resolved by the current <see cref="JsonSerializerOptions"/> instance. 55public JsonTypeInfo GetTypeInfo(Type type) 59if (JsonTypeInfo.IsInvalidForSerialization(type)) 68/// Tries to get the <see cref="JsonTypeInfo"/> contract metadata resolved by the current <see cref="JsonSerializerOptions"/> instance. 80public bool TryGetTypeInfo(Type type, [NotNullWhen(true)] out JsonTypeInfo? typeInfo) 84if (JsonTypeInfo.IsInvalidForSerialization(type)) 97internal JsonTypeInfo? GetTypeInfoInternal( 109JsonTypeInfo? typeInfo = null; 132internal bool TryGetTypeInfoCached(Type type, [NotNullWhen(true)] out JsonTypeInfo? typeInfo) 147internal JsonTypeInfo GetTypeInfoForRootType(Type type, bool fallBackToNearestAncestorType = false) 149JsonTypeInfo? jsonTypeInfo = _lastTypeInfo; 159internal bool TryGetPolymorphicTypeInfoForRootType(object rootValue, [NotNullWhen(true)] out JsonTypeInfo? polymorphicTypeInfo) 164if (runtimeType != JsonTypeInfo.ObjectType) 183internal JsonTypeInfo ObjectTypeInfo 188return _objectTypeInfo ??= GetTypeInfoInternal(JsonTypeInfo.ObjectType); 192private JsonTypeInfo? _objectTypeInfo; 229public JsonTypeInfo? GetOrAddTypeInfo(Type type, bool fallBackToNearestAncestorType = false) 237public bool TryGetTypeInfo(Type type, [NotNullWhen(true)] out JsonTypeInfo? typeInfo) 262JsonTypeInfo? typeInfo = context.Options.GetTypeInfoNoCaching(type); 272private JsonTypeInfo? FallBackToNearestAncestor(Type type, CacheEntry entry) 305if (current == JsonTypeInfo.ObjectType) 362public readonly JsonTypeInfo? TypeInfo; 368public CacheEntry(JsonTypeInfo? typeInfo) 380public JsonTypeInfo? GetResult()
System\Text\Json\Serialization\JsonSerializerOptions.Converters.cs (1)
63JsonTypeInfo jsonTypeInfo = GetTypeInfoInternal(typeToConvert, ensureConfigured: false, resolveIfMutable: true);
System\Text\Json\Serialization\JsonSerializerOptions.cs (6)
210/// Gets or sets the <see cref="JsonTypeInfo"/> contract resolver used by this instance. 244/// Gets the list of chained <see cref="JsonTypeInfo"/> contract resolvers used by this instance. 864/// Read-only instances use caching when querying <see cref="JsonConverter"/> and <see cref="JsonTypeInfo"/> metadata. 981private JsonTypeInfo? GetTypeInfoNoCaching(Type type) 989JsonTypeInfo? info = resolver.GetTypeInfo(type, this); 1007if (type == JsonTypeInfo.ObjectType)
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.cs (8)
41/// <returns>A <see cref="JsonTypeInfo"/> defining a reflection-derived JSON contract for <paramref name="type"/>.</returns> 51public virtual JsonTypeInfo GetTypeInfo(Type type, JsonSerializerOptions options) 58JsonTypeInfo.ValidateType(type); 59JsonTypeInfo typeInfo = CreateJsonTypeInfo(type, options); 68foreach (Action<JsonTypeInfo> modifier in _modifiers) 79private static JsonTypeInfo CreateJsonTypeInfo(Type type, JsonSerializerOptions options) 93public IList<Action<JsonTypeInfo>> Modifiers => _modifiers ??= new ModifierCollection(this); 96private sealed class ModifierCollection : ConfigurationList<Action<JsonTypeInfo>>
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Helpers.cs (13)
46private static JsonTypeInfo CreateTypeInfoCore(Type type, JsonConverter converter, JsonSerializerOptions options) 48JsonTypeInfo typeInfo = JsonTypeInfo.CreateJsonTypeInfo(type, converter, options); 96private static void PopulateProperties(JsonTypeInfo typeInfo, NullabilityInfoContext nullabilityCtx) 105JsonTypeInfo.PropertyHierarchyResolutionState state = new(typeInfo.Options); 110if (currentType == JsonTypeInfo.ObjectType || 141JsonTypeInfo typeInfo, 145ref JsonTypeInfo.PropertyHierarchyResolutionState state) 201JsonTypeInfo typeInfo, 207ref JsonTypeInfo.PropertyHierarchyResolutionState state) 223JsonTypeInfo typeInfo, 233if (JsonTypeInfo.IsInvalidForSerialization(typeToConvert)) 286private static void PopulateParameterInfoValues(JsonTypeInfo typeInfo, NullabilityInfoContext nullabilityCtx)
System\Text\Json\Serialization\Metadata\IJsonTypeInfoResolver.cs (3)
12/// Resolves a <see cref="JsonTypeInfo"/> contract for the requested type and options. 17/// A <see cref="JsonTypeInfo"/> instance matching the requested type, 20JsonTypeInfo? GetTypeInfo(Type type, JsonSerializerOptions options);
System\Text\Json\Serialization\Metadata\JsonCollectionInfoValuesOfTCollection.cs (4)
23/// If a dictionary type, the <see cref="JsonTypeInfo"/> instance representing the key type. 26public JsonTypeInfo? KeyInfo { get; init; } 29/// A <see cref="JsonTypeInfo"/> instance representing the element type. 32public JsonTypeInfo ElementInfo { get; init; } = null!;
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Helpers.cs (6)
44typeInfo.CreateObjectForExtensionDataProperty = ((JsonTypeInfo)typeInfo).CreateObject; 116private static void PopulateParameterInfoValues(JsonTypeInfo typeInfo, Func<JsonParameterInfoValues[]?>? paramFactory) 131internal static void PopulateProperties(JsonTypeInfo typeInfo, JsonTypeInfo.JsonPropertyInfoList propertyList, Func<JsonSerializerContext, JsonPropertyInfo[]> propInitFunc) 135Debug.Assert(typeInfo.Type != JsonTypeInfo.ObjectType); 143JsonTypeInfo.PropertyHierarchyResolutionState state = new(typeInfo.Options);
System\Text\Json\Serialization\Metadata\JsonParameterInfo.cs (1)
124internal JsonTypeInfo JsonTypeInfo => MatchingProperty.JsonTypeInfo;
System\Text\Json\Serialization\Metadata\JsonPolymorphismOptions.cs (4)
38/// The parent <see cref="JsonTypeInfo"/> instance has been locked for further modification. 54/// The parent <see cref="JsonTypeInfo"/> instance has been locked for further modification. 71/// The parent <see cref="JsonTypeInfo"/> instance has been locked for further modification. 86internal JsonTypeInfo? DeclaringTypeInfo { get; set; }
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (12)
20internal JsonTypeInfo? DeclaringTypeInfo { get; private set; } 199/// capability of property converter to populate, containing type's <see cref="JsonTypeInfo.PreferredPropertyObjectCreationHandling"/>. 374internal JsonPropertyInfo(Type declaringType, Type propertyType, JsonTypeInfo? declaringTypeInfo, JsonSerializerOptions options) 469private protected abstract void DetermineEffectiveConverter(JsonTypeInfo jsonTypeInfo); 733potentialNumberType == JsonTypeInfo.ObjectType; 862object value = converter.Read(ref reader, JsonTypeInfo.ObjectType, Options)!; 883JsonTypeInfo dictionaryValueInfo = 903if (JsonTypeInfo.ElementType == JsonTypeInfo.ObjectType && reader.TokenType == JsonTokenType.Null) 921internal void EnsureChildOf(JsonTypeInfo parent) 953internal JsonTypeInfo JsonTypeInfo 962JsonTypeInfo jsonTypeInfo = _jsonTypeInfo; 972private JsonTypeInfo? _jsonTypeInfo;
System\Text\Json\Serialization\Metadata\JsonPropertyInfoOfT.cs (2)
19internal JsonPropertyInfo(Type declaringType, JsonTypeInfo? declaringTypeInfo, JsonSerializerOptions options) 147private protected override void DetermineEffectiveConverter(JsonTypeInfo jsonTypeInfo)
System\Text\Json\Serialization\Metadata\JsonPropertyInfoValuesOfT.cs (2)
37/// The <see cref="JsonTypeInfo"/> info for the property or field's type. 39public JsonTypeInfo PropertyTypeInfo { get; init; } = null!;
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (37)
78/// The <see cref="JsonTypeInfo"/> instance has been locked for further modification. 109/// The <see cref="JsonTypeInfo"/> instance has been locked for further modification. 139/// The <see cref="JsonTypeInfo"/> instance has been locked for further modification. 169/// The <see cref="JsonTypeInfo"/> instance has been locked for further modification. 205/// The <see cref="JsonTypeInfo"/> instance has been locked for further modification. 291/// <paramref name="value" /> has been associated with a different <see cref="JsonTypeInfo"/> instance. 294/// The <see cref="JsonTypeInfo"/> instance has been locked for further modification. 334/// A <see cref="JsonTypeInfo"/> instance can be locked either if 384internal JsonTypeInfo? ElementTypeInfo 394JsonTypeInfo? elementTypeInfo = _elementTypeInfo; 410internal JsonTypeInfo? KeyTypeInfo 420JsonTypeInfo? keyTypeInfo = _keyTypeInfo; 432private JsonTypeInfo? _elementTypeInfo; 433private JsonTypeInfo? _keyTypeInfo; 436/// Gets the <see cref="JsonSerializerOptions"/> value associated with the current <see cref="JsonTypeInfo" /> instance. 451/// As such, the value of the converter cannot be changed once a <see cref="JsonTypeInfo"/> instance has been created. 471/// Dummy <see cref="JsonPropertyInfo"/> instance corresponding to the declaring type of this <see cref="JsonTypeInfo"/>. 489/// The <see cref="JsonTypeInfo"/> instance has been locked for further modification. 521/// The <see cref="JsonTypeInfo"/> instance has been locked for further modification. 565/// The <see cref="JsonTypeInfo"/> instance has been locked for further modification. 603/// The <see cref="JsonTypeInfo"/> instance has been locked for further modification. 786internal JsonTypeInfo? AncestorPolymorphicType 803private JsonTypeInfo? _ancestorPolymorhicType; 903/// which constrains the type of metadata that can be modified in the <see cref="JsonTypeInfo"/> instance. 916/// Creates a blank <see cref="JsonTypeInfo"/> instance. 920/// <returns>A blank <see cref="JsonTypeInfo"/> instance.</returns> 924/// The returned <see cref="JsonTypeInfo"/> will be blank, with the exception of the 931/// which constrains the type of metadata that can be modified in the <see cref="JsonTypeInfo"/> instance. 935public static JsonTypeInfo CreateJsonTypeInfo(Type type, JsonSerializerOptions options) 951internal static JsonTypeInfo CreateJsonTypeInfo(Type type, JsonConverter converter, JsonSerializerOptions options) 953JsonTypeInfo jsonTypeInfo; 964jsonTypeInfo = (JsonTypeInfo)jsonTypeInfoType.CreateInstanceNoWrapExceptions( 974/// Creates a blank <see cref="JsonPropertyInfo"/> instance for the current <see cref="JsonTypeInfo"/>. 981/// <exception cref="InvalidOperationException">The <see cref="JsonTypeInfo"/> instance has been locked for further modification.</exception> 1007if (Options.TryGetTypeInfoCached(propertyType, out JsonTypeInfo? jsonTypeInfo)) 1020parameterTypes: [typeof(Type), typeof(JsonTypeInfo), typeof(JsonSerializerOptions)], 1031private protected abstract JsonPropertyInfo CreateJsonPropertyInfo(JsonTypeInfo declaringTypeInfo, Type? declaringType, JsonSerializerOptions options);
System\Text\Json\Serialization\Metadata\JsonTypeInfoKind.cs (1)
7/// Determines the kind of contract metadata a given <see cref="JsonTypeInfo"/> is specifying.
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.cs (3)
36/// The <see cref="JsonTypeInfo"/> instance has been locked for further modification. 40/// A parameterless factory is not supported for the current metadata <see cref="JsonTypeInfo.Kind"/>. 150private protected override JsonPropertyInfo CreateJsonPropertyInfo(JsonTypeInfo declaringTypeInfo, Type? declaringType, JsonSerializerOptions options)
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.ReadHelper.cs (2)
96internal JsonTypeInfo? _asyncEnumerableArrayTypeInfo; 97internal JsonTypeInfo? _asyncEnumerableRootLevelValueTypeInfo;
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.WriteHelpers.cs (3)
45Options.TryGetPolymorphicTypeInfoForRootType(rootValue, out JsonTypeInfo? derivedTypeInfo)) 140Options.TryGetPolymorphicTypeInfoForRootType(rootValue, out JsonTypeInfo? derivedTypeInfo)) 290Options.TryGetPolymorphicTypeInfoForRootType(rootValue, out JsonTypeInfo? polymorphicTypeInfo))
System\Text\Json\Serialization\Metadata\JsonTypeInfoResolver.cs (5)
61/// <param name="resolver">The source resolver generating <see cref="JsonTypeInfo"/> metadata.</param> 62/// <param name="modifier">The delegate modifying non-null <see cref="JsonTypeInfo"/> results.</param> 68public static IJsonTypeInfoResolver WithAddedModifier(this IJsonTypeInfoResolver resolver, Action<JsonTypeInfo> modifier) 79/// Gets a resolver that returns null <see cref="JsonTypeInfo"/> for every type. 96public JsonTypeInfo? GetTypeInfo(Type type, JsonSerializerOptions options) => null;
System\Text\Json\Serialization\Metadata\JsonTypeInfoResolverChain.cs (2)
13public JsonTypeInfo? GetTypeInfo(Type type, JsonSerializerOptions options) 17JsonTypeInfo? typeInfo = resolver.GetTypeInfo(type, options);
System\Text\Json\Serialization\Metadata\JsonTypeInfoResolverWithAddedModifiers.cs (7)
11private readonly Action<JsonTypeInfo>[] _modifiers; 13public JsonTypeInfoResolverWithAddedModifiers(IJsonTypeInfoResolver source, Action<JsonTypeInfo>[] modifiers) 20public JsonTypeInfoResolverWithAddedModifiers WithAddedModifier(Action<JsonTypeInfo> modifier) 22var newModifiers = new Action<JsonTypeInfo>[_modifiers.Length + 1]; 29public JsonTypeInfo? GetTypeInfo(Type type, JsonSerializerOptions options) 31JsonTypeInfo? typeInfo = _source.GetTypeInfo(type, options); 35foreach (Action<JsonTypeInfo> modifier in _modifiers)
System\Text\Json\Serialization\Metadata\MemberAccessor.cs (1)
16public abstract JsonTypeInfo.ParameterizedConstructorDelegate<T, TArg0, TArg1, TArg2, TArg3>? CreateParameterizedConstructor<T, TArg0, TArg1, TArg2, TArg3>(ConstructorInfo constructor);
System\Text\Json\Serialization\Metadata\PolymorphicTypeResolver.cs (12)
45JsonTypeInfo derivedTypeInfo = options.GetTypeInfoInternal(derivedType); 119public bool TryGetDerivedJsonTypeInfo(Type runtimeType, [NotNullWhen(true)] out JsonTypeInfo? jsonTypeInfo, out object? typeDiscriminator) 163public bool TryGetDerivedJsonTypeInfo(object typeDiscriminator, [NotNullWhen(true)] out JsonTypeInfo? jsonTypeInfo) 191type != JsonTypeInfo.ObjectType; 254internal static JsonTypeInfo? FindNearestPolymorphicBaseType(JsonTypeInfo typeInfo) 264JsonTypeInfo? matchingResult = null; 269JsonTypeInfo? candidateInfo = ResolveAncestorTypeInfo(candidate, typeInfo.Options); 281JsonTypeInfo? candidateInfo = ResolveAncestorTypeInfo(interfaceType, typeInfo.Options); 312static JsonTypeInfo? ResolveAncestorTypeInfo(Type type, JsonSerializerOptions options) 332public DerivedJsonTypeInfo(object? typeDiscriminator, JsonTypeInfo derivedTypeInfo) 341public JsonTypeInfo JsonTypeInfo { get; }
System\Text\Json\Serialization\Metadata\ReflectionEmitCachingMemberAccessor.cs (1)
61public override JsonTypeInfo.ParameterizedConstructorDelegate<T, TArg0, TArg1, TArg2, TArg3>? CreateParameterizedConstructor<T, TArg0, TArg1, TArg2, TArg3>(ConstructorInfo constructor) =>
System\Text\Json\Serialization\Metadata\ReflectionEmitMemberAccessor.cs (6)
38JsonTypeInfo.ObjectType, 110public override JsonTypeInfo.ParameterizedConstructorDelegate<T, TArg0, TArg1, TArg2, TArg3>? 112CreateDelegate<JsonTypeInfo.ParameterizedConstructorDelegate<T, TArg0, TArg1, TArg2, TArg3>>( 168new[] { collectionType, JsonTypeInfo.ObjectType }, 383new[] { JsonTypeInfo.ObjectType }, 391new[] { JsonTypeInfo.ObjectType, memberType },
System\Text\Json\Serialization\Metadata\ReflectionMemberAccessor.cs (2)
73public override JsonTypeInfo.ParameterizedConstructorDelegate<T, TArg0, TArg1, TArg2, TArg3>? 118Type elementType = JsonTypeInfo.ObjectType;
System\Text\Json\Serialization\ReadStack.cs (4)
96internal void Initialize(JsonTypeInfo jsonTypeInfo, bool supportContinuation = false) 125JsonTypeInfo jsonTypeInfo = Current.JsonPropertyInfo?.JsonTypeInfo ?? Current.CtorArgumentState!.JsonParameterInfo!.JsonTypeInfo; 210public JsonConverter InitializePolymorphicReEntry(JsonTypeInfo derivedJsonTypeInfo) 373public JsonTypeInfo GetTopJsonTypeInfoWithParameterizedConstructor()
System\Text\Json\Serialization\ReadStackFrame.cs (5)
46public JsonTypeInfo JsonTypeInfo; 58public JsonTypeInfo? PolymorphicJsonTypeInfo; 61public JsonTypeInfo BaseJsonTypeInfo 141internal void InitializeRequiredPropertiesValidationState(JsonTypeInfo typeInfo) 152internal void ValidateAllRequiredPropertiesAreRead(JsonTypeInfo typeInfo)
System\Text\Json\Serialization\WriteStack.cs (3)
145JsonTypeInfo jsonTypeInfo, 178public readonly JsonTypeInfo PeekNestedJsonTypeInfo() 199JsonTypeInfo jsonTypeInfo = Current.GetNestedJsonTypeInfo();
System\Text\Json\Serialization\WriteStackFrame.cs (8)
36/// For objects, it is either the actual (real) JsonPropertyInfo or the <see cref="JsonTypeInfo.PropertyInfoForTypeInfo"/> for the class. 37/// For collections, it is the <see cref="JsonTypeInfo.PropertyInfoForTypeInfo"/> for the class and current element. 49public JsonTypeInfo JsonTypeInfo; 79public JsonTypeInfo? PolymorphicTypeInfo; 108public readonly JsonTypeInfo GetNestedJsonTypeInfo() 118public JsonTypeInfo InitializePolymorphicReEntry(Type runtimeType, JsonSerializerOptions options) 129JsonTypeInfo typeInfo = options.GetTypeInfoInternal(runtimeType, fallBackToNearestAncestorType: true); 140public JsonConverter InitializePolymorphicReEntry(JsonTypeInfo derivedJsonTypeInfo)
System\Text\Json\ThrowHelper.Serialization.cs (3)
291public static void ThrowJsonException_JsonRequiredPropertyMissing(JsonTypeInfo parent, BitArray requiredPropertiesSet) 403JsonTypeInfo jsonTypeInfo = state.GetTopJsonTypeInfoWithParameterizedConstructor(); 621public static void ThrowNotSupportedException_DeserializeNoConstructor(JsonTypeInfo typeInfo, ref Utf8JsonReader reader, scoped ref ReadStack state)