74 references to JsonTypeInfoKind
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)
72if (cacheResult && typeInfo.Kind is not JsonTypeInfoKind.None && 196case JsonTypeInfoKind.Object: 262case JsonTypeInfoKind.Enumerable: 312case JsonTypeInfoKind.Dictionary: 340case JsonTypeInfoKind.Union: 399Debug.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) 95if (typeInfo.Kind is not JsonTypeInfoKind.Union) 120Debug.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); 150Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Object); 165Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Object);
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (48)
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) 365/// This property is only meaningful when <see cref="Kind"/> is <see cref="JsonTypeInfoKind.Union"/>. 718/// of kind <see cref="JsonTypeInfoKind.Object"/>. 723/// are metadata-agnostic and thus always resolve to <see cref="JsonTypeInfoKind.None"/>. 725public JsonTypeInfoKind Kind { get; } 782/// Unmapped member handling only supported for <see cref="JsonTypeInfoKind.Object"/>. 798if (Kind != JsonTypeInfoKind.Object) 826/// Unmapped member handling only supported for <see cref="JsonTypeInfoKind.Object"/>. 842if (Kind != JsonTypeInfoKind.Object) 1012if (Kind == JsonTypeInfoKind.Object) 1040if (Kind is JsonTypeInfoKind.Union) 1049if (Kind is JsonTypeInfoKind.Union && 1064Debug.Assert(Kind is JsonTypeInfoKind.Union); 1084Debug.Assert(Kind is JsonTypeInfoKind.Union); 1100Debug.Assert(Kind is JsonTypeInfoKind.Union || PolymorphismOptions is not null); 1113if (Kind is JsonTypeInfoKind.Union) 1546Debug.Assert(Kind == JsonTypeInfoKind.Object); 1658Debug.Assert(Kind == JsonTypeInfoKind.Object); 1716if (Kind is JsonTypeInfoKind.Object or JsonTypeInfoKind.Enumerable or JsonTypeInfoKind.Dictionary) 1796private static JsonTypeInfoKind GetTypeInfoKind(Type type, JsonConverter converter) 1802return JsonTypeInfoKind.None; 1807case ConverterStrategy.Value: return JsonTypeInfoKind.None; 1808case ConverterStrategy.Object: return JsonTypeInfoKind.Object; 1812return Nullable.GetUnderlyingType(type) is null ? JsonTypeInfoKind.Union : JsonTypeInfoKind.None; 1813case ConverterStrategy.Enumerable: return JsonTypeInfoKind.Enumerable; 1814case ConverterStrategy.Dictionary: return JsonTypeInfoKind.Dictionary; 1834public override bool IsReadOnly => _jsonTypeInfo._properties == this && _jsonTypeInfo.IsReadOnly || _jsonTypeInfo.Kind != JsonTypeInfoKind.Object; 1842if (_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)
474public static void ThrowInvalidOperationException_JsonTypeInfoOperationNotPossibleForKind(JsonTypeInfoKind kind) 696else if (typeInfo.Kind is JsonTypeInfoKind.Enumerable or JsonTypeInfoKind.Dictionary)