77 references to JsonTypeInfoKind
Microsoft.AspNetCore.OpenApi (3)
Extensions\JsonTypeInfoExtensions.cs (2)
72if (jsonTypeInfo is JsonTypeInfo { Kind: JsonTypeInfoKind.Enumerable } || type.IsArray) 77if (jsonTypeInfo is JsonTypeInfo { Kind: JsonTypeInfoKind.Dictionary })
Services\Schemas\OpenApiSchemaService.cs (1)
42if (jsonTypeInfo.Kind != JsonTypeInfoKind.Object)
Microsoft.Extensions.AI.Abstractions (9)
Functions\AIFunctionFactory.cs (1)
984if (returnTypeInfo.Kind is JsonTypeInfoKind.None)
src\Shared\JsonSchemaExporter\JsonSchemaExporter.cs (5)
108if (cacheResult && typeInfo.Kind is not JsonTypeInfoKind.None && 239case JsonTypeInfoKind.Object: 345case JsonTypeInfoKind.Enumerable: 396case JsonTypeInfoKind.Dictionary: 426Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.None, "The default case should handle unrecognize type kinds.");
src\Shared\JsonSchemaExporter\JsonSchemaExporter.ReflectionHelpers.cs (3)
38Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Enumerable or JsonTypeInfoKind.Dictionary, "TypeInfo must be of collection type"); 148Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Object, "Should only be passed object JSON kinds.");
Shared (8)
JsonSchemaExporter\JsonSchemaExporter.cs (5)
108if (cacheResult && typeInfo.Kind is not JsonTypeInfoKind.None && 239case JsonTypeInfoKind.Object: 345case JsonTypeInfoKind.Enumerable: 396case JsonTypeInfoKind.Dictionary: 426Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.None, "The default case should handle unrecognize type kinds.");
JsonSchemaExporter\JsonSchemaExporter.ReflectionHelpers.cs (3)
38Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Enumerable or JsonTypeInfoKind.Dictionary, "TypeInfo must be of collection type"); 148Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Object, "Should only be passed object JSON kinds.");
System.Text.Json (57)
System\Text\Json\Schema\JsonSchemaExporter.cs (5)
72if (cacheResult && typeInfo.Kind is not JsonTypeInfoKind.None && 196case JsonTypeInfoKind.Object: 262case JsonTypeInfoKind.Enumerable: 312case JsonTypeInfoKind.Dictionary: 341Debug.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 (2)
72if (typeInfo is { Kind: JsonTypeInfoKind.Object, IsNullable: false }) 99Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Object);
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Helpers.cs (3)
88Debug.Assert(typeInfo.Kind != JsonTypeInfoKind.None); 118Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Object); 133Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Object);
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (39)
115/// Serialization callbacks are only supported for <see cref="JsonTypeInfoKind.Object"/> metadata. 128if (Kind is not (JsonTypeInfoKind.Object or JsonTypeInfoKind.Enumerable or JsonTypeInfoKind.Dictionary)) 145/// Serialization callbacks are only supported for <see cref="JsonTypeInfoKind.Object"/> metadata. 158if (Kind is not (JsonTypeInfoKind.Object or JsonTypeInfoKind.Enumerable or JsonTypeInfoKind.Dictionary)) 175/// Serialization callbacks are only supported for <see cref="JsonTypeInfoKind.Object"/> metadata. 188if (Kind is not (JsonTypeInfoKind.Object or JsonTypeInfoKind.Enumerable or JsonTypeInfoKind.Dictionary)) 211/// Serialization callbacks are only supported for <see cref="JsonTypeInfoKind.Object"/> metadata. 224if (Kind is not (JsonTypeInfoKind.Object or JsonTypeInfoKind.Enumerable or JsonTypeInfoKind.Dictionary)) 237/// Property is only applicable to metadata of kind <see cref="JsonTypeInfoKind.Object"/>. 315if (Kind == JsonTypeInfoKind.None) 463/// of kind <see cref="JsonTypeInfoKind.Object"/>. 468/// are metadata-agnostic and thus always resolve to <see cref="JsonTypeInfoKind.None"/>. 470public JsonTypeInfoKind Kind { get; } 527/// Unmapped member handling only supported for <see cref="JsonTypeInfoKind.Object"/>. 543if (Kind != JsonTypeInfoKind.Object) 571/// Unmapped member handling only supported for <see cref="JsonTypeInfoKind.Object"/>. 587if (Kind != JsonTypeInfoKind.Object) 756if (Kind == JsonTypeInfoKind.Object) 1067Debug.Assert(Kind == JsonTypeInfoKind.Object); 1184Debug.Assert(Kind == JsonTypeInfoKind.Object); 1254if (Kind is JsonTypeInfoKind.Object or JsonTypeInfoKind.Enumerable or JsonTypeInfoKind.Dictionary) 1332private static JsonTypeInfoKind GetTypeInfoKind(Type type, JsonConverter converter) 1338return JsonTypeInfoKind.None; 1343case ConverterStrategy.Value: return JsonTypeInfoKind.None; 1344case ConverterStrategy.Object: return JsonTypeInfoKind.Object; 1345case ConverterStrategy.Enumerable: return JsonTypeInfoKind.Enumerable; 1346case ConverterStrategy.Dictionary: return JsonTypeInfoKind.Dictionary; 1366public override bool IsReadOnly => _jsonTypeInfo._properties == this && _jsonTypeInfo.IsReadOnly || _jsonTypeInfo.Kind != JsonTypeInfoKind.Object; 1374if (_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)
119return JsonTypeInfo.Kind is JsonTypeInfoKind.Dictionary; 127return JsonTypeInfo.Kind is JsonTypeInfoKind.Enumerable;
System\Text\Json\ThrowHelper.Serialization.cs (3)
452public static void ThrowInvalidOperationException_JsonTypeInfoOperationNotPossibleForKind(JsonTypeInfoKind kind) 672else if (typeInfo.Kind is JsonTypeInfoKind.Enumerable or JsonTypeInfoKind.Dictionary)