209 references to JsonValueKind
ConfigurationSchemaGenerator (1)
ConfigSchemaEmitter.cs (1)
450if (propertyNodeType?.GetValueKind() == JsonValueKind.String && propertyNodeType.GetValue<string>() == "boolean")
Microsoft.AspNetCore.Authentication (1)
JsonDocumentAuthExtensions.cs (1)
21if (element.TryGetProperty(key, out var property) && property.ValueKind != JsonValueKind.Null)
Microsoft.AspNetCore.Authentication.OAuth (5)
JsonKeyClaimAction.cs (3)
39if (value.ValueKind == JsonValueKind.Array) 46else if (value.ValueKind == JsonValueKind.Object || value.ValueKind == JsonValueKind.Undefined)
JsonSubKeyClaimAction.cs (2)
41if (value.ValueKind == JsonValueKind.Array) 58&& value.ValueKind == JsonValueKind.Object
Microsoft.AspNetCore.Authentication.Test (4)
JwtBearerTests.cs (2)
999Assert.Equal(JsonValueKind.Null, dom.RootElement.GetProperty("issued").ValueKind); 1002Assert.Equal(JsonValueKind.String, expiresElement.ValueKind);
JwtBearerTests_Handler.cs (2)
942Assert.Equal(JsonValueKind.Null, dom.RootElement.GetProperty("issued").ValueKind); 945Assert.Equal(JsonValueKind.String, expiresElement.ValueKind);
Microsoft.AspNetCore.Components.Web (16)
JSComponents\JSComponentInterop.cs (6)
122case JsonValueKind.Number: 125case JsonValueKind.String: 128case JsonValueKind.True: 129case JsonValueKind.False: 132case JsonValueKind.Null: 133case JsonValueKind.Undefined:
WebEventData\ChangeEventArgsReader.cs (7)
24case JsonValueKind.Null: 26case JsonValueKind.String: 29case JsonValueKind.True: 30case JsonValueKind.False: 33case JsonValueKind.Array: 57if (arrayElement.ValueKind != JsonValueKind.String) 61$"(expected '{JsonValueKind.String}').");
WebEventData\WebEventDescriptorReader.cs (3)
47if (jsonElement.ValueKind is JsonValueKind.Null) 61if (property.Value.ValueKind is JsonValueKind.True or JsonValueKind.False)
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (17)
ConverterTests\JsonElementComparer.cs (16)
33case JsonValueKind.Null: 34case JsonValueKind.True: 35case JsonValueKind.False: 36case JsonValueKind.Undefined: 44case JsonValueKind.Number: 47case JsonValueKind.String: 58case JsonValueKind.Array: 61case JsonValueKind.Object: 112case JsonValueKind.Null: 113case JsonValueKind.True: 114case JsonValueKind.False: 115case JsonValueKind.Undefined: 118case JsonValueKind.Number: 122case JsonValueKind.String: 126case JsonValueKind.Array: 141case JsonValueKind.Object:
UnaryServerCallHandlerTests.cs (1)
180Assert.Equal(JsonValueKind.Array, responseJson.RootElement.ValueKind);
Microsoft.AspNetCore.Mvc.ViewFeatures (9)
Infrastructure\DefaultTempDataSerializer.cs (9)
34case JsonValueKind.False: 35case JsonValueKind.True: 39case JsonValueKind.Number: 43case JsonValueKind.String: 58case JsonValueKind.Null: 62case JsonValueKind.Array: 66case JsonValueKind.Object: 91if (arrayElement[0].ValueKind == JsonValueKind.String) 102else if (arrayElement[0].ValueKind == JsonValueKind.Number)
Microsoft.AspNetCore.OpenApi (1)
Services\Schemas\OpenApiSchemaService.cs (1)
89if (schema.GetValueKind() == JsonValueKind.True)
Microsoft.CodeAnalysis.Features (3)
PdbSourceDocument\SourceLinkMap.cs (3)
73if (root.ValueKind != JsonValueKind.Object) 86if (rootEntry.Value.ValueKind != JsonValueKind.Object) 93if (documentsEntry.Value.ValueKind != JsonValueKind.String ||
Microsoft.CodeAnalysis.LanguageServer.Protocol (1)
Protocol\Converters\ParameterInformationConverter.cs (1)
25if (labelElement.ValueKind == JsonValueKind.Array)
Microsoft.Extensions.Configuration.Json (8)
JsonConfigurationFileParser.cs (8)
33if (doc.RootElement.ValueKind != JsonValueKind.Object) 87case JsonValueKind.Object: 91case JsonValueKind.Array: 95case JsonValueKind.Number: 96case JsonValueKind.String: 97case JsonValueKind.True: 98case JsonValueKind.False: 99case JsonValueKind.Null:
System.Text.Json (143)
System\Text\Json\Document\JsonElement.cs (64)
42/// The <see cref="JsonValueKind"/> that the value is. 47public JsonValueKind ValueKind => TokenType.ToValueKind(); 51/// <see cref="JsonValueKind.Array"/>. 54/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Array"/>. 77/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Array"/>. 94/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Object"/>. 122/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Object"/>. 168/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Object"/>. 207/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Object"/>. 247/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Object"/>. 288/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Object"/>. 324/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Object"/>. 344/// This value's <see cref="ValueKind"/> is neither <see cref="JsonValueKind.True"/> or 345/// <see cref="JsonValueKind.False"/>. 376/// This value's <see cref="ValueKind"/> is neither <see cref="JsonValueKind.String"/> nor <see cref="JsonValueKind.Null"/>. 401/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.String"/>. 421/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.String"/>. 452/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 470/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 501/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 521/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 551/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 568/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 598/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 619/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 650/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 667/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 697/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 718/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 749/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 769/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 799/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 820/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 860/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 888/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 927/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 955/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 985/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 1006/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 1037/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.String"/>. 1057/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.String"/>. 1088/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.String"/>. 1108/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.String"/>. 1139/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.String"/>. 1159/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.String"/>. 1273JsonValueKind kind = element1.ValueKind; 1281case JsonValueKind.Null or JsonValueKind.False or JsonValueKind.True: 1284case JsonValueKind.Number: 1287case JsonValueKind.String: 1302case JsonValueKind.Array: 1324Debug.Assert(kind is JsonValueKind.Object); 1438/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.String"/>. 1465/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.String"/>. 1494/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.String"/>. 1542/// This value's <see cref="ValueKind"/> is <see cref="JsonValueKind.Undefined"/>. 1573/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Array"/>. 1599/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Object"/>. 1627/// For <see cref="JsonValueKind.Null"/>, <see cref="string.Empty"/> is returned. 1631/// For <see cref="JsonValueKind.True"/>, <see cref="bool.TrueString"/> is returned. 1635/// For <see cref="JsonValueKind.False"/>, <see cref="bool.FalseString"/> is returned. 1639/// For <see cref="JsonValueKind.String"/>, the value of <see cref="GetString"/>() is returned.
System\Text\Json\Document\JsonProperty.cs (1)
150=> Value.ValueKind == JsonValueKind.Undefined ? "<Undefined>" : $"\"{ToString()}\"";
System\Text\Json\Nodes\JsonArray.cs (8)
72private protected override JsonValueKind GetValueKindCore() => JsonValueKind.Array; 191/// The <paramref name="element"/> is not a <see cref="JsonValueKind.Array"/>. 197JsonValueKind.Null => null, 198JsonValueKind.Array => new JsonArray(element, options), 199_ => throw new InvalidOperationException(SR.Format(SR.NodeElementWrongType, nameof(JsonValueKind.Array))), 205Debug.Assert(element.ValueKind == JsonValueKind.Array); 306Debug.Assert(jElement.ValueKind == JsonValueKind.Array);
System\Text\Json\Nodes\JsonNode.cs (3)
257/// Returns <see cref="JsonValueKind"/> of current instance. 259public JsonValueKind GetValueKind() => GetValueKindCore(); 261private protected abstract JsonValueKind GetValueKindCore();
System\Text\Json\Nodes\JsonNode.To.cs (1)
52if (this is JsonValueOfElement { Value.ValueKind: JsonValueKind.String } jsonElement)
System\Text\Json\Nodes\JsonObject.cs (6)
63JsonValueKind.Null => null, 64JsonValueKind.Object => new JsonObject(element, options), 65_ => throw new InvalidOperationException(SR.Format(SR.NodeElementWrongType, nameof(JsonValueKind.Object))) 71Debug.Assert(element.ValueKind == JsonValueKind.Object); 168private protected override JsonValueKind GetValueKindCore() => JsonValueKind.Object;
System\Text\Json\Nodes\JsonValue.cs (3)
185case JsonValueKind.Null: 188case JsonValueKind.Object or JsonValueKind.Array:
System\Text\Json\Nodes\JsonValueOfElement.cs (9)
16Debug.Assert(value.ValueKind is JsonValueKind.False or JsonValueKind.True or JsonValueKind.Number or JsonValueKind.String); 21private protected override JsonValueKind GetValueKindCore() => Value.ValueKind; 62case JsonValueKind.Number: 141case JsonValueKind.String: 183case JsonValueKind.True: 184case JsonValueKind.False:
System\Text\Json\Nodes\JsonValueOfT.cs (22)
18Debug.Assert(value is not JsonElement or JsonElement { ValueKind: not JsonValueKind.Null }); 58private static readonly JsonValueKind? s_valueKind = DetermineValueKindForType(typeof(TValue)); 63private protected static JsonValueKind DetermineValueKind(TValue value) 70return boolean ? JsonValueKind.True : JsonValueKind.False; 79private static JsonValueKind? DetermineValueKindForType(Type type) 98return JsonValueKind.String; 104return JsonValueKind.Number; 109TypeCode.Boolean => JsonValueKind.Undefined, // Can vary dependending on value. 110TypeCode.SByte => JsonValueKind.Number, 111TypeCode.Byte => JsonValueKind.Number, 112TypeCode.Int16 => JsonValueKind.Number, 113TypeCode.UInt16 => JsonValueKind.Number, 114TypeCode.Int32 => JsonValueKind.Number, 115TypeCode.UInt32 => JsonValueKind.Number, 116TypeCode.Int64 => JsonValueKind.Number, 117TypeCode.UInt64 => JsonValueKind.Number, 118TypeCode.Single => JsonValueKind.Number, 119TypeCode.Double => JsonValueKind.Number, 120TypeCode.Decimal => JsonValueKind.Number, 121TypeCode.String => JsonValueKind.String, 122TypeCode.Char => JsonValueKind.String,
System\Text\Json\Nodes\JsonValueOfTCustomized.cs (3)
18private JsonValueKind? _valueKind; 26private protected override JsonValueKind GetValueKindCore() => _valueKind ??= ComputeValueKind(); 50private JsonValueKind ComputeValueKind()
System\Text\Json\Nodes\JsonValueOfTPrimitive.cs (2)
16private readonly JsonValueKind _valueKind; 27private protected override JsonValueKind GetValueKindCore() => _valueKind;
System\Text\Json\Reader\JsonReaderHelper.cs (6)
49internal static JsonValueKind ToValueKind(this JsonTokenType tokenType) 54return JsonValueKind.Undefined; 56return JsonValueKind.Array; 58return JsonValueKind.Object; 66return (JsonValueKind)((byte)tokenType - 4); 69return JsonValueKind.Undefined;
System\Text\Json\Serialization\Attributes\JsonExtensionDataAttribute.cs (1)
20/// set to <see cref="JsonValueKind.Null"/>, otherwise a "null" JSON value is treated as a <c>null</c> object reference.
System\Text\Json\Serialization\Converters\Node\JsonNodeConverter.cs (3)
66case JsonValueKind.Null: 69case JsonValueKind.Object: 72case JsonValueKind.Array:
System\Text\Json\Serialization\JsonSerializer.Read.HandleMetadata.cs (6)
358if (element.ValueKind == JsonValueKind.Object) 376if (property.Value.ValueKind != JsonValueKind.String) 399if (property.Value.ValueKind != JsonValueKind.String) 472JsonValueKind metadataValueKind = jsonNode?.GetValueKind() ?? JsonValueKind.Null; 473Debug.Assert(metadataValueKind != JsonValueKind.Undefined);
System\Text\Json\ThrowHelper.cs (3)
333JsonValueKind expectedType, 334JsonValueKind actualType) 342JsonValueKind actualType)
System\Text\Json\ThrowHelper.Node.cs (1)
81public static void ThrowInvalidOperationException_NodeUnableToConvertElement(JsonValueKind valueKind, Type destinationType)
System\Text\Json\ThrowHelper.Serialization.cs (1)
674public static void ThrowJsonException_MetadataValueWasNotString(JsonValueKind valueKind)