138 references to ValueKind
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 (6)
JSComponents\JSComponentInterop.cs (1)
120switch (parameterJsonValue.ValueKind)
WebEventData\ChangeEventArgsReader.cs (3)
22switch (value.ValueKind) 57if (arrayElement.ValueKind != JsonValueKind.String) 60$"Unsupported {nameof(JsonElement)} value kind '{arrayElement.ValueKind}' " +
WebEventData\WebEventDescriptorReader.cs (2)
47if (jsonElement.ValueKind is JsonValueKind.Null) 61if (property.Value.ValueKind is JsonValueKind.True or JsonValueKind.False)
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (8)
ConverterTests\JsonElementComparer.cs (7)
26if (x.ValueKind != y.ValueKind) 31switch (x.ValueKind) 95throw new JsonException(string.Format(CultureInfo.InvariantCulture, "Unknown JsonValueKind {0}", x.ValueKind)); 108hash.Add(obj.ValueKind); 110switch (obj.ValueKind) 153throw new JsonException(string.Format(CultureInfo.InvariantCulture, "Unknown JsonValueKind {0}", obj.ValueKind));
UnaryServerCallHandlerTests.cs (1)
180Assert.Equal(JsonValueKind.Array, responseJson.RootElement.ValueKind);
Microsoft.AspNetCore.Mvc.ViewFeatures (5)
Infrastructure\DefaultTempDataSerializer.cs (5)
32switch (item.Value.ValueKind) 71throw new InvalidOperationException(Resources.FormatTempData_CannotDeserializeType(item.Value.ValueKind)); 91if (arrayElement[0].ValueKind == JsonValueKind.String) 102else if (arrayElement[0].ValueKind == JsonValueKind.Number) 114throw new InvalidOperationException(Resources.FormatTempData_CannotDeserializeType(arrayElement.ValueKind));
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.AI (3)
ChatCompletion\ChatClientStructuredOutputExtensions.cs (3)
229if (schemaElement.ValueKind is JsonValueKind.Object) 235return property.Value.ValueKind == JsonValueKind.String 246return element.ValueKind switch
Microsoft.Extensions.AI.Abstractions (1)
Utilities\AIJsonUtilities.Schema.Create.cs (1)
182if (document.ValueKind is not JsonValueKind.Object or JsonValueKind.False or JsonValueKind.True)
Microsoft.Extensions.AI.Abstractions.Tests (6)
Contents\FunctionCallContentTests..cs (4)
275Assert.True(kvp.Value is JsonElement { ValueKind: JsonValueKind.Object }); 285Assert.True(kvp.Value is JsonElement { ValueKind: JsonValueKind.Array }); 290Assert.True(kvp.Value is JsonElement { ValueKind: JsonValueKind.Number }); 295Assert.True(kvp.Value is JsonElement { ValueKind: JsonValueKind.True });
Utilities\AIJsonUtilitiesTests.cs (2)
420Assert.Equal(JsonValueKind.True, schema.ValueKind); 463Assert.Equal(JsonValueKind.Object, schema.ValueKind);
Microsoft.Extensions.AI.Evaluation.Safety (1)
ContentSafetyService.cs (1)
80switch (labelElement.ValueKind)
Microsoft.Extensions.AI.Integration.Tests (1)
PromptBasedFunctionCallingChatClient.cs (1)
155arguments[kvp.Key] = jsonElement.ValueKind switch
Microsoft.Extensions.AI.Ollama (1)
OllamaUtilities.cs (1)
59errorElement.ValueKind is JsonValueKind.String)
Microsoft.Extensions.Configuration.Json (4)
JsonConfigurationFileParser.cs (4)
33if (doc.RootElement.ValueKind != JsonValueKind.Object) 35throw new FormatException(SR.Format(SR.Error_InvalidTopLevelJSONElement, doc.RootElement.ValueKind)); 85switch (value.ValueKind) 109throw new FormatException(SR.Format(SR.Error_UnsupportedJSONToken, value.ValueKind));
Microsoft.ML.Tokenizers.Tests (16)
BpeTests.cs (14)
885modelElement.ValueKind != JsonValueKind.Object || 889vocabElement.ValueKind != JsonValueKind.Object) 941if (modelElement.TryGetProperty("merges", out JsonElement mergesElement) && mergesElement.ValueKind == JsonValueKind.Array) 945if (merge.ValueKind == JsonValueKind.String) 961preTokenizerElement.ValueKind == JsonValueKind.Object && 963typeElement.ValueKind == JsonValueKind.String && 966preTokenizersElement.ValueKind == JsonValueKind.Array) 970if (preTokenizer.ValueKind == JsonValueKind.Object && 972preTokenizerTypeElement.ValueKind == JsonValueKind.String) 978patternElement.ValueKind == JsonValueKind.Object && 980regexElement.ValueKind == JsonValueKind.String) 1002if (root.TryGetProperty("added_tokens", out JsonElement modelElement) && modelElement.ValueKind == JsonValueKind.Array) 1008contentElement.ValueKind == JsonValueKind.String && 1009token.TryGetProperty("id", out JsonElement idElement) && idElement.ValueKind == JsonValueKind.Number)
UnigramTests.cs (2)
34vocabElement.ValueKind == JsonValueKind.Array) 38if (token.ValueKind == JsonValueKind.Array && token.GetArrayLength() == 2)
System.Text.Json (72)
System\Text\Json\Document\JsonDocument.cs (1)
99/// This <see cref="RootElement"/>'s <see cref="JsonElement.ValueKind"/> would result in an invalid JSON.
System\Text\Json\Document\JsonElement.cs (50)
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"/>. 165/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Object"/>. 204/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Object"/>. 244/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Object"/>. 282/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Object"/>. 318/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Object"/>. 338/// This value's <see cref="ValueKind"/> is neither <see cref="JsonValueKind.True"/> or 370/// This value's <see cref="ValueKind"/> is neither <see cref="JsonValueKind.String"/> nor <see cref="JsonValueKind.Null"/>. 395/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.String"/>. 415/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.String"/>. 446/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 464/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 495/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 515/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 545/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 562/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 592/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 613/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 644/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 661/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 691/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 712/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 743/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 763/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 793/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 814/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 854/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 882/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 921/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 949/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 979/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 1000/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Number"/>. 1031/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.String"/>. 1051/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.String"/>. 1082/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.String"/>. 1102/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.String"/>. 1133/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.String"/>. 1153/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.String"/>. 1267JsonValueKind kind = element1.ValueKind; 1268if (kind != element2.ValueKind) 1432/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.String"/>. 1459/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.String"/>. 1490/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.String"/>. 1540/// This value's <see cref="ValueKind"/> is <see cref="JsonValueKind.Undefined"/>. 1568/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Array"/>. 1594/// This value's <see cref="ValueKind"/> is not <see cref="JsonValueKind.Object"/>. 1713private string DebuggerDisplay => $"ValueKind = {ValueKind} : \"{ToString()}\"";
System\Text\Json\Document\JsonProperty.cs (2)
110/// This <see cref="Value"/>'s <see cref="JsonElement.ValueKind"/> would result in an invalid JSON. 139=> Value.ValueKind == JsonValueKind.Undefined ? "<Undefined>" : $"\"{ToString()}\"";
System\Text\Json\Nodes\JsonArray.cs (3)
195return element.ValueKind switch 205Debug.Assert(element.ValueKind == JsonValueKind.Array); 303Debug.Assert(jElement.ValueKind == JsonValueKind.Array);
System\Text\Json\Nodes\JsonNode.To.cs (1)
52if (this is JsonValueOfElement { Value.ValueKind: JsonValueKind.String } jsonElement)
System\Text\Json\Nodes\JsonObject.cs (2)
61return element.ValueKind switch 71Debug.Assert(element.ValueKind == JsonValueKind.Object);
System\Text\Json\Nodes\JsonValue.cs (1)
180switch (element.ValueKind)
System\Text\Json\Nodes\JsonValueOfElement.cs (4)
16Debug.Assert(value.ValueKind is JsonValueKind.False or JsonValueKind.True or JsonValueKind.Number or JsonValueKind.String); 21private protected override JsonValueKind GetValueKindCore() => Value.ValueKind; 44ThrowHelper.ThrowInvalidOperationException_NodeUnableToConvertElement(Value.ValueKind, typeof(TypeToConvert)); 60switch (Value.ValueKind)
System\Text\Json\Nodes\JsonValueOfT.cs (1)
18Debug.Assert(value is not JsonElement or JsonElement { ValueKind: not JsonValueKind.Null });
System\Text\Json\Serialization\Attributes\JsonExtensionDataAttribute.cs (1)
19/// If a <see cref="JsonElement"/> is created, a "null" JSON value is treated as a JsonElement with <see cref="JsonElement.ValueKind"/>
System\Text\Json\Serialization\Converters\Node\JsonNodeConverter.cs (1)
64switch (element.ValueKind)
System\Text\Json\Serialization\JsonSerializer.Read.HandleMetadata.cs (5)
358if (element.ValueKind == JsonValueKind.Object) 376if (property.Value.ValueKind != JsonValueKind.String) 378ThrowHelper.ThrowJsonException_MetadataValueWasNotString(property.Value.ValueKind); 399if (property.Value.ValueKind != JsonValueKind.String) 401ThrowHelper.ThrowJsonException_MetadataValueWasNotString(property.Value.ValueKind);