80 references to JsonTypeInfoKind
Microsoft.AspNetCore.Components.Server (1)
Circuits\ComponentParameterDeserializer.cs (1)
123.GetTypeInfo(parameterType).Kind == JsonTypeInfoKind.Union;
Microsoft.AspNetCore.Components.WebAssembly (1)
Prerendering\WebAssemblyComponentParameterDeserializer.cs (1)
81WebAssemblyComponentSerializationSettings.JsonSerializationOptions.GetTypeInfo(parameterType).Kind == JsonTypeInfoKind.Union)
Microsoft.AspNetCore.OpenApi (4)
Extensions\JsonNodeSchemaExtensions.cs (1)
486if (context.TypeInfo.Kind == JsonTypeInfoKind.Union)
Extensions\JsonTypeInfoExtensions.cs (2)
80if (jsonTypeInfo is JsonTypeInfo { Kind: JsonTypeInfoKind.Enumerable } || type.IsArray) 85if (jsonTypeInfo is JsonTypeInfo { Kind: JsonTypeInfoKind.Dictionary })
Services\Schemas\OpenApiSchemaService.cs (1)
43if (jsonTypeInfo.Kind != JsonTypeInfoKind.Object)
Microsoft.Extensions.AI.Abstractions (3)
Functions\AIFunctionFactory.cs (1)
1061if (returnTypeInfo.Kind is JsonTypeInfoKind.None)
Utilities\AIJsonUtilities.Schema.Create.cs (2)
302if (ctx.TypeInfo.Kind is JsonTypeInfoKind.Enumerable && !objSchema.ContainsKey(ItemsPropertyName)) 554if (ctx.TypeInfo.Kind is JsonTypeInfoKind.Object &&
System.Text.Json (71)
System\Text\Json\Schema\JsonSchemaExporter.cs (6)
73if (cacheResult && typeInfo.Kind is not JsonTypeInfoKind.None && 217case JsonTypeInfoKind.Object: 283case JsonTypeInfoKind.Enumerable: 333case JsonTypeInfoKind.Dictionary: 361case JsonTypeInfoKind.Union: 420Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.None);
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.cs (1)
620Debug.Assert(state.Current.JsonTypeInfo.Kind is JsonTypeInfoKind.Object);
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Helpers.cs (5)
42&& typeInfo.Kind is JsonTypeInfoKind.Object) 55if (typeInfo is { Kind: JsonTypeInfoKind.Object, IsNullable: false }) 71if (typeInfo.Kind is JsonTypeInfoKind.Union) 122if (typeInfo.Kind is not JsonTypeInfoKind.Union) 448Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Object);
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Union.cs (1)
23Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Union);
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Helpers.cs (3)
90Debug.Assert(typeInfo.Kind != JsonTypeInfoKind.None); 151Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Object); 166Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Object);
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (48)
110/// Serialization callbacks are only supported for <see cref="JsonTypeInfoKind.Object"/> metadata. 123if (Kind is not (JsonTypeInfoKind.Object or JsonTypeInfoKind.Enumerable or JsonTypeInfoKind.Dictionary)) 140/// Serialization callbacks are only supported for <see cref="JsonTypeInfoKind.Object"/> metadata. 153if (Kind is not (JsonTypeInfoKind.Object or JsonTypeInfoKind.Enumerable or JsonTypeInfoKind.Dictionary)) 170/// Serialization callbacks are only supported for <see cref="JsonTypeInfoKind.Object"/> metadata. 183if (Kind is not (JsonTypeInfoKind.Object or JsonTypeInfoKind.Enumerable or JsonTypeInfoKind.Dictionary)) 206/// Serialization callbacks are only supported for <see cref="JsonTypeInfoKind.Object"/> metadata. 219if (Kind is not (JsonTypeInfoKind.Object or JsonTypeInfoKind.Enumerable or JsonTypeInfoKind.Dictionary)) 232/// Property is only applicable to metadata of kind <see cref="JsonTypeInfoKind.Object"/>. 310if (Kind == JsonTypeInfoKind.None) 360/// This property is only meaningful when <see cref="Kind"/> is <see cref="JsonTypeInfoKind.Union"/>. 713/// of kind <see cref="JsonTypeInfoKind.Object"/>. 718/// are metadata-agnostic and thus always resolve to <see cref="JsonTypeInfoKind.None"/>. 720public JsonTypeInfoKind Kind { get; } 777/// Unmapped member handling only supported for <see cref="JsonTypeInfoKind.Object"/>. 793if (Kind != JsonTypeInfoKind.Object) 817/// Unmapped member handling only supported for <see cref="JsonTypeInfoKind.Object"/>. 833if (Kind != JsonTypeInfoKind.Object) 1001if (Kind == JsonTypeInfoKind.Object) 1029if (Kind is JsonTypeInfoKind.Union) 1038if (Kind is JsonTypeInfoKind.Union && 1053Debug.Assert(Kind is JsonTypeInfoKind.Union); 1073Debug.Assert(Kind is JsonTypeInfoKind.Union); 1089Debug.Assert(Kind is JsonTypeInfoKind.Union || PolymorphismOptions is not null); 1102if (Kind is JsonTypeInfoKind.Union) 1535Debug.Assert(Kind == JsonTypeInfoKind.Object); 1647Debug.Assert(Kind == JsonTypeInfoKind.Object); 1705if (Kind is JsonTypeInfoKind.Object or JsonTypeInfoKind.Enumerable or JsonTypeInfoKind.Dictionary) 1785private static JsonTypeInfoKind GetTypeInfoKind(Type type, JsonConverter converter) 1791return JsonTypeInfoKind.None; 1796case ConverterStrategy.Value: return JsonTypeInfoKind.None; 1797case ConverterStrategy.Object: return JsonTypeInfoKind.Object; 1801return Nullable.GetUnderlyingType(type) is null ? JsonTypeInfoKind.Union : JsonTypeInfoKind.None; 1802case ConverterStrategy.Enumerable: return JsonTypeInfoKind.Enumerable; 1803case ConverterStrategy.Dictionary: return JsonTypeInfoKind.Dictionary; 1823public override bool IsReadOnly => _jsonTypeInfo._properties == this && _jsonTypeInfo.IsReadOnly || _jsonTypeInfo.Kind != JsonTypeInfoKind.Object; 1831if (_jsonTypeInfo.Kind != JsonTypeInfoKind.Object)
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.cs (1)
64if (Kind == JsonTypeInfoKind.None)
System\Text\Json\Serialization\Metadata\PolymorphicTypeResolver.cs (1)
98if (derivedTypeInfo.JsonTypeInfo.Kind is JsonTypeInfoKind.Object)
System\Text\Json\Serialization\ReadStackFrame.cs (2)
117public bool IsProcessingDictionary() => JsonTypeInfo.Kind is JsonTypeInfoKind.Dictionary; 122public bool IsProcessingEnumerable() => JsonTypeInfo.Kind is JsonTypeInfoKind.Enumerable;
System\Text\Json\ThrowHelper.Serialization.cs (3)
474public static void ThrowInvalidOperationException_JsonTypeInfoOperationNotPossibleForKind(JsonTypeInfoKind kind) 696else if (typeInfo.Kind is JsonTypeInfoKind.Enumerable or JsonTypeInfoKind.Dictionary)