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