1 write to Kind
System.Text.Json (1)
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (1)
49Kind = GetTypeInfoKind(type, converter);
59 references to Kind
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)
41if (jsonTypeInfo.Kind != JsonTypeInfoKind.Object)
Microsoft.Extensions.AI.Abstractions (6)
Functions\AIFunctionFactory.cs (1)
984if (returnTypeInfo.Kind is JsonTypeInfoKind.None)
src\Shared\JsonSchemaExporter\JsonSchemaExporter.cs (3)
108if (cacheResult && typeInfo.Kind is not JsonTypeInfoKind.None && 237switch (typeInfo.Kind) 426Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.None, "The default case should handle unrecognize type kinds.");
src\Shared\JsonSchemaExporter\JsonSchemaExporter.ReflectionHelpers.cs (2)
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 (5)
JsonSchemaExporter\JsonSchemaExporter.cs (3)
108if (cacheResult && typeInfo.Kind is not JsonTypeInfoKind.None && 237switch (typeInfo.Kind) 426Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.None, "The default case should handle unrecognize type kinds.");
JsonSchemaExporter\JsonSchemaExporter.ReflectionHelpers.cs (2)
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 (45)
System\Text\Json\Schema\JsonSchemaExporter.cs (3)
72if (cacheResult && typeInfo.Kind is not JsonTypeInfoKind.None && 194switch (typeInfo.Kind) 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 (29)
84/// A parameterless factory is not supported for the current metadata <see cref="Kind"/>. 128if (Kind is not (JsonTypeInfoKind.Object or JsonTypeInfoKind.Enumerable or JsonTypeInfoKind.Dictionary)) 130ThrowHelper.ThrowInvalidOperationException_JsonTypeInfoOperationNotPossibleForKind(Kind); 158if (Kind is not (JsonTypeInfoKind.Object or JsonTypeInfoKind.Enumerable or JsonTypeInfoKind.Dictionary)) 160ThrowHelper.ThrowInvalidOperationException_JsonTypeInfoOperationNotPossibleForKind(Kind); 188if (Kind is not (JsonTypeInfoKind.Object or JsonTypeInfoKind.Enumerable or JsonTypeInfoKind.Dictionary)) 190ThrowHelper.ThrowInvalidOperationException_JsonTypeInfoOperationNotPossibleForKind(Kind); 224if (Kind is not (JsonTypeInfoKind.Object or JsonTypeInfoKind.Enumerable or JsonTypeInfoKind.Dictionary)) 226ThrowHelper.ThrowInvalidOperationException_JsonTypeInfoOperationNotPossibleForKind(Kind); 300/// Polymorphic serialization is not supported for the current metadata <see cref="Kind"/>. 315if (Kind == JsonTypeInfoKind.None) 317ThrowHelper.ThrowInvalidOperationException_JsonTypeInfoOperationNotPossibleForKind(Kind); 451/// The <see cref="JsonConverter"/> associated with the type determines the value of <see cref="Kind"/>, 461/// The value of <see cref="Kind"/> determines what aspects of the JSON contract are configurable. 465/// The value of <see cref="Kind"/> is determined exclusively by the <see cref="JsonConverter"/> 543if (Kind != JsonTypeInfoKind.Object) 545ThrowHelper.ThrowInvalidOperationException_JsonTypeInfoOperationNotPossibleForKind(Kind); 587if (Kind != JsonTypeInfoKind.Object) 589ThrowHelper.ThrowInvalidOperationException_JsonTypeInfoOperationNotPossibleForKind(Kind); 756if (Kind == JsonTypeInfoKind.Object) 904/// What converter does get resolved influences the value of <see cref="Kind"/>, 932/// What converter does get resolved influences the value of <see cref="Kind"/>, 1067Debug.Assert(Kind == JsonTypeInfoKind.Object); 1184Debug.Assert(Kind == JsonTypeInfoKind.Object); 1254if (Kind is JsonTypeInfoKind.Object or JsonTypeInfoKind.Enumerable or JsonTypeInfoKind.Dictionary) 1366public override bool IsReadOnly => _jsonTypeInfo._properties == this && _jsonTypeInfo.IsReadOnly || _jsonTypeInfo.Kind != JsonTypeInfoKind.Object; 1374if (_jsonTypeInfo.Kind != JsonTypeInfoKind.Object) 1376ThrowHelper.ThrowInvalidOperationException_JsonTypeInfoOperationNotPossibleForKind(_jsonTypeInfo.Kind); 1445private string DebuggerDisplay => $"Type = {Type.Name}, Kind = {Kind}";
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.cs (3)
40/// A parameterless factory is not supported for the current metadata <see cref="JsonTypeInfo.Kind"/>. 64if (Kind == JsonTypeInfoKind.None) 68ThrowHelper.ThrowInvalidOperationException_JsonTypeInfoOperationNotPossibleForKind(Kind);
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 (1)
672else if (typeInfo.Kind is JsonTypeInfoKind.Enumerable or JsonTypeInfoKind.Dictionary)