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.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 (56)
System\Text\Json\Schema\JsonSchemaExporter.cs (3)
72if (cacheResult && typeInfo.Kind is not JsonTypeInfoKind.None && 194switch (typeInfo.Kind) 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 (36)
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); 365/// This property is only meaningful when <see cref="Kind"/> is <see cref="JsonTypeInfoKind.Union"/>. 706/// The <see cref="JsonConverter"/> associated with the type determines the value of <see cref="Kind"/>, 716/// The value of <see cref="Kind"/> determines what aspects of the JSON contract are configurable. 720/// The value of <see cref="Kind"/> is determined exclusively by the <see cref="JsonConverter"/> 798if (Kind != JsonTypeInfoKind.Object) 800ThrowHelper.ThrowInvalidOperationException_JsonTypeInfoOperationNotPossibleForKind(Kind); 842if (Kind != JsonTypeInfoKind.Object) 844ThrowHelper.ThrowInvalidOperationException_JsonTypeInfoOperationNotPossibleForKind(Kind); 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) 1382/// What converter does get resolved influences the value of <see cref="Kind"/>, 1410/// What converter does get resolved influences the value of <see cref="Kind"/>, 1546Debug.Assert(Kind == JsonTypeInfoKind.Object); 1658Debug.Assert(Kind == JsonTypeInfoKind.Object); 1716if (Kind is JsonTypeInfoKind.Object or JsonTypeInfoKind.Enumerable or JsonTypeInfoKind.Dictionary) 1834public override bool IsReadOnly => _jsonTypeInfo._properties == this && _jsonTypeInfo.IsReadOnly || _jsonTypeInfo.Kind != JsonTypeInfoKind.Object; 1842if (_jsonTypeInfo.Kind != JsonTypeInfoKind.Object) 1844ThrowHelper.ThrowInvalidOperationException_JsonTypeInfoOperationNotPossibleForKind(_jsonTypeInfo.Kind); 1913private 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)
696else if (typeInfo.Kind is JsonTypeInfoKind.Enumerable or JsonTypeInfoKind.Dictionary)