4 types derived from JsonValue
System.Text.Json (4)
System\Text\Json\Nodes\JsonValueOfJsonPrimitive.cs (3)
36internal sealed class JsonValueOfJsonString : JsonValue 124internal sealed class JsonValueOfJsonBool : JsonValue 170internal sealed class JsonValueOfJsonNumber : JsonValue
System\Text\Json\Nodes\JsonValueOfT.cs (1)
11internal abstract class JsonValue<TValue> : JsonValue
778 references to JsonValue
AnalyzeCiFailure (17)
AnalysisPublicationQueries.cs (1)
44response["locked"] is JsonValue locked && locked.TryGetValue<bool>(out _)))
AnalysisPublisher.cs (3)
308new JsonObject { ["labels"] = new JsonArray(labels.Split(',').Select(label => JsonValue.Create(label)).ToArray()) }, 336["labels"] = new JsonArray(labels.Split(',').Select(label => JsonValue.Create(label)).ToArray()), 441? JsonNode.Parse(analysis.Run.PrNumbers) : JsonValue.Create(value: 0)),
AnalysisRerunner.cs (1)
106run["run_attempt"] is not JsonValue attempt || !attempt.TryGetValue<int>(out var currentAttempt) || currentAttempt <= 0)
CiFailureJson.cs (6)
62value = ToContract<T>(JsonValue.Create(text)); 127return JsonValue.Create(node.GetString()); 139return node is JsonValue value && value.TryGetValue<string>(out var text) ? text : null; 149=> node is JsonValue value && value.GetValueKind() == JsonValueKind.Number ? NormalizedJsonNumber.Parse(value.ToJsonString()) : null; 160public static bool IsFalse(JsonNode? node) => node is JsonValue value && value.TryGetValue<bool>(out var boolean) && !boolean; 169JsonValue value when Text(value) is { } text => text,
DiagnosticTextSanitizer.cs (3)
77_ when Text(node) is { } text => JsonValue.Create(Sanitize(text, limit, multiline)), 87JsonValueKind.String => JsonValue.Create(Sanitize(node.GetString()!, limit, multiline)), 89_ => JsonValue.Create(node.Clone()),
Infrastructure\GitHubJson.cs (1)
24return node is JsonValue value && value.GetValueKind() == JsonValueKind.Number &&
TestResultArtifacts.cs (1)
68artifact["expired"] is JsonValue expired && expired.TryGetValue<bool>(out var isExpired) ? isExpired : null,
WorkflowRunEvidenceCollector.cs (1)
341var numbers = candidates.OfType<JsonValue>()
AnalyzeCiFailure.TestHost (1)
tests\AnalyzeCiFailure.Tests\TestServices\GitHubFixtureHandler.cs (1)
126return Response(HttpStatusCode.OK, new JsonArray(labels.Select(label => JsonValue.Create(label)).ToArray()).ToJsonString());
AnalyzeCiFailure.Tests (21)
AnalyzeCiFailureBestEffortTests.cs (2)
55new WorkflowArtifact(JsonValue.Create(10), "results", JsonValue.Create(1), false, "2026-10-29T00:00:00Z"),
AnalyzeCiFailureEvidenceTests.cs (1)
210JsonValue.Create(value: 123)!,
AnalyzeCiFailureFixtures.cs (1)
146metadata["head_sha"] ??= context["head_sha"]?.DeepClone() ?? JsonValue.Create("");
AnalyzeCiFailureMigrationTests.cs (4)
59var occurrence = AnalysisPublisher.CreateOccurrence(accepted, Assert.Single(accepted.Causes), JsonValue.Create(value: 123)!, "2026-10-30T16:00:00Z"); 171var occurrence = AnalysisPublisher.CreateOccurrence(accepted, Assert.Single(accepted.Causes), JsonValue.Create(value: 123)!, "2026-10-21T01:00:00Z"); 392["id"] = scenario == "existing-id-invalid" ? JsonValue.Create(value: false) : 393JsonValue.Create(scenario == "new-replay-id-change" ? "different-cause" : created.Definition.Id),
AnalyzeCiFailurePublicationTests.cs (3)
216issue["number"] = scenario == "mismatched-detail" ? JsonValue.Create(value: 78) : null; 1086return AnalyzeCiFailure.AnalysisPublisher.CreateOccurrence(analysis, cause, JsonValue.Create(value: 123)!, "2026-08-31T12:00:00Z"); 1368var occurrence = AnalyzeCiFailure.AnalysisPublisher.CreateOccurrence(collected, Assert.Single(collected.Causes), JsonValue.Create(value: 123)!, "2026-10-21T01:00:00Z");
AnalyzeCiFailureTextTests.cs (9)
148var node = JsonValue.Create('x'); 197var node = JsonValue.Create(text); 232Assert.Equal(expected, AnalyzeCiFailure.CiFailureJson.Safe(JsonValue.Create(text), limit)); 248var text = JsonValue.Create("before" + character + "after"); 259var text = JsonValue.Create("before" + character + "after");
TestServices\GitHubFixtureHandler.cs (1)
126return Response(HttpStatusCode.OK, new JsonArray(labels.Select(label => JsonValue.Create(label)).ToArray()).ToJsonString());
aspire (47)
Agents\AspireSkills\AspireSkillsRemoteConfiguration.cs (1)
299=> node is JsonValue value && value.TryGetValue<string>(out var text) ? text : null;
Agents\ClaudeCode\ClaudeCodeAgentClient.cs (4)
220["args"] = new JsonArray(args.Select(arg => (JsonNode?)JsonValue.Create(arg)).ToArray()), 266if (hook["command"] is JsonValue commandValue 274var values = args.Select(arg => arg is JsonValue value && value.TryGetValue<string>(out var text) ? text : null).ToArray(); 275var executable = hook["command"] is JsonValue executableValue && executableValue.TryGetValue<string>(out var executableText)
Agents\Copilot\CopilotAgentClient.cs (1)
162["args"] = new JsonArray(args.Select(arg => (JsonNode?)JsonValue.Create(arg)).ToArray()),
Agents\McpConfigFileHelper.cs (1)
150return argument is JsonValue value && value.TryGetValue<string>(out var text) && text == expected;
Agents\OpenCode\OpenCodeAgentClient.cs (2)
93(aspire["type"] is JsonValue type && 140server["enabled"] is JsonValue enabled && enabled.TryGetValue<bool>(out _));
Backchannel\ResourceSnapshotMapper.cs (1)
217if (node is JsonValue jsonValue && jsonValue.TryGetValue<string>(out var stringValue))
Commands\AgentInitCommand.cs (1)
1247plugins[AspireSkillsRemoteConfiguration.PluginName] is JsonValue enabled &&
Commands\TerminalResourceResolver.cs (1)
93if (property is JsonValue value &&
Configuration\ConfigurationService.cs (1)
267SetChildValue(current, keyParts[^1], key, JsonValue.Create(value));
Mcp\Tools\ExecuteResourceCommandTool.cs (4)
188JsonValueKind.String => JsonValue.Create(property.Value.GetString()), 189JsonValueKind.Number => JsonValue.Create(property.Value.GetRawText()), 190JsonValueKind.True => JsonValue.Create("true"), 191JsonValueKind.False => JsonValue.Create("false"),
Mcp\Tools\ListResourcesTool.cs (2)
504explicitSourceNode is JsonValue explicitSourceValue && 540value is JsonValue jsonValue &&
Mcp\Tools\McpToolHelpers.cs (1)
374if (value is JsonValue jsonValue)
Migrations\TypeScriptAppHostMigration.cs (5)
202appHost["path"] is not JsonValue pathValue || 257if (entry is JsonValue value && value.GetValueKind() is JsonValueKind.String) 261rewritten.Add((JsonNode?)JsonValue.Create(LegacyTypeScriptAppHost.RewriteTsConfigIncludeEntry(value.GetValue<string>()))); 297if (script.Value is JsonValue value && 304scripts[script.Key] = (JsonNode?)JsonValue.Create(rewritten);
Npm\SigstoreNpmProvenanceChecker.cs (1)
212if (predicateTypeNode is not JsonValue predicateTypeValue)
Projects\FallbackProjectParser.cs (7)
197packageObj["Identity"] = JsonValue.Create(pkg.Identity); 198packageObj["Version"] = JsonValue.Create(pkg.Version); 208projectObj["Identity"] = JsonValue.Create(proj.Identity); 209projectObj["FullPath"] = JsonValue.Create(proj.FullPath); 218propertiesObject["AspireHostingSDKVersion"] = JsonValue.Create(aspireHostingSdkVersion); 219propertiesObject["_UsingAspireAppHostSdk"] = JsonValue.Create(usesAppHostSdk ? "true" : "false"); 223rootObject["Fallback"] = JsonValue.Create(true);
Projects\NativeAppHostServerProject.cs (2)
133new KeyValuePair<string, JsonNode?>(file.Key, JsonValue.Create(file.Value)))), 134["exports"] = new JsonArray(provider.Descriptor.Exports.Select(module => (JsonNode?)JsonValue.Create(module)).ToArray())
Projects\NativeProviderDescriptor.cs (2)
21descriptor["protocolVersion"] is not JsonValue version || !version.TryGetValue<int>(out var number) || number != 2 || 40if (value is not JsonValue text || !text.TryGetValue<string>(out var result) || string.IsNullOrWhiteSpace(result))
Projects\TypeScriptAppHostToolchainResolver.cs (1)
364if (packageJson?["packageManager"] is not JsonValue packageManagerValue ||
Scaffolding\PackageJsonMerger.cs (4)
155if (value is not JsonValue scriptValue || !scriptValue.TryGetValue<string>(out var command)) 232if (versionNode is not JsonValue desiredValue || !desiredValue.TryGetValue<string>(out var desiredVersion)) 252if (existingVersionNode is JsonValue existingValue 275if (existingVersionNode is JsonValue existingValue
Scaffolding\ScaffoldingService.cs (1)
432if (scripts[scriptName] is JsonValue existingScriptValue &&
src\Shared\Json\AtsJsonCodeWriter.cs (1)
33return JsonValue.Create(value)!.ToJsonString(s_relaxedJsonOptions);
src\Shared\Telemetry\InternalMicrosoftDetector.cs (2)
1879node is JsonValue jsonValue && 1905value is JsonValue jsonValue &&
Templating\TemplateSourceConfiguration.cs (1)
211if (parts.Length == 3 && settings[parts[0]]?[parts[1]] is JsonValue)
Aspire.Cli.Tests (74)
Agents\AgentConfigurationTests.cs (1)
497["token"] = JsonValue.Create("replacement",
Agents\TelemetryHookConfiguratorTests.cs (3)
206["args"] = new JsonArray(args.Select(arg => (JsonNode?)JsonValue.Create(arg)).ToArray()) 403=> node is JsonValue v && (v.ToString().Contains("track-telemetry", StringComparison.OrdinalIgnoreCase) || v.ToString() == "--hook"); 409&& ho["command"] is JsonValue v
Backchannel\ResourceSnapshotMapperTests.cs (11)
47var pid = Assert.IsAssignableFrom<JsonValue>(snapshot.Properties["executable.pid"]); 63[KnownProperties.Project.Path] = JsonValue.Create("/repo/maui/MauiApp.csproj"), 64[KnownProperties.Project.LaunchProfile] = JsonValue.Create("AndroidEmulator"), 65[KnownProperties.Project.LaunchCommand] = JsonValue.Create("watch"), 66[KnownProperties.Project.Configuration] = JsonValue.Create("Release"), 67[KnownProperties.Project.TargetFramework] = JsonValue.Create("net10.0"), 68[KnownProperties.Resource.LaunchConfigurationType] = JsonValue.Create("maui"), 69[KnownProperties.Resource.ParentName] = JsonValue.Create("mauiapp"), 393["custom.list"] = new JsonArray((JsonNode?)JsonValue.Create("one"), (JsonNode?)JsonValue.Create("two"))
Commands\DescribeCommandTests.cs (14)
408[KnownProperties.Executable.Path] = JsonValue.Create("dotnet"), 409[KnownProperties.Project.Configuration] = JsonValue.Create("Release"), 410[KnownProperties.Project.LaunchCommand] = JsonValue.Create("watch"), 411[KnownProperties.Project.LaunchProfile] = JsonValue.Create("https"), 412[KnownProperties.Project.Path] = JsonValue.Create("/repo/api/Api.csproj"), 413[KnownProperties.Project.TargetFramework] = JsonValue.Create("net10.0"), 414[KnownProperties.Resource.LaunchConfigurationType] = JsonValue.Create("project"), 415[KnownProperties.Resource.ParentName] = JsonValue.Create("group"), 428[KnownProperties.Executable.Path] = JsonValue.Create("dotnet"), 429[KnownProperties.Executable.Pid] = JsonValue.Create(1234), 430[KnownProperties.Project.LaunchProfile] = JsonValue.Create("AndroidEmulator"), 431[KnownProperties.Project.Path] = JsonValue.Create("/repo/maui/MauiApp.csproj"), 432[KnownProperties.Resource.LaunchConfigurationType] = JsonValue.Create("maui"), 433[KnownProperties.Resource.ParentName] = JsonValue.Create("mauiapp"),
Commands\ResourceCommandTests.cs (2)
2335var actualElement = Assert.IsAssignableFrom<JsonValue>(actualValue);
Commands\SdkDumpCommandTests.cs (1)
435Value = JsonValue.Create("你好"),
Commands\TerminalResourceResolverTests.cs (1)
351return replicaIndex is null ? [] : new() { [KnownProperties.Terminal.ReplicaIndex] = JsonValue.Create(replicaIndex) };
Commands\TerminalTapePlayCommandTests.cs (2)
211Properties = new() { [KnownProperties.Terminal.ReplicaIndex] = JsonValue.Create("0") } 217Properties = new() { [KnownProperties.Terminal.ReplicaIndex] = JsonValue.Create("1") }
DotNet\DotNetRestoreConfigurationTests.cs (2)
35var values = new JsonObject(properties.Select(name => KeyValuePair.Create<string, JsonNode?>(name, JsonValue.Create("")))); 65var values = new JsonObject(properties.Select(name => KeyValuePair.Create<string, JsonNode?>(name, JsonValue.Create(""))));
Mcp\ExcludeFromMcpTests.cs (8)
46[KnownProperties.Resource.ExcludeFromMcp] = JsonValue.Create(true) 61[KnownProperties.Resource.ExcludeFromMcp] = JsonValue.Create(false) 76[KnownProperties.Resource.ExcludeFromMcp] = JsonValue.Create("true") 131[KnownProperties.Resource.ExcludeFromMcp] = JsonValue.Create(true) 173[KnownProperties.Resource.ExcludeFromMcp] = JsonValue.Create(true) 219[KnownProperties.Resource.ExcludeFromMcp] = JsonValue.Create(true) 291[KnownProperties.Resource.ExcludeFromMcp] = JsonValue.Create(true) 485[KnownProperties.Resource.ExcludeFromMcp] = JsonValue.Create(true)
Mcp\ListResourcesToolTests.cs (19)
401[KnownProperties.Resource.ExcludeFromMcp] = JsonValue.Create(true) 733[KnownProperties.Project.Path] = JsonValue.Create(@"C:\repo\Api\Api.csproj") 743[KnownProperties.Executable.Path] = JsonValue.Create(@"C:\repo\bin\worker.exe") 771[KnownProperties.Resource.Source] = JsonValue.Create(string.Empty), 772[KnownProperties.Project.Path] = JsonValue.Create("/repo/Project/Project.csproj") 782[KnownProperties.Resource.Source] = JsonValue.Create(string.Empty), 783[KnownProperties.Executable.Path] = JsonValue.Create("/repo/bin/worker") 793[KnownProperties.Resource.Source] = JsonValue.Create(string.Empty), 794[KnownProperties.Container.Image] = JsonValue.Create("redis:8") 822[KnownProperties.Container.Image] = JsonValue.Create(sourceValue) 895[KnownProperties.Project.Path] = JsonValue.Create("/repo/Api/Api.csproj"), 896["secret.property"] = JsonValue.Create("property-secret") 973[KnownProperties.Container.Image] = JsonValue.Create("redis:8"), 974[KnownProperties.Executable.Path] = JsonValue.Create("/repo/bin/container-secret") 984[KnownProperties.Executable.Path] = JsonValue.Create("/repo/bin/worker") 994[KnownProperties.Resource.Source] = JsonValue.Create("generic-source-secret") 1004[KnownProperties.Project.Path] = JsonValue.Create("/repo/CaseMismatched/CaseMismatched.csproj"), 1005[KnownProperties.Resource.Source] = JsonValue.Create("case-mismatch-secret") 1062["unrelated.full.property"] = JsonValue.Create<object>(cyclicValue)
Mcp\WaitForResourcesToolTests.cs (3)
108[KnownProperties.Resource.ExcludeFromMcp] = JsonValue.Create(true) 266[KnownProperties.Resource.ExcludeFromMcp] = JsonValue.Create(true) 377[KnownProperties.Resource.ExcludeFromMcp] = JsonValue.Create(true)
Projects\ProjectUpdaterTests.cs (6)
4539properties.Add("AspireHostingSDKVersion", JsonValue.Create<string>(sdkVersion)); 4575{ "Identity", JsonValue.Create<string>(packageId) }, 4576{ "Version", JsonValue.Create<string>(packageVersion) } 4591{ "Identity", JsonValue.Create<string>(packageId) } 4607{ "FullPath", JsonValue.Create<string>(fullPath) } 4622properties.Add(propertyName, JsonValue.Create<string>(propertyValue));
TestServices\TestDotNetCliRunner.cs (1)
174KeyValuePair.Create<string, JsonNode?>(name, JsonValue.Create(string.Empty))));
Aspire.Dashboard (12)
Model\GenAI\GenAISchemaHelpers.cs (2)
94if (item is JsonValue && item.GetValueKind() == System.Text.Json.JsonValueKind.String) 110if (typeNode is JsonValue && typeNode.GetValueKind() == System.Text.Json.JsonValueKind.String)
Model\TelemetryExportService.cs (3)
793return JsonValue.Create(stringValue); 798return JsonValue.Create(value.NumberValue); 803return JsonValue.Create(value.BoolValue);
Otlp\Model\OtlpHelpers.cs (5)
201AnyValue.ValueOneofCase.StringValue => JsonValue.Create(value.StringValue), 202AnyValue.ValueOneofCase.IntValue => JsonValue.Create(value.IntValue), 203AnyValue.ValueOneofCase.DoubleValue => JsonValue.Create(value.DoubleValue), 204AnyValue.ValueOneofCase.BoolValue => JsonValue.Create(value.BoolValue), 205AnyValue.ValueOneofCase.BytesValue => JsonValue.Create(value.BytesValue.ToHexString()),
src\Shared\Telemetry\InternalMicrosoftDetector.cs (2)
1879node is JsonValue jsonValue && 1905value is JsonValue jsonValue &&
Aspire.Dashboard.Tests (2)
Model\GenAIItemPartViewModelTests.cs (2)
20Response = JsonValue.Create("**Markdown**") 39Response = JsonValue.Create(expectedText)
Aspire.Hosting (29)
Backchannel\AuxiliaryBackchannelRpcTarget.cs (18)
1416string stringValue => JsonValue.Create(stringValue), 1417bool boolValue => JsonValue.Create(boolValue), 1418byte byteValue => JsonValue.Create(byteValue), 1419sbyte sbyteValue => JsonValue.Create(sbyteValue), 1420short shortValue => JsonValue.Create(shortValue), 1421ushort ushortValue => JsonValue.Create(ushortValue), 1422int intValue => JsonValue.Create(intValue), 1423uint uintValue => JsonValue.Create(uintValue), 1424long longValue => JsonValue.Create(longValue), 1425ulong ulongValue => JsonValue.Create(ulongValue), 1426float floatValue => JsonValue.Create(floatValue), 1427double doubleValue => JsonValue.Create(doubleValue), 1428decimal decimalValue => JsonValue.Create(decimalValue), 1431_ => JsonValue.Create(value.ToString()) 1450return stringValue is null ? null : JsonValue.Create(stringValue); 1458JsonValue jsonValue when jsonValue.TryGetValue<string>(out var stringValue) => stringValue, 1459JsonValue jsonValue when jsonValue.TryGetValue<bool>(out var boolValue) => boolValue.ToString(CultureInfo.InvariantCulture), 1460JsonValue jsonValue when jsonValue.TryGetValue<IFormattable>(out var formattableValue) => formattableValue.ToString(null, CultureInfo.InvariantCulture),
Dcp\JsonPatch.cs (2)
32operation["op"] is not JsonValue operationValue || 33operation["path"] is not JsonValue pathValue ||
Dcp\PersistentPortAllocationStore.cs (2)
62if (state["version"] is not JsonValue versionValue || 108if (node is JsonValue value &&
Pipelines\DeploymentStateSection.cs (1)
56Data[RootValueKey] = JsonValue.Create(value);
Pipelines\Internal\DeploymentStateManagerBase.cs (1)
195else if (sectionData is JsonValue jsonValue && jsonValue.GetValueKind() == JsonValueKind.String)
Pipelines\Internal\FileDeploymentStateManager.cs (4)
382JsonValue sectionValue when sectionValue.GetValueKind() == JsonValueKind.String => 755JsonValue claimedSectionsValue => ParseClaimedSectionNames(claimedSectionsValue), 761JsonValue stateValue => JsonNode.Parse(stateValue.GetValue<string>())?.AsObject() 769private static string[] ParseClaimedSectionNames(JsonValue claimedSectionsValue)
Publishing\ContainerImageArchiveRewriter.cs (1)
546if (node is JsonValue value &&
Aspire.Hosting.Azure (2)
AzureProvisioningController.cs (1)
2571deletedResourceIds.Add(JsonValue.Create(resourceId));
Provisioning\BicepUtilities.cs (1)
79IEnumerable<string> s => new JsonArray(s.Select(s => JsonValue.Create(s)).ToArray()),
Aspire.Hosting.Azure.Sandboxes (1)
AzureSandboxContainerDeployment.cs (1)
1956.Select(static ownerId => JsonValue.Create(ownerId))
Aspire.Hosting.Azure.Tests (2)
AzureEventHubsExtensionsTests.cs (1)
399document["Custom"] = JsonValue.Create(42);
AzureServiceBusExtensionsTests.cs (1)
508document["Custom"] = JsonValue.Create(42);
Aspire.Hosting.Azure.WebPubSub (1)
AzureWebPubSubExtensions.cs (1)
240["SystemEvents"] = new JsonArray((systemEvents ?? []).Select(e => (JsonNode?)JsonValue.Create(e)).ToArray())
Aspire.Hosting.CodeGeneration.Go (3)
AtsGoCodeGenerator.cs (1)
1285value is JsonValue jsonValue && jsonValue.TryGetValue<string>(out var text)
GoApiExportWriter.cs (1)
256array.Add((JsonNode)JsonValue.Create(value));
src\Shared\Json\AtsJsonCodeWriter.cs (1)
33return JsonValue.Create(value)!.ToJsonString(s_relaxedJsonOptions);
Aspire.Hosting.CodeGeneration.Go.Tests (7)
AtsGoDerivedBuilderTests.cs (1)
585Value = JsonValue.Create("default"),
GoApiExportTests.cs (2)
314Assert.True(member["optional"] is JsonValue value && value.TryGetValue<bool>(out _)); 390JsonValue value when value.TryGetValue<string>(out var text) => [text],
GoGeneratorEscapingTests.cs (4)
200Value = JsonValue.Create("primary"), 207ExportedValue(["Emoji", "Greeting"], stringType, JsonValue.Create("hi \U0001F600")), 209ExportedValue(["Emoji", "Status"], enumType, JsonValue.Create("Ready\U0001F600")), 210ExportedValue(["Emoji", "Anything"], unknownType, JsonValue.Create("\U0001F600"))
Aspire.Hosting.CodeGeneration.Java (1)
src\Shared\Json\AtsJsonCodeWriter.cs (1)
33return JsonValue.Create(value)!.ToJsonString(s_relaxedJsonOptions);
Aspire.Hosting.CodeGeneration.Python (4)
AtsPythonCodeGenerator.cs (3)
310? JsonValue.Create(callbackParameter.Type.TypeId)!.ToJsonString() 1057JsonValue jsonValue when jsonValue.TryGetValue<bool>(out var boolValue) => boolValue ? "True" : "False", 1058JsonValue jsonValue => jsonValue.ToRelaxedJsonString(),
src\Shared\Json\AtsJsonCodeWriter.cs (1)
33return JsonValue.Create(value)!.ToJsonString(s_relaxedJsonOptions);
Aspire.Hosting.CodeGeneration.Rust (1)
src\Shared\Json\AtsJsonCodeWriter.cs (1)
33return JsonValue.Create(value)!.ToJsonString(s_relaxedJsonOptions);
Aspire.Hosting.CodeGeneration.TypeScript (3)
src\Shared\Json\AtsJsonCodeWriter.cs (1)
33return JsonValue.Create(value)!.ToJsonString(s_relaxedJsonOptions);
TypeScriptApiExportWriter.cs (1)
199array.Add((JsonNode)JsonValue.Create(value));
TypeScriptLanguageSupport.cs (1)
221return node is JsonValue value && value.TryGetValue<string>(out var stringValue) ? stringValue : null;
Aspire.Hosting.Native.Client (1)
Authoring\NativePipeline.cs (1)
196new(values.Select(value => (JsonNode?)JsonValue.Create(value)).ToArray());
Aspire.Hosting.Native.Core.Tests (69)
ApplicationRevisionTests.cs (20)
23Arguments(("context", context.Writer), ("stream", JsonValue.Create("stdout")), ("message", JsonValue.Create("retained"))))); 25Arguments(("context", context.Writer), ("name", JsonValue.Create("ping")), ("displayName", JsonValue.Create("Ping"))))); 39Arguments(("context", context.Reader), ("resourceId", resourceId), ("afterSequence", JsonValue.Create(0))))); 56("context", context.Writer), ("name", JsonValue.Create("ping")), ("displayName", JsonValue.Create("Ping"))))); 58("context", context.Reader), ("resourceName", JsonValue.Create("cache")), ("commandName", JsonValue.Create("ping"))))); 60("context", context.Writer), ("message", JsonValue.Create("Keep running?"))))); 78("accepted", JsonValue.Create(true))))); 158Arguments(("context", revision), ("name", JsonValue.Create("cache")), ("typeId", JsonValue.Create("other/Resource"))))); 174Arguments(("context", context.Writer), ("revision", JsonValue.Create(1L)), ("timeoutMilliseconds", JsonValue.Create(10000)))); 328("context", context.Writer), ("revision", JsonValue.Create(1L)), ("timeoutMilliseconds", JsonValue.Create(10000)))); 330("context", context.Writer), ("timeoutMilliseconds", JsonValue.Create(10000)))); 367Arguments(("context", writer), ("revision", JsonValue.Create(revision)), ("container", new JsonObject 392("context", context.Writer), ("revision", JsonValue.Create(revision)),
DeclarativeApplicationTests.cs (3)
22("name", JsonValue.Create("service")), 23("image", JsonValue.Create("generic/service:1"))))); 25("value", JsonValue.Create("value")))));
NativeComposeCSharpTests.cs (1)
135["environment"] = new JsonObject(environment.Select(pair => KeyValuePair.Create(pair.Key, (JsonNode?)JsonValue.Create(pair.Value))))
NativeDashboardTests.cs (10)
53("name", JsonValue.Create("refresh")), ("displayName", JsonValue.Create("Refresh")))); 55("stream", JsonValue.Create("stderr")), ("message", JsonValue.Create("native log")))); 95("name", JsonValue.Create("refresh")), ("displayName", JsonValue.Create("Refresh")))); 97("timeoutMilliseconds", JsonValue.Create(10000)))); 109("message", JsonValue.Create("Initialize database?"))))); 129("message", JsonValue.Create("Continue after the previous response?"))))); 172("context", context.Writer), ("revision", JsonValue.Create(2L)),
NativeRpcTests.cs (9)
61Arguments(("context", composition), ("name", JsonValue.Create("late")), ("typeId", JsonValue.Create("example/Resource")))))); 135("name", JsonValue.Create("password")), ("value", JsonValue.Create("rpc-secret"))))); 138Arguments(("context", resource), ("name", JsonValue.Create("password")), ("value", value))))); 163("name", JsonValue.Create("private-secret-name")), ("typeId", JsonValue.Create("example/Resource")))); 209("name", JsonValue.Create("overflow")), ("typeId", JsonValue.Create("example/Resource"))));
RuntimeRpcTests.cs (23)
21("stream", JsonValue.Create("stdout")), ("message", JsonValue.Create($"entry-{index}")))); 25("resourceId", id), ("afterSequence", JsonValue.Create(0))))); 28("message", JsonValue.Create("Continue?")))))); 30("message", JsonValue.Create("Another confirmation?")))))); 39("context", context.Reader), ("version", initial["version"]), ("timeoutMilliseconds", JsonValue.Create(30000)))); 81("stream", JsonValue.Create("stdout")), ("message", JsonValue.Create($"entry-{index}")))); 85("resourceId", id), ("afterSequence", JsonValue.Create(0))))); 91("resourceId", id), ("afterSequence", JsonValue.Create(298))))); 95("resourceId", id), ("afterSequence", JsonValue.Create(301)))))); 103("name", JsonValue.Create("refresh")), ("displayName", JsonValue.Create("Refresh")))); 105("resourceName", JsonValue.Create("cache")), ("commandName", JsonValue.Create("refresh"))))); 116("message", JsonValue.Create("Continue?"))))); 122("requestId", prompt["requestId"]), ("accepted", JsonValue.Create(true)))); 125("requestId", prompt["requestId"]), ("accepted", JsonValue.Create(true)))))); 134("name", JsonValue.Create("refresh")), ("displayName", JsonValue.Create("Refresh")))); 136("resourceName", JsonValue.Create("cache")), ("commandName", JsonValue.Create("refresh"))))); 152("message", JsonValue.Create("Continue?")))));
TestServices\RpcTestClient.cs (2)
81Result(Invoke("addResource", Arguments(("context", composition), ("name", JsonValue.Create(name)), 82("typeId", JsonValue.Create("example/Resource")))));
TestServices\RuntimeRpcTestContext.cs (1)
57["urls"] = new JsonArray(urls.Select(url => (JsonNode?)JsonValue.Create(url)).ToArray())
Aspire.Hosting.Native.Server (41)
Api\PublishingApi.cs (7)
38KeyValuePair.Create(entry.Name, (JsonNode?)JsonValue.Create(entry.Value)))); 85["dependencies"] = new JsonArray(resource.Dependencies.Select(handle => (JsonNode?)JsonValue.Create(names[handle])).ToArray()), 86["lifecycle"] = new JsonArray((workload?.Lifecycle ?? []).Select(hook => (JsonNode?)JsonValue.Create(hook.Phase)) 87.Concat(resource.ProviderLifecycle.Select(hook => (JsonNode?)JsonValue.Create("provider"))).ToArray()), 97.Select(parameter => (JsonNode?)JsonValue.Create(parameter.ParameterName)).ToArray()), 99.Select(parameter => (JsonNode?)JsonValue.Create(parameter.ParameterName)).ToArray()), 102KeyValuePair.Create(parameter.Value.ParameterName, (JsonNode?)JsonValue.Create(parameter.Value.Resolve(ValueNetworkContext.Host,
artifacts\obj\Aspire.Hosting.Native.Server\Debug\native-ats\NativeDispatch.g.cs (10)
131return new JsonArray(result.Select(value => (JsonNode?)JsonValue.Create(value)).ToArray()); 244return JsonValue.Create(result); 287return JsonValue.Create(result); 294return JsonValue.Create(result); 301return JsonValue.Create(result); 369return JsonValue.Create(result); 503return JsonValue.Create(result); 624return JsonValue.Create(result); 778return JsonValue.Create(result); 785return JsonValue.Create(result);
Rpc\NativeProviderLifecycle.cs (5)
80new JsonArray(JsonValue.Create(binding.CapabilityId), arguments, JsonValue.Create(invocation)), cancellation.Token).ConfigureAwait(false); 94await peer.RequestAsync("cancelProviderInvocation", new JsonArray(JsonValue.Create(invocation)), 147new JsonArray(JsonValue.Create(resource.ObjectId)), deadline.Token).ConfigureAwait(false); 148if (result is not JsonValue success || !success.TryGetValue<bool>(out var released) || !released)
Rpc\NativeProviderMetadata.cs (4)
35if (manifest is not JsonObject envelope || envelope["protocolVersion"] is not JsonValue version || 44if (capabilities[index] is not JsonObject metadata || metadata["id"] is not JsonValue || 71if (type["category"] is not JsonValue category || !category.TryGetValue<string>(out var categoryName) || categoryName != "Callback" || 108if (metadata[name] is JsonValue value && value.TryGetValue<bool>(out var flag))
Rpc\NativeProviderRegistry.cs (3)
237new JsonArray(JsonValue.Create(capability), mapped, JsonValue.Create(Guid.NewGuid().ToString())), caller.Closed).ConfigureAwait(false); 377new JsonArray(JsonValue.Create(callback.Id), mapped)).ConfigureAwait(false);
Rpc\NativeRpcConnection.cs (1)
447"ping" => JsonValue.Create("pong"),
Rpc\NativeRpcConnection.Dispatch.cs (5)
23return JsonValue.Create(_authenticated); 117return JsonValue.Create(_providers.Expect(this, RpcArguments.String(expectation[0]))); 124return JsonValue.Create(true); 131return JsonValue.Create(true); 137return JsonValue.Create(_providers.AbandonRegistration(this, RpcArguments.String(abandonment[0])));
Rpc\NativeRpcProtocol.cs (1)
163_ => JsonValue.Create(element.Clone())
Rpc\RpcArguments.cs (5)
23if (value is JsonValue scalar && scalar.TryGetValue<string>(out var text)) 31public static bool Boolean(JsonNode? value) => value is JsonValue scalar && scalar.TryGetValue<bool>(out var result) 40if (value is JsonValue scalar && scalar.TryGetValue<string>(out var text)) 52public static int Int32(JsonNode? value) => value is JsonValue scalar && scalar.TryGetValue<int>(out var result) 55public static long Int64(JsonNode? value) => value is JsonValue scalar && scalar.TryGetValue<long>(out var result)
Aspire.Hosting.Radius (1)
Publishing\RadiusDeploymentPipelineStep.cs (1)
75controlPlane["version"] is not JsonValue versionValue ||
Aspire.Hosting.RemoteHost (34)
Ats\AtsMarshaller.cs (21)
159AtsTypeCategory.Enum => JsonValue.Create(value.ToString()), 217AtsTypeCategory.Enum => JsonValue.Create(value.ToString()), 234return JsonValue.Create(((TimeSpan)value).TotalMilliseconds); 240return JsonValue.Create(((DateOnly)value).ToString("O", System.Globalization.CultureInfo.InvariantCulture)); 246return JsonValue.Create(((TimeOnly)value).ToString("O", System.Globalization.CultureInfo.InvariantCulture)); 249return JsonValue.Create(value); 456AtsTypeCategory.Enum => JsonValue.Create(value.ToString()), 484return JsonValue.Create(tokenId); 562return node is JsonValue value ? ConvertPrimitive(value, targetType) : node; 569if (node is JsonValue callbackValue && callbackValue.TryGetValue<string>(out var callbackId)) 585if (node is JsonValue tokenValue && tokenValue.TryGetValue<string>(out var tokenId) && !string.IsNullOrEmpty(tokenId)) 598if (node is JsonValue value) 724JsonValue v when v.TryGetValue<string>(out _) => "string", 725JsonValue v when v.TryGetValue<bool>(out _) => "bool", 726JsonValue v when v.TryGetValue<long>(out _) => "number", 727JsonValue v when v.TryGetValue<double>(out _) => "number", 728JsonValue => "value", 753private static decimal ReadDecimalValue(JsonValue value, Type targetType) 791private static decimal ReadIntegralNumericValue(JsonValue value, Type targetType, decimal minValue, decimal maxValue) 839public static object? ConvertPrimitive(JsonValue value, Type targetType) 1036var value = jsonValue is JsonValue primitive && primitive.GetValueKind() == JsonValueKind.Number &&
Ats\CapabilityDispatcher.cs (9)
970node is JsonValue value && 979JsonValue v when v.TryGetValue<string>(out _) => "string", 980JsonValue v when v.TryGetValue<bool>(out _) => "bool", 981JsonValue v when v.TryGetValue<long>(out _) => "number", 982JsonValue v when v.TryGetValue<double>(out _) => "number", 983JsonValue => "value", 1058if (!args.TryGetPropertyValue(name, out var node) || node is not JsonValue value) 1072if (args.TryGetPropertyValue(name, out var node) && node is JsonValue value) 1084if (args.TryGetPropertyValue(name, out var node) && node is JsonValue value)
Ats\ExternalCapabilityRegistry.cs (1)
651if (args[parameter.Name] is JsonValue value && value.TryGetValue<string>(out var callbackId) && !string.IsNullOrEmpty(callbackId))
Ats\ReferenceExpressionRef.cs (3)
89matchValueNode is JsonValue matchValueJsonValue && 106formatNode is not JsonValue formatValue || 230else if (providerNode is JsonValue jsonValue && jsonValue.TryGetValue<string>(out var stringValue))
Aspire.Hosting.RemoteHost.Tests (100)
AtsContextFilterTests.cs (2)
582Value = JsonValue.Create("selected") 608Value = JsonValue.Create("unrelated")
AtsMarshallerTests.cs (72)
52public static TheoryData<Type, JsonValue, object> WholeDoubleAdditionalIntegralTypes => new() 54{ typeof(byte), JsonValue.Create(42.0)!, (byte)42 }, 55{ typeof(short), JsonValue.Create(42.0)!, (short)42 }, 56{ typeof(uint), JsonValue.Create(42.0)!, 42u }, 57{ typeof(ulong), JsonValue.Create(42.0)!, 42ul }, 58{ typeof(ushort), JsonValue.Create(42.0)!, (ushort)42 }, 59{ typeof(sbyte), JsonValue.Create(42.0)!, (sbyte)42 }, 62public static TheoryData<Type, JsonValue> FractionalAdditionalIntegralTypes => new() 64{ typeof(byte), JsonValue.Create(42.5)! }, 65{ typeof(short), JsonValue.Create(42.5)! }, 66{ typeof(uint), JsonValue.Create(42.5)! }, 67{ typeof(ulong), JsonValue.Create(42.5)! }, 68{ typeof(ushort), JsonValue.Create(42.5)! }, 69{ typeof(sbyte), JsonValue.Create(42.5)! }, 72public static TheoryData<Type, JsonValue> OverflowAdditionalIntegralTypes => new() 74{ typeof(byte), JsonValue.Create(256.0)! }, 75{ typeof(short), JsonValue.Create(32768.0)! }, 76{ typeof(uint), JsonValue.Create(-1.0)! }, 77{ typeof(ulong), JsonValue.Create(-1.0)! }, 78{ typeof(ushort), JsonValue.Create(65536.0)! }, 79{ typeof(sbyte), JsonValue.Create(128.0)! }, 278var tokenValue = Assert.IsAssignableFrom<JsonValue>(result); 299var tokenValue = Assert.IsAssignableFrom<JsonValue>(result); 309var value = JsonValue.Create("test"); 319var value = JsonValue.Create(42); 329var value = JsonValue.Create(11433.0); 339var value = JsonValue.Create(11433.5); 346public void ConvertPrimitive_ConvertsWholeDoubleForAdditionalIntegralTypes(Type targetType, JsonValue value, object expected) 355public void ConvertPrimitive_RejectsFractionalDoubleForAdditionalIntegralTypes(Type targetType, JsonValue value) 362public void ConvertPrimitive_RejectsOutOfRangeValuesForAdditionalIntegralTypes(Type targetType, JsonValue value) 370var value = JsonValue.Create(true); 380var value = JsonValue.Create(1500.0); 390var value = JsonValue.Create(42); 535var value = JsonValue.Create("2024-06-15"); 558var value = JsonValue.Create("14:30:45"); 655var value = JsonValue.Create(9223372036854775807L); 665var value = JsonValue.Create(5000000000d); 675var value = JsonValue.Create(9007199254740992d); 683var value = JsonValue.Create(3.14159); 693var value = JsonValue.Create(1e100); 703var value = JsonValue.Create(3.14); 713var value = JsonValue.Create(123.456m); 723var value = JsonValue.Create(1e100); 731var value = JsonValue.Create("01:30:00"); 918var json = JsonValue.Create("ValueB"); 929var json = JsonValue.Create("valueb"); // lowercase 940var json = JsonValue.Create(1); // ValueB is index 1 951var json = JsonValue.Create("ValueA");
CallbackProxyTests.cs (3)
155var invoker = new TestCallbackInvoker { ResultToReturn = JsonValue.Create(42) }; 258var invoker = new TestCallbackInvoker { ResultToReturn = JsonValue.Create("result-value") }; 409["p0"] = JsonValue.Create("some-string"),
CapabilityDispatcherTests.cs (4)
259CapabilityHandler handler = (args, handles) => Task.FromResult<JsonNode?>(JsonValue.Create("result")); 295return Task.FromResult<JsonNode?>(JsonValue.Create("success")); 323dispatcher.Register("test/capability@1", (_, _) => Task.FromResult<JsonNode?>(JsonValue.Create(42))); 967var invoker = new TestCallbackInvoker { ResultToReturn = JsonValue.Create(42) };
ExternalCapabilityRegistryTests.cs (9)
109(_, _) => Task.FromResult<JsonNode?>(JsonValue.Create("configured"))); 194return Task.FromResult<JsonNode?>(JsonValue.Create($"deferred-{args!["p0"]!.GetValue<string>()}")); 321response.SetResult(JsonValue.Create("completed")); 496(_, _) => Task.FromResult<JsonNode?>(JsonValue.Create("original"))); 498(_, _) => Task.FromResult<JsonNode?>(JsonValue.Create("other"))); 500(_, _) => Task.FromResult<JsonNode?>(JsonValue.Create("replacement"))); 604(_, _) => Task.FromResult<JsonNode?>(JsonValue.Create("first-replacement"))); 606(_, _) => Task.FromResult<JsonNode?>(JsonValue.Create("second-replacement"))); 965Value = JsonValue.Create("managed-value")
HandleRegistryTests.cs (4)
262var json = JsonValue.Create("not an object"); 321var json = JsonValue.Create("string");
JsonRpcCallbackInvokerTests.cs (1)
70return JsonValue.Create("responsive");
KubernetesManifestTests.cs (3)
77WithField("spec.enableDefaultDeny.ingress", JsonValue.Create(true)!); 78WithField("spec.description", JsonValue.Create("API access")!); 79WithField("spec.description", JsonValue.Create("Frontend access to API")!);
ReferenceExpressionRefTests.cs (2)
175JsonValue.Create("6379") 198JsonValue.Create("6379")
Aspire.Hosting.Tests (15)
Backchannel\AuxiliaryBackchannelRpcTargetTests.cs (10)
330var normalJsonValue = Assert.IsAssignableFrom<JsonValue>(normalValue); 1325Assert.Equal("42", Assert.IsAssignableFrom<JsonValue>(snapshot.Properties["number"]).GetValue<string>()); 1326Assert.Equal(bool.TrueString, Assert.IsAssignableFrom<JsonValue>(snapshot.Properties["flag"]).GetValue<string>()); 1327Assert.Equal("one,two", Assert.IsAssignableFrom<JsonValue>(snapshot.Properties["list"]).GetValue<string>()); 1372Assert.Equal(42, Assert.IsAssignableFrom<JsonValue>(snapshot.Properties["number"]).GetValue<int>()); 1373Assert.True(Assert.IsAssignableFrom<JsonValue>(snapshot.Properties["flag"]).GetValue<bool>()); 1417Assert.Equal("true", Assert.IsAssignableFrom<JsonValue>(snapshot.Properties["terminal.enabled"]).GetValue<string>()); 1418Assert.Equal("0", Assert.IsAssignableFrom<JsonValue>(snapshot.Properties["terminal.replicaIndex"]).GetValue<string>()); 1419Assert.Equal("1", Assert.IsAssignableFrom<JsonValue>(snapshot.Properties["terminal.replicaCount"]).GetValue<string>());
Dcp\AppHostLocalStateStoreTests.cs (1)
117stateStore.Update("runtime", _ => JsonValue.Create("available"));
Dcp\JsonPatchTests.cs (4)
30var current = JsonValue.Create("before"); 31var changed = JsonValue.Create("after");
ConfigurationSchemaGenerator (1)
ConfigSchemaEmitter.cs (1)
733public override bool CanConvert(Type typeToConvert) => typeof(JsonNode).IsAssignableFrom(typeToConvert) && typeToConvert != typeof(JsonValue);
dotnet-user-jwts (1)
Helpers\JwtAuthenticationSchemeSettings.cs (1)
24[nameof(TokenValidationParameters.ValidAudiences)] = new JsonArray(Audiences.Select(aud => JsonValue.Create(aud)).ToArray()),
Infrastructure.Tests (3)
Pipelines\NixCliPackageTests.cs (1)
194return Assert.IsAssignableFrom<JsonValue>(value).GetValue<string>();
WorkflowScripts\AutoSecWorkflowTests.cs (2)
3060: JsonValue.Create("alert 42"); 3746.Select(step => (JsonNode?)JsonValue.Create(step.Children[new YamlScalarNode("if")].ToString())).ToArray());
Microsoft.AspNetCore.JsonPatch.SystemTextJson (2)
Internal\JsonObjectAdapter.cs (2)
141private static JsonValue GetJsonNull() => JsonValue.Create<object>(null);
Microsoft.AspNetCore.OpenApi (5)
Extensions\JsonNodeSchemaExtensions.cs (2)
623return jsonNode is JsonValue jsonValue && jsonValue.TryGetValue<string>(out var identifier) 632if (node is JsonValue jsonValue && jsonValue.TryGetValue<string>(out var identifier))
Services\OpenApiDocumentService.cs (2)
550eventSchema.Enum = [.. mapping.Keys.Select(static eventName => JsonValue.Create(eventName)!)]; 559.Select(static schemaReference => JsonValue.Create(schemaReference.Reference.Id)!)
Services\Schemas\OpenApiSchemaService.cs (1)
592refNode is JsonValue refValue &&
Microsoft.Extensions.AI (1)
ChatCompletion\ChatClientStructuredOutputExtensions.cs (1)
226_ => JsonValue.Create(element)
Microsoft.Extensions.AI.Abstractions (1)
Utilities\AIJsonUtilities.Defaults.cs (1)
74[JsonSerializable(typeof(JsonValue))]
Microsoft.Extensions.AI.Abstractions.Tests (3)
test\Shared\JsonSchemaExporter\TestTypes.cs (3)
104yield return new TestData<JsonValue>((JsonValue)42, "true"); 1248[JsonSerializable(typeof(JsonValue))]
Microsoft.ML.AutoML (9)
SweepableEstimator\Converter\MultiModelPipelineConverter.cs (2)
17var jValue = JsonValue.Parse(ref reader); 28jsonObject["estimators"] = JsonValue.Create(value.Estimators);
SweepableEstimator\Converter\SweepableEstimatorConverter.cs (3)
18var jsonObject = JsonValue.Parse(ref reader); 30jObject["estimatorType"] = JsonValue.Create(value.EstimatorType); 31jObject["parameter"] = JsonValue.Create(value.Parameter);
SweepableEstimator\Converter\SweepableEstimatorPipelineConverter.cs (2)
30jNode["parameter"] = JsonValue.Create(parameter); 31jNode["estimators"] = JsonValue.Create(estimators);
SweepableEstimator\Converter\SweepablePipelineConverter.cs (2)
17var jValue = JsonValue.Parse(ref reader); 30jsonObject["estimators"] = JsonValue.Create(value.Estimators);
Microsoft.NET.Build.Containers (2)
ImageConfig.cs (2)
168static JsonArray ToJsonArray(IEnumerable<string> items) => new(items.Where(s => !string.IsNullOrEmpty(s)).Select(s => JsonValue.Create(s)).ToArray<JsonNode?>()); 270if (property.Key is { } propertyName && property.Value is JsonValue propertyValue)
Microsoft.NET.Build.Tasks (3)
GenerateRuntimeConfigurationFiles.cs (3)
338return JsonValue.Create(boolValue); 343return JsonValue.Create(intValue); 346return JsonValue.Create(valueString);
Microsoft.TemplateEngine.Cli (6)
Alias\AliasRegistry.cs (1)
156arr.Add((JsonNode)JsonValue.Create(item)!);
JExtensions.cs (2)
28if (token is JsonValue val && val.GetValueKind() == JsonValueKind.String) 253if (token is JsonValue jv && jv.TryGetValue(out int intVal))
PostActionProcessors\AddJsonPropertyPostActionProcessor.cs (3)
219newValue = JsonValue.Create(newJsonPropertyValue); 227existingValue is JsonValue existingPrimitive && 228newValue is JsonValue newPrimitive &&
Microsoft.TemplateEngine.Edge (3)
parent\Shared\JExtensions.cs (3)
36if (token is JsonValue val && val.GetValueKind() == JsonValueKind.String) 55if (element is JsonValue strVal && strVal.GetValueKind() == JsonValueKind.String) 130if (token is JsonValue jv && jv.TryGetValue(out int intVal))
Microsoft.TemplateEngine.Orchestrator.RunnableProjects (4)
Macros\BaseMacroConfig.cs (1)
123if (jToken is not JsonValue val)
parent\Shared\JExtensions.cs (3)
36if (token is JsonValue val && val.GetValueKind() == JsonValueKind.String) 55if (element is JsonValue strVal && strVal.GetValueKind() == JsonValueKind.String) 130if (token is JsonValue jv && jv.TryGetValue(out int intVal))
Microsoft.TemplateEngine.Utils (3)
parent\Shared\JExtensions.cs (3)
36if (token is JsonValue val && val.GetValueKind() == JsonValueKind.String) 55if (element is JsonValue strVal && strVal.GetValueKind() == JsonValueKind.String) 130if (token is JsonValue jv && jv.TryGetValue(out int intVal))
Microsoft.TemplateSearch.Common (5)
parent\Shared\JExtensions.cs (3)
36if (token is JsonValue val && val.GetValueKind() == JsonValueKind.String) 55if (element is JsonValue strVal && strVal.GetValueKind() == JsonValueKind.String) 130if (token is JsonValue jv && jv.TryGetValue(out int intVal))
TemplateDiscoveryMetadata\BlobStorageTemplateInfo.cs (1)
241if (item.Value is JsonValue jv && jv.GetValueKind() == JsonValueKind.String)
TemplateDiscoveryMetadata\LegacySearchCacheReader.cs (1)
167if (versionNode is JsonValue versionVal && versionVal.GetValueKind() == JsonValueKind.String
NativeIntegrations.DockerCompose (10)
ComposeModels.cs (5)
196KeyValuePair.Create(pair.Key, (JsonNode?)JsonValue.Create(ComposeJson.Literal(pair.Value))))); 214KeyValuePair.Create(pair.Key, (JsonNode?)JsonValue.Create(ComposeJson.Literal(pair.Value))))); 347internal static JsonArray Strings(IEnumerable<string> values) => new(values.Select(value => (JsonNode?)JsonValue.Create(value)).ToArray()); 353JsonValue value when value.TryGetValue<string>(out var text) => JsonValue.Create(Literal(text)),
DockerComposeEnvironment.cs (2)
290JsonValue.Create(secret)!.ToJsonString(ComposeJson.s_indented)[1..^1], JsonValue.Create(secret)!.ToJsonString()[1..^1]
DockerComposeGenerator.cs (3)
153serviceEnvironment.Add(key, JsonValue.Create(Render(Normalize(value!.AsObject())))); 176serviceEnvironment[variable] = JsonValue.Create(target); 440if (configuration[property] is not JsonValue value || !value.TryGetValue<bool>(out _))
Shared.Tests (3)
JsonSchemaExporter\TestTypes.cs (3)
104yield return new TestData<JsonValue>((JsonValue)42, "true"); 1248[JsonSerializable(typeof(JsonValue))]
System.Text.Json (224)
System\Text\Json\Nodes\JsonArray.cs (5)
104case JsonValue value: 139/// <typeparam name="T">The type of the value to obtain from the <see cref="JsonValue"/>.</typeparam> 209[RequiresUnreferencedCode(JsonValue.CreateUnreferencedCodeMessage)] 210[RequiresDynamicCode(JsonValue.CreateDynamicCodeMessage)] 390if (Value is JsonValue)
System\Text\Json\Nodes\JsonNode.cs (18)
97/// Casts to the derived <see cref="JsonValue"/> type. 100/// A <see cref="JsonValue"/>. 103/// The node is not a <see cref="JsonValue"/>. 105public JsonValue AsValue() 107JsonValue? jValue = this as JsonValue; 111ThrowHelper.ThrowInvalidOperationException_NodeWrongType(nameof(JsonValue)); 179/// Gets the value for the current <see cref="JsonValue"/>. 181/// <typeparam name="T">The type of the value to obtain from the <see cref="JsonValue"/>.</typeparam> 182/// <returns>A value converted from the <see cref="JsonValue"/> instance.</returns> 188/// The underlying value of a <see cref="JsonValue"/> after deserialization is an instance of <see cref="JsonElement"/>, 189/// otherwise it's the value specified when the <see cref="JsonValue"/> was created. 191/// <seealso cref="System.Text.Json.Nodes.JsonValue.TryGetValue"></seealso> 196/// The current <see cref="JsonNode"/> is not a <see cref="JsonValue"/> or 200throw new InvalidOperationException(SR.Format(SR.NodeWrongType, nameof(JsonValue))); 328[RequiresUnreferencedCode(JsonValue.CreateUnreferencedCodeMessage)] 329[RequiresDynamicCode(JsonValue.CreateDynamicCodeMessage)] 392return JsonValue.CreateFromTypeInfo(value, jsonTypeInfo, options);
System\Text\Json\Nodes\JsonNode.Operators.cs (33)
15public static implicit operator JsonNode(bool value) => JsonValue.Create(value); 22public static implicit operator JsonNode?(bool? value) => JsonValue.Create(value); 29public static implicit operator JsonNode(byte value) => JsonValue.Create(value); 36public static implicit operator JsonNode?(byte? value) => JsonValue.Create(value); 43public static implicit operator JsonNode(char value) => JsonValue.Create(value); 50public static implicit operator JsonNode?(char? value) => JsonValue.Create(value); 57public static implicit operator JsonNode(DateTime value) => JsonValue.Create(value); 64public static implicit operator JsonNode?(DateTime? value) => JsonValue.Create(value); 71public static implicit operator JsonNode(DateTimeOffset value) => JsonValue.Create(value); 78public static implicit operator JsonNode?(DateTimeOffset? value) => JsonValue.Create(value); 85public static implicit operator JsonNode(decimal value) => JsonValue.Create(value); 92public static implicit operator JsonNode?(decimal? value) => JsonValue.Create(value); 99public static implicit operator JsonNode(double value) => JsonValue.Create(value); 106public static implicit operator JsonNode?(double? value) => JsonValue.Create(value); 113public static implicit operator JsonNode(Guid value) => JsonValue.Create(value); 120public static implicit operator JsonNode?(Guid? value) => JsonValue.Create(value); 127public static implicit operator JsonNode(short value) => JsonValue.Create(value); 134public static implicit operator JsonNode?(short? value) => JsonValue.Create(value); 141public static implicit operator JsonNode(int value) => JsonValue.Create(value); 148public static implicit operator JsonNode?(int? value) => JsonValue.Create(value); 155public static implicit operator JsonNode(long value) => JsonValue.Create(value); 162public static implicit operator JsonNode?(long? value) => JsonValue.Create(value); 170public static implicit operator JsonNode(sbyte value) => JsonValue.Create(value); 178public static implicit operator JsonNode?(sbyte? value) => JsonValue.Create(value); 185public static implicit operator JsonNode(float value) => JsonValue.Create(value); 192public static implicit operator JsonNode?(float? value) => JsonValue.Create(value); 200public static implicit operator JsonNode?(string? value) => JsonValue.Create(value); 208public static implicit operator JsonNode(ushort value) => JsonValue.Create(value); 216public static implicit operator JsonNode?(ushort? value) => JsonValue.Create(value); 224public static implicit operator JsonNode(uint value) => JsonValue.Create(value); 232public static implicit operator JsonNode?(uint? value) => JsonValue.Create(value); 240public static implicit operator JsonNode(ulong value) => JsonValue.Create(value); 248public static implicit operator JsonNode?(ulong? value) => JsonValue.Create(value);
System\Text\Json\Nodes\JsonNode.To.cs (1)
43if (this is JsonValue)
System\Text\Json\Nodes\JsonObject.cs (2)
211case JsonValue value: 367if (Value is JsonValue)
System\Text\Json\Nodes\JsonValue.CreateOverloads.cs (142)
12/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 14/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 16/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 17public static JsonValue Create(bool value, JsonNodeOptions? options = null) => new JsonValuePrimitive<bool>(value, JsonMetadataServices.BooleanConverter, options); 20/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 22/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 24/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 25public static JsonValue? Create(bool? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<bool>(value.Value, JsonMetadataServices.BooleanConverter, options) : null; 28/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 30/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 32/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 33public static JsonValue Create(byte value, JsonNodeOptions? options = null) => new JsonValuePrimitive<byte>(value, JsonMetadataServices.ByteConverter, options); 36/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 38/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 40/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 41public static JsonValue? Create(byte? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<byte>(value.Value, JsonMetadataServices.ByteConverter, options) : null; 44/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 46/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 48/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 49public static JsonValue Create(char value, JsonNodeOptions? options = null) => new JsonValuePrimitive<char>(value, JsonMetadataServices.CharConverter, options); 52/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 54/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 56/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 57public static JsonValue? Create(char? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<char>(value.Value, JsonMetadataServices.CharConverter, options) : null; 60/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 62/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 64/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 65public static JsonValue Create(DateTime value, JsonNodeOptions? options = null) => new JsonValuePrimitive<DateTime>(value, JsonMetadataServices.DateTimeConverter, options); 68/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 70/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 72/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 73public static JsonValue? Create(DateTime? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<DateTime>(value.Value, JsonMetadataServices.DateTimeConverter, options) : null; 76/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 78/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 80/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 81public static JsonValue Create(DateTimeOffset value, JsonNodeOptions? options = null) => new JsonValuePrimitive<DateTimeOffset>(value, JsonMetadataServices.DateTimeOffsetConverter, options); 84/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 86/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 88/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 89public static JsonValue? Create(DateTimeOffset? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<DateTimeOffset>(value.Value, JsonMetadataServices.DateTimeOffsetConverter, options) : null; 92/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 94/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 96/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 97public static JsonValue Create(decimal value, JsonNodeOptions? options = null) => new JsonValuePrimitive<decimal>(value, JsonMetadataServices.DecimalConverter, options); 100/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 102/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 104/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 105public static JsonValue? Create(decimal? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<decimal>(value.Value, JsonMetadataServices.DecimalConverter, options) : null; 108/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 110/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 112/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 113public static JsonValue Create(double value, JsonNodeOptions? options = null) => new JsonValuePrimitive<double>(value, JsonMetadataServices.DoubleConverter, options); 116/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 118/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 120/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 121public static JsonValue? Create(double? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<double>(value.Value, JsonMetadataServices.DoubleConverter, options) : null; 124/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 126/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 128/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 129public static JsonValue Create(Guid value, JsonNodeOptions? options = null) => new JsonValuePrimitive<Guid>(value, JsonMetadataServices.GuidConverter, options); 132/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 134/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 136/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 137public static JsonValue? Create(Guid? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<Guid>(value.Value, JsonMetadataServices.GuidConverter, options) : null; 140/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 142/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 144/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 145public static JsonValue Create(short value, JsonNodeOptions? options = null) => new JsonValuePrimitive<short>(value, JsonMetadataServices.Int16Converter, options); 148/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 150/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 152/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 153public static JsonValue? Create(short? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<short>(value.Value, JsonMetadataServices.Int16Converter, options) : null; 156/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 158/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 160/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 161public static JsonValue Create(int value, JsonNodeOptions? options = null) => new JsonValuePrimitive<int>(value, JsonMetadataServices.Int32Converter, options); 164/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 166/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 168/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 169public static JsonValue? Create(int? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<int>(value.Value, JsonMetadataServices.Int32Converter, options) : null; 172/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 174/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 176/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 177public static JsonValue Create(long value, JsonNodeOptions? options = null) => new JsonValuePrimitive<long>(value, JsonMetadataServices.Int64Converter, options); 180/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 182/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 184/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 185public static JsonValue? Create(long? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<long>(value.Value, JsonMetadataServices.Int64Converter, options) : null; 188/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 190/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 192/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 194public static JsonValue Create(sbyte value, JsonNodeOptions? options = null) => new JsonValuePrimitive<sbyte>(value, JsonMetadataServices.SByteConverter, options); 197/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 199/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 201/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 203public static JsonValue? Create(sbyte? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<sbyte>(value.Value, JsonMetadataServices.SByteConverter, options) : null; 206/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 208/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 210/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 211public static JsonValue Create(float value, JsonNodeOptions? options = null) => new JsonValuePrimitive<float>(value, JsonMetadataServices.SingleConverter, options); 214/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 216/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 218/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 219public static JsonValue? Create(float? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<float>(value.Value, JsonMetadataServices.SingleConverter, options) : null; 222/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 224/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 226/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 228public static JsonValue? Create(string? value, JsonNodeOptions? options = null) => value is not null ? new JsonValuePrimitive<string>(value, JsonMetadataServices.StringConverter!, options) : null; 231/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 233/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 235/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 237public static JsonValue Create(ushort value, JsonNodeOptions? options = null) => new JsonValuePrimitive<ushort>(value, JsonMetadataServices.UInt16Converter, options); 240/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 242/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 244/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 246public static JsonValue? Create(ushort? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<ushort>(value.Value, JsonMetadataServices.UInt16Converter, options) : null; 249/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 251/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 253/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 255public static JsonValue Create(uint value, JsonNodeOptions? options = null) => new JsonValuePrimitive<uint>(value, JsonMetadataServices.UInt32Converter, options); 258/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 260/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 262/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 264public static JsonValue? Create(uint? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<uint>(value.Value, JsonMetadataServices.UInt32Converter, options) : null; 267/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 269/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 271/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 273public static JsonValue Create(ulong value, JsonNodeOptions? options = null) => new JsonValuePrimitive<ulong>(value, JsonMetadataServices.UInt64Converter, options); 276/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 278/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 280/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 282public static JsonValue? Create(ulong? value, JsonNodeOptions? options = null) => value.HasValue ? new JsonValuePrimitive<ulong>(value.Value, JsonMetadataServices.UInt64Converter, options) : null; 285/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 287/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 289/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 290public static JsonValue? Create(JsonElement value, JsonNodeOptions? options = null) => JsonValue.CreateFromElement(ref value, options); 293/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 295/// <param name="value">The underlying value of the new <see cref="JsonValue"/> instance.</param> 297/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 298public static JsonValue? Create(JsonElement? value, JsonNodeOptions? options = null) => value is JsonElement element ? JsonValue.CreateFromElement(ref element, options) : null;
System\Text\Json\Nodes\JsonValue.cs (12)
29/// The underlying value of a <see cref="JsonValue"/> after deserialization is an instance of <see cref="JsonElement"/>, 30/// otherwise it's the value specified when the <see cref="JsonValue"/> was created. 39/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 42/// The new instance of the <see cref="JsonValue"/> class that contains the specified value. 47/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 50public static JsonValue? Create<T>(T? value, JsonNodeOptions? options = null) 72/// Initializes a new instance of the <see cref="JsonValue"/> class that contains the specified value. 75/// The new instance of the <see cref="JsonValue"/> class that contains the specified value. 81/// <returns>The new instance of the <see cref="JsonValue"/> class that contains the specified value.</returns> 82public static JsonValue? Create<T>(T? value, JsonTypeInfo<T> jsonTypeInfo, JsonNodeOptions? options = null) 161internal static JsonValue CreateFromTypeInfo<T>(T value, JsonTypeInfo<T> jsonTypeInfo, JsonNodeOptions? options = null) 178internal static JsonValue? CreateFromElement(ref readonly JsonElement element, JsonNodeOptions? options = null)
System\Text\Json\Nodes\JsonValueOfElement.cs (1)
30if (otherNode is JsonValue)
System\Text\Json\Nodes\JsonValueOfJsonPrimitive.cs (1)
14internal static JsonValue CreatePrimitiveValue(ref Utf8JsonReader reader, JsonNodeOptions options)
System\Text\Json\Nodes\JsonValueOfTPrimitive.cs (1)
32if (otherNode is JsonValue otherValue && otherValue.TryGetValue(out TValue? v))
System\Text\Json\Serialization\Converters\Node\JsonNodeConverterFactory.cs (1)
18if (typeof(JsonValue).IsAssignableFrom(typeToConvert))
System\Text\Json\Serialization\Converters\Node\JsonValueConverter.cs (5)
10internal sealed class JsonValueConverter : JsonConverter<JsonValue?> 12public override void Write(Utf8JsonWriter writer, JsonValue? value, JsonSerializerOptions options) 23public override JsonValue? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 39return JsonValue.CreateFromElement(ref element, options.GetNodeOptions()); 43internal static JsonValue ReadNonNullPrimitiveValue(ref Utf8JsonReader reader, JsonNodeOptions options)
System\Text\Json\Serialization\JsonSerializer.Read.HandleMetadata.cs (1)
503if (jsonNode is JsonValue jsonValue &&
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Converters.cs (1)
144public static JsonConverter<JsonValue?> JsonValueConverter => field ??= new JsonValueConverter();