753 instantiations of JsonObject
aspire (71)
Agents\ClaudeCode\ClaudeCodeAgentEnvironmentScanner.cs (2)
209config["mcpServers"] = new JsonObject(); 215servers[AspireServerName] = new JsonObject
Agents\Copilot\CopilotAgentEnvironmentScanner.cs (3)
179config["mcpServers"] = new JsonObject(); 185servers[AspireServerName] = new JsonObject 190["env"] = new JsonObject
Agents\Hooks\TelemetryHookConfigurator.cs (8)
138var config = new JsonObject 141["hooks"] = new JsonObject 144new JsonObject 199settings = new JsonObject(); 213settings = new JsonObject(); 230hooks = new JsonObject(); 279postToolUse.Add((JsonNode?)new JsonObject 283new JsonObject
Agents\McpConfigFileHelper.cs (1)
73return new JsonObject();
Agents\OpenCode\OpenCodeAgentEnvironmentScanner.cs (2)
200config["mcp"] = new JsonObject(); 206mcp[AspireServerName] = new JsonObject
Agents\VsCode\VsCodeAgentEnvironmentScanner.cs (2)
254config["servers"] = new JsonObject(); 260servers[AspireServerName] = new JsonObject
Commands\InitCommand.cs (15)
551settings = new JsonObject(); 557settings = JsonNode.Parse(existingContent)?.AsObject() ?? new JsonObject(); 569settings = new JsonObject(); 575appHost = new JsonObject(); 630settings["profiles"] = new JsonObject 632["https"] = new JsonObject 635["environmentVariables"] = new JsonObject 641["http"] = new JsonObject 644["environmentVariables"] = new JsonObject 811var settings = new JsonObject 814["profiles"] = new JsonObject 816["https"] = new JsonObject 822["environmentVariables"] = new JsonObject 830["http"] = new JsonObject 836["environmentVariables"] = new JsonObject
Commands\ResourceCommand.cs (2)
281var arguments = new JsonObject(); 373var arguments = new JsonObject();
Commands\SecretListCommand.cs (1)
55var obj = new JsonObject();
Configuration\ConfigurationService.cs (4)
38? new JsonObject() 39: JsonNode.Parse(existingContent, nodeOptions: null, ConfigurationHelper.ParseOptions)?.AsObject() ?? new JsonObject(); 43settings = new JsonObject(); 238currentObject[part] = new JsonObject();
Mcp\Tools\ExecuteResourceCommandTool.cs (1)
175var arguments = new JsonObject();
Migrations\TypeScriptAppHostMigration.cs (1)
82Metadata = new JsonObject
Projects\FallbackProjectParser.cs (5)
121var rootObject = new JsonObject(); 124var itemsObject = new JsonObject(); 130var packageObj = new JsonObject(); 141var projectObj = new JsonObject(); 151var propertiesObject = new JsonObject();
Scaffolding\PackageJsonMerger.cs (1)
362obj = new JsonObject();
Scaffolding\ScaffoldingService.cs (1)
379obj = new JsonObject();
src\Shared\ConsoleLogs\SharedAIHelpers.cs (6)
220var attributesObj = new JsonObject(); 233var linkObjects = span.Links.Select(link => (JsonNode)new JsonObject 255var spanObj = new JsonObject 400var traceData = new JsonObject 722var attributesObject = new JsonObject(); 730var log = new JsonObject
src\Shared\Json\JsonFlattener.cs (3)
18var result = new JsonObject(); 28var result = new JsonObject(); 40var newObject = new JsonObject();
src\Shared\UserSecrets\SecretsStore.cs (1)
79var obj = new JsonObject();
Utils\ConfigurationHelper.cs (1)
341currentObject[part] = new JsonObject();
Utils\EnvironmentChecker\AspireVersionCheck.cs (2)
425var metadata = new JsonObject(); 462var metadata = new JsonObject
Utils\EnvironmentChecker\DevCertsCheck.cs (2)
530var certNode = new JsonObject 541return new JsonObject
Utils\EnvironmentChecker\EnvironmentChecker.cs (1)
131Metadata = new JsonObject
Utils\EnvironmentChecker\OperatingSystemCheck.cs (1)
144var metadata = new JsonObject
Utils\EnvironmentChecker\TypeScriptAppHostToolingCheck.cs (4)
89Metadata = new JsonObject 125Metadata = new JsonObject 159Metadata = new JsonObject 192Metadata = new JsonObject
Utils\EnvironmentChecker\VsCodeExtensionCheck.cs (1)
221=> new()
Aspire.Cli.EndToEnd.Tests (6)
Helpers\CliE2ETestHelpers.cs (3)
1115? JsonNode.Parse(File.ReadAllText(configPath))?.AsObject() ?? new JsonObject() 1116: new JsonObject(); 1119config["sdk"] = new JsonObject
ProjectReferenceTests.cs (1)
118var packages = config["packages"] as JsonObject ?? new JsonObject();
TypeScriptEmptyAppHostTemplateTests.cs (1)
180config["packages"] = new JsonObject
TypeScriptPolyglotTests.cs (1)
354config["features"] = new JsonObject
Aspire.Cli.Tests (70)
Agents\CopilotAgentEnvironmentScannerTests.cs (6)
121var existingConfig = new JsonObject 123["mcpServers"] = new JsonObject 125["other-server"] = new JsonObject 161var existingConfig = new JsonObject 163["mcpServers"] = new JsonObject 165["aspire"] = new JsonObject
Agents\TelemetryHookConfiguratorTests.cs (4)
136var existing = new JsonObject 139["hooks"] = new JsonObject 142new JsonObject 146new JsonObject
Agents\VsCodeAgentEnvironmentScannerTests.cs (6)
177var existingConfig = new JsonObject 179["servers"] = new JsonObject 181["other-server"] = new JsonObject 218var existingConfig = new JsonObject 220["servers"] = new JsonObject 222["other-server"] = new JsonObject
Commands\DescribeCommandTests.cs (1)
738[KnownProperties.Resource.ConnectionProperties] = new JsonObject
Commands\InitCommandTests.cs (6)
853var existingConfig = new JsonObject 856["features"] = new JsonObject { ["polyglotSupportEnabled"] = true } 1338var existing = new JsonObject { ["channel"] = "pr-99999" }; 1546var existing = new JsonObject { ["channel"] = "pr-99999" }; 2373var config = new JsonObject 2375["appHost"] = new JsonObject
Commands\ResourceCommandHelperTests.cs (1)
127var arguments = new JsonObject
Migrations\PendingMigrationsCheckTests.cs (1)
39Metadata = new JsonObject { ["language"] = "typescript" }
Projects\ProjectUpdaterTests.cs (43)
107var itemsAndProperties = new JsonObject(); 232var itemsAndProperties = new JsonObject(); 387var itemsAndProperties = new JsonObject(); 506var itemsAndProperties = new JsonObject(); 659var itemsAndProperties = new JsonObject(); 779var itemsAndProperties = new JsonObject(); 940var itemsAndProperties = new JsonObject(); 1058var itemsAndProperties = new JsonObject(); 1160var itemsAndProperties = new JsonObject(); 1286var itemsAndProperties = new JsonObject(); 1380var itemsAndProperties = new JsonObject(); 1454var itemsAndProperties = new JsonObject(); 1550var itemsAndProperties = new JsonObject(); 1713var itemsAndProperties = new JsonObject(); 1861var itemsAndProperties = new JsonObject(); 1978var itemsAndProperties = new JsonObject(); 2098var itemsAndProperties = new JsonObject(); 2211var itemsAndProperties = new JsonObject(); 2578var itemsAndProperties = new JsonObject(); 2660var itemsAndProperties = new JsonObject(); 2756var itemsAndProperties = new JsonObject(); 2760var items = new JsonObject 2764new JsonObject { ["Identity"] = "Aspire.Hosting.AppHost", ["Version"] = "9.4.1" }, 2765new JsonObject { ["Identity"] = "Aspire.Hosting.Redis", ["Version"] = "9.4.1" }, 2847var itemsAndProperties = new JsonObject(); 2849var items = new JsonObject 2853new JsonObject { ["Identity"] = "Aspire.Hosting.AppHost", ["Version"] = "9.5.0" }, 2923var itemsAndProperties = new JsonObject(); 3004var itemsAndProperties = new JsonObject(); 3093var itemsAndProperties = new JsonObject(); 3172var itemsAndProperties = new JsonObject(); 3252var itemsAndProperties = new JsonObject(); 3396var itemsAndProperties = new JsonObject(); 3782var itemsAndProperties = new JsonObject(); 3890var itemsAndProperties = new JsonObject(); 3967var itemsAndProperties = new JsonObject(); 4057var itemsAndProperties = new JsonObject(); 4103JsonObject properties = new JsonObject(); 4115JsonObject items = new JsonObject(); 4143JsonObject newPackageReference = new JsonObject 4159JsonObject newPackageReference = new JsonObject 4175JsonObject newProjectReference = new JsonObject 4186JsonObject properties = new JsonObject();
Scaffolding\ScaffoldingServiceTests.cs (2)
136var scripts = new JsonObject(); 159var scripts = new JsonObject();
Aspire.Dashboard (3)
Model\GenAI\GenAIItemPartViewModel.cs (1)
140var jsonObject = new JsonObject();
Model\TelemetryExportService.cs (1)
805var jsonObject = new JsonObject();
Otlp\Model\OtlpHelpers.cs (1)
197var o = new JsonObject();
Aspire.Dashboard.Tests (9)
Integration\OtlpGrpcServiceTests.cs (6)
164var configJson = new JsonObject 166["Dashboard"] = new JsonObject 168["Otlp"] = new JsonObject 212configJson = new JsonObject 214["Dashboard"] = new JsonObject 216["Otlp"] = new JsonObject
Integration\StartupTests.cs (3)
636var configJson = new JsonObject 638["Logging"] = new JsonObject 640["LogLevel"] = new JsonObject
Aspire.Hosting (9)
Backchannel\AuxiliaryBackchannelRpcTarget.cs (1)
1413var jsonObject = new JsonObject();
Dcp\JsonPatch.cs (1)
107var result = new JsonObject
Pipelines\Internal\DeploymentStateManagerBase.cs (1)
341nextObj = new JsonObject();
Pipelines\Internal\FileDeploymentStateManager.cs (2)
386new JsonObject { [""] = sectionValue.DeepClone() }, 803var migrationState = new JsonObject
Pipelines\Internal\JsonFlattener.cs (3)
21var result = new JsonObject(); 34var result = new JsonObject(); 46var newObject = new JsonObject();
UserSecrets\UserSecretsManagerFactory.cs (1)
208var contents = new JsonObject();
Aspire.Hosting.Azure (17)
AzureDeploymentOperationDetails.cs (3)
78var json = new JsonObject 136var json = new JsonObject(); 171return new JsonObject
AzureProvisioningController.cs (6)
2518var json = new JsonObject 2554var json = new JsonObject 2645return new JsonObject 2675var json = new JsonObject 2684["azureContext"] = new JsonObject 2721var json = new JsonObject
AzureProvisioningFailureDetails.cs (2)
377array.Add(new JsonObject 455var json = new JsonObject
Provisioning\BicepUtilities.cs (3)
55parameters[parameter.Key] = new JsonObject() 138? new JsonObject() 182? new JsonObject()
Provisioning\JsonExtensions.cs (1)
22node = new JsonObject();
Provisioning\Provisioners\BicepProvisioner.cs (2)
568var parameters = new JsonObject(); 571var scope = new JsonObject();
Aspire.Hosting.Azure.Kubernetes.Tests (49)
AzureKubernetesInfrastructureTests.cs (49)
254stateManager.SetSection("Azure", new JsonObject 259stateManager.SetSection("Azure:Deployments:aks", new JsonObject 261["Outputs"] = new JsonObject 263["id"] = new JsonObject 270["name"] = new JsonObject 276["Scope"] = new JsonObject 282stateManager.SetSection("HelmChart:aks:podinfo", new JsonObject 416stateManager.SetSection("Azure", new JsonObject 421stateManager.SetSection("Azure:Deployments:aks", new JsonObject 423["Outputs"] = new JsonObject 425["id"] = new JsonObject 430["name"] = new JsonObject 436["Scope"] = new JsonObject 442stateManager.SetSection("Helm:aks", new JsonObject 505stateManager.SetSection("Azure", new JsonObject 510stateManager.SetSection("Azure:Deployments:aks", new JsonObject 512["Outputs"] = new JsonObject 514["id"] = new JsonObject 521stateManager.SetSection("Helm:aks", new JsonObject 585stateManager.SetSection("Azure:Deployments:aks", new JsonObject 589stateManager.SetSection("Helm:aks", new JsonObject 630stateManager.SetSection("Azure:Deployments:aks", new JsonObject 632["Outputs"] = new JsonObject 634["id"] = new JsonObject 678stateManager.SetSection("Sentinel", new JsonObject { ["Value"] = "cleared-by-destroy" }); 713stateManager.SetSection("Azure:Deployments:aks", new JsonObject 754stateManager.SetSection("Azure:Deployments:aks", new JsonObject 756["Outputs"] = new JsonObject 758["id"] = new JsonObject 809stateManager.SetSection("Azure:Deployments:aks", new JsonObject 811["Outputs"] = new JsonObject 813["id"] = new JsonObject 820stateManager.SetSection("Helm:aks", new JsonObject 877stateManager.SetSection("Azure:Deployments:aks", new JsonObject 879["Outputs"] = new JsonObject 881["id"] = new JsonObject 949stateManager.SetSection("Azure:Deployments:aks", new JsonObject 951["Outputs"] = new JsonObject 953["id"] = new JsonObject 1018stateManager.SetSection("Azure:Deployments:aks", new JsonObject 1020["Outputs"] = new JsonObject 1022["id"] = new JsonObject 1122deploymentStateManager.SetSection("Azure", new JsonObject 1147deploymentStateManager.SetSection("Azure", new JsonObject 1336deploymentStateManager.SetSection("Azure", new JsonObject 1436deploymentStateManager.SetSection("Azure", new JsonObject 1647deploymentStateManager.SetSection("Azure", new JsonObject 1718deploymentStateManager.SetSection("Azure", new JsonObject 1802var azureState = new JsonObject { ["SubscriptionId"] = subscriptionId };
Aspire.Hosting.Azure.Sandboxes (6)
AzureSandboxContainerDeployment.cs (6)
367portStates.Add(new JsonObject 2014return new JsonObject 2020.Select(static endpoint => (JsonNode)new JsonObject 2033.Select(static identity => (JsonNode)new JsonObject 2039["EgressPolicy"] = new JsonObject 2047.Select(static rule => (JsonNode)new JsonObject
Aspire.Hosting.Azure.Tests (85)
AzureBicepProvisionerTests.cs (7)
866var parameters = new JsonObject(); 902var parameters = new JsonObject(); 953var parameters = new JsonObject(); 1842var parameters = new JsonObject(); 1845var scope = new JsonObject(); 1858=> new() 1860["blobEndpoint"] = new JsonObject
AzureBicepResourceTests.cs (1)
184.WithParameter("param3", new JsonObject() { ["value"] = "nested" })
AzureDeployerTests.cs (3)
1692var cachedState = new JsonObject 1987stateManager.SetSection("Azure", new JsonObject 2039stateManager.SetSection("Azure", new JsonObject
AzureEnvironmentResourceExtensionsTests.cs (8)
1768storageSection.Data["Outputs"] = new JsonObject 1770["id"] = new JsonObject 1871keyVaultSection.Data["Outputs"] = new JsonObject 1873["id"] = new JsonObject 3010storageSection.Data["Outputs"] = new JsonObject 3012["id"] = new JsonObject 3331storageSection.Data["Outputs"] = new JsonObject 3333["id"] = new JsonObject
AzureEventHubsExtensionsTests.cs (1)
400document["UserConfig"]!["LoggingConfig"] = new JsonObject { ["Type"] = "Console" };
AzureSandboxesTests.cs (13)
789new JsonObject { ["OwnerId"] = "owner-1" }, 793new JsonObject(), 805new JsonObject 871new JsonObject 907new JsonObject 974new JsonObject 1091var state = new DeploymentStateSection("sandbox", new JsonObject 1095["Ports"] = new JsonArray(new JsonObject { ["Port"] = 8080 }) 1129var state = new DeploymentStateSection("sandbox", new JsonObject 1133["Ports"] = new JsonArray(new JsonObject { ["Port"] = 8080 }) 2730state.Data["Ports"] = new JsonArray(new JsonObject 2865new JsonObject 3149state.Data["Ports"] = new JsonArray(new JsonObject
AzureServiceBusExtensionsTests.cs (1)
512document["UserConfig"]!["Logging"] = new JsonObject { ["Type"] = "Console" };
BicepUtilitiesTests.cs (47)
22var parameters = new JsonObject(); 53.WithParameter("jsonObj", new JsonObject { ["key"] = "value" }) 58var parameters = new JsonObject(); 101.WithParameter("jsonObj", new JsonObject { ["key"] = "value" }); 107.WithParameter("jsonObj", new JsonObject { ["key"] = "value" }); 109var parameters0 = new JsonObject(); 113var parameters1 = new JsonObject(); 134.WithParameter("jsonObj", new JsonObject { ["key"] = "value" }); 136var parameters0 = new JsonObject(); 140var parameters1 = new JsonObject(); 160var parameters0 = new JsonObject(); 161var scope0 = new JsonObject(); 166var parameters1 = new JsonObject(); 167var scope1 = new JsonObject(); 188var parameters0 = new JsonObject(); 189var scope0 = new JsonObject(); 194var parameters1 = new JsonObject(); 195var scope1 = new JsonObject(); 211var parameters = new JsonObject 213["param1"] = new JsonObject { ["value"] = "value1" } 231var parameters1 = new JsonObject 233["param1"] = new JsonObject { ["value"] = "value1" } 236var parameters2 = new JsonObject 238["param1"] = new JsonObject { ["value"] = "value2" } 256var parameters = new JsonObject 258["param1"] = new JsonObject { ["value"] = "value1" } 261var scope1 = new JsonObject { ["resourceGroup"] = "rg1" }; 262var scope2 = new JsonObject { ["resourceGroup"] = "rg2" }; 284var parameters1 = new JsonObject 286["param1"] = new JsonObject { ["value"] = value1 } 289var parameters2 = new JsonObject 291["param1"] = new JsonObject { ["value"] = value2 } 319var parameters = new JsonObject(); 338var scope = new JsonObject(); 353var scope = new JsonObject(); 369var scope = new JsonObject(); 384var scope = new JsonObject 403var scope = new JsonObject(); 417var scope = new JsonObject(); 462var parameters = new JsonObject 464["param1"] = new JsonObject { ["value"] = "value1" } 488var legacyParameters = new JsonObject(); 503var currentParameters = new JsonObject(); 504var currentScope = new JsonObject(); 527var parameters = new JsonObject 529[AzureBicepResource.KnownParameters.PrincipalType] = new JsonObject { ["value"] = "User" }, 530[AzureBicepResource.KnownParameters.PrincipalId] = new JsonObject { ["value"] = "1234" },
JsonExtensionsTests.cs (3)
14var rootJson = new JsonObject(); 30var rootJson = new JsonObject(); 44var rootJson = new JsonObject();
ProvisioningTestHelpers.cs (1)
1042: new JsonObject();
Aspire.Hosting.Blazor (3)
GatewayConfigurationBuilder.cs (3)
222var environment = new JsonObject(); 253var config = new JsonObject 255["webAssembly"] = new JsonObject
Aspire.Hosting.CodeGeneration.Java.Tests (1)
AtsJavaCodeGeneratorTests.cs (1)
3536Value = new JsonObject { ["Default"] = "probe" },
Aspire.Hosting.CodeGeneration.TypeScript (10)
TypeScriptApiExportWriter.cs (8)
34declarations.Add((JsonNode)new JsonObject 42return new JsonObject 46["generator"] = new JsonObject 51["package"] = new JsonObject 80var json = new JsonObject { ["name"] = module.Name }; 88var json = new JsonObject 119var json = new JsonObject 142var parameterJson = new JsonObject
TypeScriptLanguageSupport.cs (2)
127var packageJson = new JsonObject(); 213obj = new JsonObject();
Aspire.Hosting.Docker.Tests (1)
DockerComposeTests.cs (1)
962stateManager.SetSection("DockerCompose:env", new System.Text.Json.Nodes.JsonObject
Aspire.Hosting.Kubernetes (2)
KubernetesEnvironmentResource.cs (2)
2074var metadataNode = new System.Text.Json.Nodes.JsonObject 2094var minimal = new System.Text.Json.Nodes.JsonObject
Aspire.Hosting.Kubernetes.Tests (4)
KubernetesDeployTests.cs (4)
1895stateManager.SetSection("Helm:env", new JsonObject 1966stateManager.SetSection("Helm:env", new JsonObject 2011stateManager.SetSection("Helm:env", new JsonObject 2059stateManager.SetSection("HelmChart:env:podinfo", new JsonObject
Aspire.Hosting.Radius (3)
Publishing\RadiusDeploymentPipelineStep.cs (3)
268var parametersNode = new JsonObject(); 272parametersNode[identifier] = new JsonObject { ["value"] = value }; 275var document = new JsonObject
Aspire.Hosting.RemoteHost (8)
Ats\AtsCallbackProxyFactory.cs (1)
299args ??= new JsonObject();
Ats\AtsError.cs (2)
45var obj = new JsonObject 96var obj = new JsonObject();
Ats\CapabilityDispatcher.cs (2)
277return Task.FromResult<JsonNode?>(new JsonObject 547args ??= new JsonObject();
Ats\HandleRegistry.cs (1)
148return new JsonObject
RemoteAppHostService.cs (2)
141return new JsonObject 175return new JsonObject
Aspire.Hosting.RemoteHost.Tests (230)
AtsMarshallerTests.cs (51)
333var json = new JsonObject 374var json = new JsonObject { ["$handle"] = handleId }; 386var json = new JsonObject { ["$handle"] = "aspire/Unknown:999" }; 422var json = new JsonObject { ["key1"] = 1, ["key2"] = 2 }; 700var json = new JsonObject { ["a"] = 1, ["b"] = 2 }; 713var json = new JsonObject { ["value"] = 42 }; 726var json = new JsonObject { ["name"] = "test", ["count"] = 5 }; 740var json = new JsonObject 746new JsonObject 748["$expr"] = new JsonObject 784var json = new JsonObject 803var json = new JsonObject 838var json = new JsonObject { ["required"] = double.MaxValue }; 986var source = new JsonObject { ["name"] = "updated", ["count"] = 42 }; 999var source = new JsonObject { ["name"] = "updated" }; 1012var source = new JsonObject 1015["complex"] = new JsonObject { ["value"] = "should-be-ignored" } 1029var source = new JsonObject { ["display_name"] = "updated", ["val"] = 99 }; 1043var source = new JsonObject { ["displayName"] = "should-not-apply" }; 1055var source = new JsonObject { ["name"] = "updated", ["secret"] = "should-be-ignored" }; 1068var source = new JsonObject { ["name"] = "updated", ["computed"] = "should-be-ignored" }; 1082var source = new JsonObject { ["count"] = "not-a-number" }; 1095var source = new JsonObject 1331var json = new JsonObject 1333["$expr"] = new JsonObject 1335["condition"] = new JsonObject 1339["whenTrue"] = new JsonObject 1341["$expr"] = new JsonObject 1346["whenFalse"] = new JsonObject 1348["$expr"] = new JsonObject 1372var json = new JsonObject 1374["$expr"] = new JsonObject 1376["condition"] = new JsonObject 1380["whenTrue"] = new JsonObject 1382["$expr"] = new JsonObject 1387["whenFalse"] = new JsonObject 1389["$expr"] = new JsonObject 1414var json = new JsonObject 1416["$expr"] = new JsonObject 1418["condition"] = new JsonObject 1422["whenTrue"] = new JsonObject 1424["$expr"] = new JsonObject 1429["whenFalse"] = new JsonObject 1431["$expr"] = new JsonObject 1453var json = new JsonObject 1455["$expr"] = new JsonObject 1457["condition"] = new JsonObject 1461["whenTrue"] = new JsonObject 1463["$expr"] = new JsonObject 1468["whenFalse"] = new JsonObject 1470["$expr"] = new JsonObject
CallbackProxyTests.cs (9)
280ResultToReturn = new JsonObject 282["p0"] = new JsonObject { ["name"] = "modified", ["count"] = 42 } 302ResultToReturn = new JsonObject 304["p0"] = new JsonObject { ["name"] = "async-modified", ["count"] = 99 } 326ResultToReturn = new JsonObject 329["p1"] = new JsonObject { ["name"] = "mixed-modified", ["count"] = 77 } 369ResultToReturn = new JsonObject 371["p0"] = new JsonObject { ["name"] = "first-updated", ["count"] = 10 }, 372["p1"] = new JsonObject { ["name"] = "second-updated", ["count"] = 20 }
CapabilityDispatcherTests.cs (145)
73dispatcher.Invoke("test/capability@1", new JsonObject { ["name"] = "test-value" }); 184var args = new JsonObject { ["value"] = "hello" }; 196var args = new JsonObject { ["required"] = "test" }; 208var args = new JsonObject { ["required"] = "test", ["optional"] = "custom" }; 220var args = new JsonObject { ["value"] = "test" }; 263var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } }; 290var args = new JsonObject { ["context"] = "not-a-handle" }; 302var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = "Aspire.Hosting.RemoteHost.Tests/Aspire.Hosting.RemoteHost.Tests.TestContextType:999" } }; 319var getArgs = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } }; 326var invokeArgs = new JsonObject { ["cancellationToken"] = tokenResult }; 379var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } }; 398var nestedArgs = new JsonObject { ["context"] = new JsonObject { ["$handle"] = nestedHandleId } }; 456var args = new JsonObject 458["context"] = new JsonObject { ["$handle"] = handleId }, 477var args = new JsonObject 479["context"] = new JsonObject { ["$handle"] = handleId }, 496var args = new JsonObject 498["context"] = new JsonObject { ["$handle"] = handleId }, 515var args = new JsonObject 517["context"] = new JsonObject { ["$handle"] = handleId } 548var args = new JsonObject 550["context"] = new JsonObject { ["$handle"] = handleId } 566var args = new JsonObject 568["context"] = new JsonObject { ["$handle"] = handleId }, 587var args = new JsonObject 589["context"] = new JsonObject { ["$handle"] = handleId }, 607var args = new JsonObject 609["context"] = new JsonObject { ["$handle"] = handleId }, 623var args = new JsonObject { ["value"] = "value-task" }; 664var args = new JsonObject 687var args = new JsonObject 708var args = new JsonObject 731var args = new JsonObject 830new JsonObject { ["callback"] = "background-callback" }); 854new JsonObject { ["callback"] = "background-callback" }); 873var args = new JsonObject 901var args = new JsonObject { ["value"] = "test" }; 912var args = new JsonObject { ["value"] = "hello" }; 924var args = new JsonObject { ["value"] = "test" }; 938var args = new JsonObject 953var args = new JsonObject { ["count"] = 3 }; 970var args = new JsonObject 986var args = new JsonObject { ["value"] = "hello" }; 998var args = new JsonObject { ["value"] = 42 }; 1010var args = new JsonObject 1012["value"] = new JsonObject 1028var args = new JsonObject { ["value"] = nameof(TestDispatchEnum.ValueB) }; 1040var args = new JsonObject { ["value"] = "/usr/local/lib/redis/modules/redisearch.so" }; 1052var args = new JsonObject 1054["value"] = new JsonObject 1078var args = new JsonObject 1080["value"] = new JsonObject { ["$handle"] = handleId } 1093var args = new JsonObject 1111var args = new JsonObject 1113["value"] = new JsonObject 1156var args = new JsonObject 1158["list"] = new JsonObject { ["$handle"] = listHandle }, 1178var args = new JsonObject 1180["list"] = new JsonObject { ["$handle"] = listHandle }, 1202var removeArgs = new JsonObject 1204["list"] = new JsonObject { ["$handle"] = listHandle }, 1213var lengthArgs = new JsonObject 1215["list"] = new JsonObject { ["$handle"] = listHandle } 1234var args = new JsonObject 1236["list"] = new JsonObject { ["$handle"] = listHandle } 1257var clearArgs = new JsonObject 1259["list"] = new JsonObject { ["$handle"] = listHandle } 1264var lengthArgs = new JsonObject 1266["list"] = new JsonObject { ["$handle"] = listHandle } 1302var args = new JsonObject 1304["dict"] = new JsonObject { ["$handle"] = dictHandle }, 1324var args = new JsonObject 1326["dict"] = new JsonObject { ["$handle"] = dictHandle }, 1346var args = new JsonObject 1348["dict"] = new JsonObject { ["$handle"] = dictHandle }, 1370var removeArgs = new JsonObject 1372["dict"] = new JsonObject { ["$handle"] = dictHandle }, 1381var countArgs = new JsonObject 1383["dict"] = new JsonObject { ["$handle"] = dictHandle } 1403var hasArgs = new JsonObject 1405["dict"] = new JsonObject { ["$handle"] = dictHandle }, 1414var hasArgs2 = new JsonObject 1416["dict"] = new JsonObject { ["$handle"] = dictHandle }, 1436var args = new JsonObject 1438["dict"] = new JsonObject { ["$handle"] = dictHandle } 1461var args = new JsonObject 1463["dict"] = new JsonObject { ["$handle"] = dictHandle } 1485var args = new JsonObject 1487["dict"] = new JsonObject { ["$handle"] = dictHandle } 1505var args = new JsonObject 1507["dict"] = new JsonObject { ["$handle"] = dictHandle } 1522var args = new JsonObject 1539var args = new JsonObject 1556var args = new JsonObject 1573var args = new JsonObject 1590var result = dispatcher.Invoke("Aspire.Hosting.RemoteHost.Tests/acceptOptionalEnum", new JsonObject()); 1599var args = new JsonObject 1601["dto"] = new JsonObject 1618var args = new JsonObject 1620["dto"] = new JsonObject 1636var args = new JsonObject 1638["dto"] = new JsonObject 1654var args = new JsonObject(); 1676var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } }; 1694var args = new JsonObject 1696["context"] = new JsonObject { ["$handle"] = handleId }, 1714var args = new JsonObject 1716["context"] = new JsonObject { ["$handle"] = handleId }, 1735var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } }; 1752var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } }; 1767var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } }; 1787var args = new JsonObject 1789["builder"] = new JsonObject { ["$handle"] = targetHandleId }, 1790["source"] = new JsonObject { ["$handle"] = sourceHandleId } 1811var args = new JsonObject 1813["builder"] = new JsonObject { ["$handle"] = builderHandleId } 1833var args = new JsonObject 1835["builder"] = new JsonObject { ["$handle"] = builderHandleId } 1855var args = new JsonObject 1857["builder"] = new JsonObject { ["$handle"] = resourceHandleId } 1876var args = new JsonObject 1878["builder"] = new JsonObject { ["$handle"] = builderHandleId } 1902var args = new JsonObject 1904["context"] = new JsonObject { ["$handle"] = targetHandleId }, 1905["value"] = new JsonObject { ["$handle"] = valueHandleId } 1930var args = new JsonObject 1932["builder"] = new JsonObject { ["$handle"] = targetHandleId }, 1933["source"] = new JsonObject { ["$handle"] = sourceHandleId } 1950var args = new JsonObject 1952["builder"] = new JsonObject { ["$handle"] = builderHandleId } 1977var args = new JsonObject 1979["builder"] = new JsonObject { ["$handle"] = builderHandleId } 2005var args = new JsonObject 2007["builder"] = new JsonObject { ["$handle"] = handles.Register(new TestResourceBuilder<TestResourceWithProperties>(target), "target-type") } 2091var args = new JsonObject 2093["resource"] = new JsonObject { ["$handle"] = handleId },
HandleRegistryTests.cs (7)
248var json = new JsonObject { ["$handle"] = "42" }; 277var json = new JsonObject { ["name"] = "test", ["value"] = 42 }; 287var json = new JsonObject { ["$handle"] = 42 }; 296var json = new JsonObject 312var json = new JsonObject { ["$handle"] = "1" }; 334var json = new JsonObject { ["name"] = "test" }; 343var json = new JsonObject { ["$handle"] = 42 };
ReferenceExpressionRefTests.cs (17)
17var json = new JsonObject 19["$expr"] = new JsonObject 38var json = new JsonObject 40["$expr"] = new JsonObject 45new JsonObject { ["$handle"] = "aspire/EndpointReference:1" }, 46new JsonObject { ["$handle"] = "aspire/EndpointReference:2" } 65var json = new JsonObject 91var json = new JsonObject 93["$expr"] = new JsonObject { ["format"] = "test" } 104var json = new JsonObject { ["format"] = "test" }; 137new JsonObject { ["$handle"] = handle1 }, 138new JsonObject { ["$handle"] = handle2 } 158new JsonObject { ["$handle"] = "aspire/NonExistent:999" } 197new JsonObject { ["$handle"] = handle }, 218new JsonObject { ["invalid"] = "not-a-handle" } // Invalid format (not a handle or string) 236var json = new JsonObject 238["$expr"] = new JsonObject
RemoteHostProfilingTelemetryTests.cs (1)
127new JsonObject
Aspire.Hosting.Tests (32)
JsonFlattenerTests.cs (20)
16var userSecrets = new JsonObject 19["Azure"] = new JsonObject 22["Deployments"] = new JsonObject 24["MyStorage"] = new JsonObject 50var userSecrets = new JsonObject 71var userSecrets = new JsonObject(); 84var userSecrets = new JsonObject 86["Level1"] = new JsonObject 88["Level2"] = new JsonObject 90["Level3"] = new JsonObject 110var userSecrets = new JsonObject 116["Nested"] = new JsonObject 139var userSecrets = new JsonObject 168var userSecrets = new JsonObject 171new JsonObject { ["Name"] = "Item1", ["Value"] = "Value1" }, 172new JsonObject { ["Name"] = "Item2", ["Value"] = "Value2" } 174["NestedConfig"] = new JsonObject 177new JsonObject 180["Settings"] = new JsonObject { ["Enabled"] = true } 203var userSecrets = new JsonObject
Publishing\DeploymentStateManagerTests.cs (12)
227var state = new JsonObject 520await migratingStateManager.SaveStateAsync(new JsonObject 522["Replacement"] = new JsonObject 713firstSection.Data["Features"] = new JsonObject { ["A"] = true }; 714secondSection.Data["Features"] = new JsonObject { ["B"] = true }; 798legacyAzureSection.Data["Sandboxes"] = new JsonObject 800["first"] = new JsonObject { ["SandboxId"] = "first-sandbox" }, 801["second"] = new JsonObject { ["SandboxId"] = "second-sandbox" } 834legacyAzureSection.Data["Sandboxes"] = new JsonObject 836["legacy"] = new JsonObject { ["SandboxId"] = "legacy-sandbox" } 874legacySandboxesSection.Data["first"] = new JsonObject 879legacySandboxesSection.Data["second"] = new JsonObject
Aspire.Hosting.Yarp (4)
YarpJsonConfigGeneratorBuilder.cs (4)
83var jsonObject = new JsonObject(); 84var jsonProxyConfig = jsonObject["ReverseProxy"] = new JsonObject(); 96var routesNode = new JsonObject(); 110var routesNode = new JsonObject();
ConfigurationSchemaGenerator (13)
ConfigSchemaEmitter.cs (13)
44var root = new JsonObject(); 59var propertiesNode = new JsonObject(s_ignoreCaseNodeOptions); 62var categoryNode = new JsonObject(); 67parent["definitions"] = new JsonObject 69["logLevel"] = new JsonObject 125propertiesNode = new JsonObject(s_ignoreCaseNodeOptions); 140pathSegmentNode = new JsonObject(); 246propertiesNode = new JsonObject(); 286var propertyNode = new JsonObject(); 319var containerNode = new JsonObject(); 632new JsonObject 637new JsonObject 640["items"] = new JsonObject
dotnet-user-jwts (7)
Helpers\JwtAuthenticationSchemeSettings.cs (6)
20: new JsonObject(); 22var settingsObject = new JsonObject 38authentication.Add(SchemesKey, new JsonObject 46config[AuthenticationKey] = new JsonObject 48[SchemesKey] = new JsonObject 66return JsonSerializer.Deserialize(reader, JwtSerializerContext.Default.JsonObject) ?? new JsonObject();
Helpers\SigningKeysHandler.cs (1)
75secrets ??= new JsonObject();
Infrastructure.Tests (1)
Pipelines\NpmCliPackageTests.cs (1)
595var packageMap = new JsonObject();
Microsoft.AspNetCore.OpenApi (23)
Extensions\JsonNodeSchemaExtensions.cs (1)
444var mappings = new JsonObject();
Schemas\OpenApiJsonSchema.Helpers.cs (1)
157var obj = new JsonObject();
Services\Schemas\OpenApiSchemaService.cs (21)
70schema = new JsonObject 79schema = new JsonObject 82[OpenApiSchemaKeywords.ItemsKeyword] = new JsonObject 99schema = new JsonObject(); 161var addReplaceTest = new JsonObject() 166[OpenApiSchemaKeywords.PropertiesKeyword] = new JsonObject 168["op"] = new JsonObject() 173["path"] = new JsonObject() 177["value"] = new JsonObject() 181var moveCopy = new JsonObject() 186[OpenApiSchemaKeywords.PropertiesKeyword] = new JsonObject 188["op"] = new JsonObject() 193["path"] = new JsonObject() 197["from"] = new JsonObject() 204var remove = new JsonObject() 209[OpenApiSchemaKeywords.PropertiesKeyword] = new JsonObject 211["op"] = new JsonObject() 216["path"] = new JsonObject() 223return new JsonObject 227[OpenApiSchemaKeywords.ItemsKeyword] = new JsonObject 617var newObject = new JsonObject();
Microsoft.Extensions.AI (4)
ChatCompletion\ChatClientStructuredOutputExtensions.cs (2)
162schema = JsonSerializer.SerializeToElement(new JsonObject 166{ "properties", new JsonObject { { "data", JsonElementToJsonNode(schema) } } },
Realtime\LoggingRealtimeClientSession.cs (2)
189var obj = new JsonObject 212var obj = new JsonObject
Microsoft.Extensions.AI.Abstractions (9)
Utilities\AIJsonUtilities.Schema.Create.cs (7)
90JsonObject parameterSchemas = new(); 149JsonNode schema = new JsonObject(); 261return schemaObj ?? new JsonObject(); 266return new JsonObject { [TypePropertyName] = null }; 313objSchema.Add(ItemsPropertyName, new JsonObject()); 414schema = obj = new() { [NotPropertyName] = true }; 651(JsonObject)(obj[NotPropertyName] = new JsonObject());
Utilities\AIJsonUtilities.Schema.Transform.cs (2)
50schema = new JsonObject { [NotPropertyName] = (JsonNode)true }; 58schema = new JsonObject();
Microsoft.Extensions.AI.Abstractions.Tests (2)
test\Shared\JsonSchemaExporter\TestTypes.cs (1)
105yield return new TestData<JsonObject>(new() { ["x"] = 42 }, """{"type":["object","null"]}""");
Utilities\AIJsonUtilitiesTests.cs (1)
273? new JsonObject
Microsoft.Extensions.AI.Evaluation.Quality (1)
AIToolExtensions.cs (1)
25new JsonObject
Microsoft.Extensions.AI.Evaluation.Safety (13)
ContentSafetyServicePayloadUtilities.cs (13)
149new JsonObject 200var item = new JsonObject(); 231new JsonObject 282yield return new JsonObject 297yield return new JsonObject 306yield return new JsonObject 322yield return new JsonObject 330yield return new JsonObject 334new JsonObject 342yield return new JsonObject 346new JsonObject 357new JsonObject 362new JsonObject
Microsoft.NET.Build.Containers (9)
ImageConfig.cs (7)
90var newConfig = new JsonObject(); 151var configContainer = new JsonObject() 156["rootfs"] = new JsonObject() 173var history = new JsonObject(); 304JsonObject container = new(); 307container.Add($"{port.Number}/{port.Type}", new JsonObject()); 325JsonObject container = new();
LocalDaemons\ContainerArchive.cs (1)
166new JsonObject
LocalDaemons\DockerCli.cs (1)
391JsonNode manifestNode = new JsonArray(new JsonObject
Microsoft.NET.Build.Tasks (4)
GenerateRuntimeConfigurationFiles.cs (4)
325configProperties = new JsonObject(); 416JsonObject json = new() 438JsonObject json = new(); 505JsonObject json = new();
Microsoft.NETCore.Platforms (1)
UpdateRuntimeIdentifierGraph.cs (1)
42runtimes.Add(rid.ItemSpec, new JsonObject { ["#import"] = new JsonArray([.. importedRids]) });
Microsoft.TemplateEngine.Cli (3)
Alias\AliasRegistry.cs (2)
149JsonObject root = new(); 150JsonObject commandAliases = new();
PostActionProcessors\AddJsonPropertyPostActionProcessor.cs (1)
231node[property] = childNode = new JsonObject();
Microsoft.TemplateEngine.Orchestrator.RunnableProjects (1)
OperationConfig\BalancedNestingConfig.cs (1)
34JsonObject config = new JsonObject
MSBuild (8)
JsonOutputFormatter.cs (7)
20private readonly JsonNode _topLevelNode = new JsonObject(); 36JsonNode propertiesNode = new JsonObject(); 54JsonNode itemsNode = new JsonObject(); 60JsonObject jsonItem = new(); 90JsonObject targetResultsNode = new(); 94JsonObject targetResults = new(); 99JsonObject jsonItem = new();
XMake.cs (1)
4735var jsonNode = new JsonObject();
NuGet.Protocol (10)
Plugins\Logging\AssemblyLogMessage.cs (1)
41var message = new JsonObject
Plugins\Logging\CommunicationLogMessage.cs (1)
27var message = new JsonObject
Plugins\Logging\EnvironmentVariablesLogMessage.cs (1)
34var message = new JsonObject();
Plugins\Logging\MachineLogMessage.cs (1)
21var message = new JsonObject
Plugins\Logging\PluginInstanceLogMessage.cs (1)
30var message = new JsonObject
Plugins\Logging\PluginLogMessage.cs (1)
31var outerMessage = new JsonObject
Plugins\Logging\ProcessLogMessage.cs (1)
30var message = new JsonObject
Plugins\Logging\StopwatchLogMessage.cs (1)
21var message = new JsonObject
Plugins\Logging\TaskLogMessage.cs (1)
30var message = new JsonObject
Plugins\Logging\ThreadPoolLogMessage.cs (1)
26var message = new JsonObject
SelectTests (5)
Program.cs (5)
586var selection = new JsonObject(); 624var root = new JsonObject 630["inputs"] = new JsonObject 691causeArray.Add(new JsonObject 701array.Add(new JsonObject
ServiceBus.AppHost (1)
AppHost.cs (1)
38document["UserConfig"]!["Logging"] = new JsonObject { ["Type"] = "Console" };
Shared.Tests (1)
JsonSchemaExporter\TestTypes.cs (1)
105yield return new TestData<JsonObject>(new() { ["x"] = 42 }, """{"type":["object","null"]}""");
Stress.ApiService (1)
Program.cs (1)
354var jsonWithUrl = new JsonObject
System.Text.Json (10)
System\Text\Json\Nodes\JsonObject.cs (4)
64JsonValueKind.Object => new JsonObject(element, options), 90? new JsonObject(jsonElement.Value.Clone(), Options) 91: new JsonObject(Options); 94var jObject = new JsonObject(Options)
System\Text\Json\Schema\JsonSchema.cs (2)
149var objSchema = new JsonObject(); 183var properties = new JsonObject();
System\Text\Json\Serialization\Converters\Node\JsonNodeConverter.cs (1)
89node = new JsonObject(element, options);
System\Text\Json\Serialization\Converters\Node\JsonObjectConverter.cs (3)
15jsonTypeInfo.CreateObjectForExtensionDataProperty = () => new JsonObject(options.GetNodeOptions()); 79return new JsonObject(jElement, options); 86JsonObject jObject = new JsonObject(options);
TestProject.AppHost (3)
TestProgram.cs (3)
174var root = new JsonObject(); 177var projectJson = new JsonObject(); 191var endpointJsonObject = new JsonObject
1716 references to JsonObject
aspire (204)
Agents\ClaudeCode\ClaudeCodeAgentEnvironmentScanner.cs (5)
165var config = JsonNode.Parse(content)?.AsObject(); 172if (config.TryGetPropertyValue("mcpServers", out var serversNode) && serversNode is JsonObject servers) 204var config = await McpConfigFileHelper.ReadConfigAsync(configFilePath, null, cancellationToken); 207if (!config.ContainsKey("mcpServers") || config["mcpServers"] is not JsonObject) 212var servers = config["mcpServers"]!.AsObject();
Agents\Copilot\CopilotAgentEnvironmentScanner.cs (3)
174var config = await McpConfigFileHelper.ReadConfigAsync(configFilePath, null, cancellationToken); 177if (!config.ContainsKey("mcpServers") || config["mcpServers"] is not JsonObject) 182var servers = config["mcpServers"]!.AsObject();
Agents\DeprecatedMcpCommandScanner.cs (16)
65var config = JsonNode.Parse(content)?.AsObject(); 104private static bool HasDeprecatedMcpCommand(JsonObject config, AgentConfigLocation location) 118private static bool HasDeprecatedMcpServersArgs(JsonObject config, string serversKey) 120if (!config.TryGetPropertyValue(serversKey, out var serversNode) || serversNode is not JsonObject servers) 125if (!servers.TryGetPropertyValue("aspire", out var aspireNode) || aspireNode is not JsonObject aspire) 150private static bool HasDeprecatedMcpCommandArray(JsonObject config, string serversKey) 152if (!config.TryGetPropertyValue(serversKey, out var mcpNode) || mcpNode is not JsonObject mcp) 157if (!mcp.TryGetPropertyValue("aspire", out var aspireNode) || aspireNode is not JsonObject aspire) 182private AgentEnvironmentApplicator CreateUpdateApplicator(AgentConfigLocation location, string configPath, JsonObject config) 198private async Task UpdateConfigAsync(AgentConfigLocation location, string configPath, JsonObject config, CancellationToken cancellationToken) 220private static void UpdateMcpServersArgs(JsonObject config, string serversKey) 223serversNode is JsonObject servers && 225aspireNode is JsonObject aspire) 234private static void UpdateMcpCommandArray(JsonObject config, string serversKey) 237mcpNode is JsonObject mcp && 239aspireNode is JsonObject aspire)
Agents\Hooks\TelemetryHookConfigurator.cs (8)
138var config = new JsonObject 169JsonObject settings; 201case JsonObject existing: 218JsonObject hooks; 221if (hooksNode is not JsonObject hooksObject) 322if (postToolUse[groupIndex] is not JsonObject group 351if (node is not JsonObject hook) 385private static async Task WriteJsonAtomicAsync(string path, JsonObject config, CancellationToken cancellationToken)
Agents\McpConfigFileHelper.cs (7)
40if (JsonNode.Parse(content) is not JsonObject config) 45if (config.TryGetPropertyValue(serverContainerKey, out var serversNode) && serversNode is JsonObject servers) 59/// Reads an existing MCP config file and parses it into a <see cref="JsonObject"/>, or creates a new one if the file doesn't exist. 64/// <returns>The parsed <see cref="JsonObject"/> from the file, or a new empty <see cref="JsonObject"/> if the file doesn't exist.</returns> 69public static async Task<JsonObject> ReadConfigAsync(string configFilePath, Func<string, string>? preprocessContent, CancellationToken cancellationToken) 94return root as JsonObject
Agents\OpenCode\OpenCodeAgentEnvironmentScanner.cs (5)
114var config = JsonNode.Parse(content)?.AsObject(); 121if (config.TryGetPropertyValue("mcp", out var mcpNode) && mcpNode is JsonObject mcp) 189var config = await McpConfigFileHelper.ReadConfigAsync(configFilePath, RemoveJsonComments, cancellationToken); 198if (!config.ContainsKey("mcp") || config["mcp"] is not JsonObject) 203var mcp = config["mcp"]!.AsObject();
Agents\VsCode\VsCodeAgentEnvironmentScanner.cs (5)
204var config = JsonNode.Parse(content)?.AsObject(); 211if (config.TryGetPropertyValue("servers", out var serversNode) && serversNode is JsonObject servers) 249var config = await McpConfigFileHelper.ReadConfigAsync(mcpConfigPath, null, cancellationToken); 252if (!config.ContainsKey("servers") || config["servers"] is not JsonObject) 257var servers = config["servers"]!.AsObject();
Commands\InitCommand.cs (12)
543JsonObject settings; 573if (settings["appHost"] is not JsonObject appHost) 608var existingProfilesObject = settings["profiles"] as JsonObject; 729private static bool TryReadAppHostProfilePorts(JsonObject profiles, out AppHostProfilePorts ports) 733if (profiles["https"] is not JsonObject https || profiles["http"] is not JsonObject http) 738var httpsEnv = https["environmentVariables"] as JsonObject; 739var httpEnv = http["environmentVariables"] as JsonObject; 811var settings = new JsonObject
Commands\ResourceCommand.cs (4)
279private static (JsonObject Arguments, string? ErrorMessage) CreateCommandArguments(ResourceSnapshotCommandArgument[] argumentInputs, string[] capturedArguments, CommandArgumentParseMode parseMode) 281var arguments = new JsonObject(); 371private static JsonObject CreateUnknownArguments(string[] capturedArguments) 373var arguments = new JsonObject();
Commands\SecretListCommand.cs (1)
55var obj = new JsonObject();
Configuration\ConfigurationService.cs (15)
30JsonObject settings; 71var settings = JsonNode.Parse(existingContent, nodeOptions: null, ConfigurationHelper.ParseOptions)?.AsObject(); 197var settings = JsonNode.Parse(content, nodeOptions: null, ConfigurationHelper.ParseOptions)?.AsObject(); 215private static void SetNestedValue(JsonObject settings, string key, string value) 228var currentObject = settings; 236if (!currentObject.ContainsKey(part) || currentObject[part] is not JsonObject) 253private static void RemoveConflictingFlattenedKeys(JsonObject settings, string[] keyParts) 266if (settings.ContainsKey(partialKey) && settings[partialKey] is not JsonObject) 278private static bool DeleteNestedValue(JsonObject settings, string key) 289var currentObject = settings; 290var objectPath = new List<(JsonObject obj, string key)>(); 298if (!currentObject.ContainsKey(part) || currentObject[part] is not JsonObject) 340private static void FlattenJsonObject(JsonObject obj, Dictionary<string, string> result, string prefix) 348if (kvp.Value is JsonObject nestedObj) 483if (node is not JsonObject)
JsonSourceGenerationContext.cs (1)
32[JsonSerializable(typeof(JsonObject))]
Mcp\Tools\ExecuteResourceCommandTool.cs (2)
173private static JsonObject CreateCommandArguments(JsonElement commandArgumentsElement) 175var arguments = new JsonObject();
Migrations\MigrationDescriptor.cs (1)
32public JsonObject? Metadata { get; init; }
Migrations\TypeScriptAppHostMigration.cs (5)
200if (JsonNode.Parse(File.ReadAllText(configPath)) is not JsonObject root || 201root["appHost"] is not JsonObject appHost || 247}) is not JsonObject root || 287if (JsonNode.Parse(File.ReadAllText(packageJsonPath)) is not JsonObject root || 288root["scripts"] is not JsonObject scripts)
Npm\SigstoreNpmProvenanceChecker.cs (1)
205if (attestation is not JsonObject attestationObj)
Projects\FallbackProjectParser.cs (5)
121var rootObject = new JsonObject(); 124var itemsObject = new JsonObject(); 130var packageObj = new JsonObject(); 141var projectObj = new JsonObject(); 151var propertiesObject = new JsonObject();
Projects\TypeScriptAppHostToolchainResolver.cs (2)
363var packageJson = JsonNode.Parse(File.ReadAllText(packageJsonPath), documentOptions: ConfigurationHelper.ParseOptions) as JsonObject;
Scaffolding\PackageJsonMerger.cs (30)
58JsonObject? existingJson; 59JsonObject? scaffoldJson; 62existingJson = JsonNode.Parse(existingContent, documentOptions: s_jsonDocumentOptions) as JsonObject; 63scaffoldJson = JsonNode.Parse(scaffoldContent, documentOptions: s_jsonDocumentOptions) as JsonObject; 94private static void MergeObjects(JsonObject existing, JsonObject scaffold, ILogger logger, string toolchainCommand) 97var scaffoldScripts = scaffold[ScriptsKey]?.AsObject(); 100var existingScripts = EnsureObject(existing, ScriptsKey, logger); 130else if (targetValue is JsonObject targetObj && sourceValue is JsonObject sourceObj) 151internal static void MergeScripts(JsonObject existingScripts, JsonObject scaffoldScripts, string toolchainCommand = "npm") 184private static void AddConvenienceAliases(JsonObject scripts, string toolchainCommand) 220private static void MergeDependencySection(JsonObject existing, JsonObject scaffold, string sectionName, ILogger logger) 222var scaffoldDeps = scaffold[sectionName]?.AsObject(); 228var existingDeps = EnsureObject(existing, sectionName, logger); 262private static bool TryMergeExistingDependency(JsonObject existing, string sectionName, string packageName, string desiredVersion) 264if (existing[sectionName] is not JsonObject existingDeps) 291private static void MergeEngines(JsonObject existing, JsonObject scaffold, ILogger logger) 293var scaffoldEngines = scaffold[EnginesKey]?.AsObject(); 299var existingEngines = EnsureObject(existing, EnginesKey, logger); 325internal static void DeepMerge(JsonObject target, JsonObject source) 340else if (targetValue is JsonObject targetObj && sourceValue is JsonObject sourceObj) 348private static JsonObject EnsureObject(JsonObject parent, string propertyName, ILogger logger) 350if (parent[propertyName] is JsonObject obj)
Scaffolding\ScaffoldingService.cs (12)
297JsonObject packageJson; 300packageJson = JsonNode.Parse(existingContent, documentOptions: s_scaffoldJsonDocumentOptions) as JsonObject 310var scripts = EnsureJsonObject(packageJson, "scripts"); 325internal static IReadOnlyList<string> AddRootTypeScriptAppHostDelegateScripts(JsonObject scripts, TypeScriptAppHostToolchain toolchain, string relativeAppHostDirectory) 336internal static IReadOnlyList<string> AddRootTypeScriptAppHostDelegateScripts(JsonObject scripts, DirectoryInfo appHostDirectory, string relativeAppHostDirectory, IEnvironment environment, ILogger? logger) 342internal static string SerializePackageJson(JsonObject packageJson, string existingContent) 372private static JsonObject EnsureJsonObject(JsonObject parent, string propertyName) 374if (parent[propertyName] is JsonObject obj) 399private static void AddRootTypeScriptAppHostDelegateScript(JsonObject scripts, TypeScriptAppHostToolchain toolchain, string relativeAppHostDirectory, string scriptName, ref List<string>? preservedScriptNames) 692private static JsonObject? ParseJsonC(string content) 696return JsonNode.Parse(content, documentOptions: s_scaffoldJsonDocumentOptions) as JsonObject;
src\Shared\ConsoleLogs\SharedAIHelpers.cs (13)
95var dto = GetLogEntryDto(logEntry, promptContext, getResourceName, dashboardBaseUrl); 144var dto = GetTraceDto(trace, promptContext, getResourceName, dashboardBaseUrl); 208public static JsonObject GetSpanDto( 220var attributesObj = new JsonObject(); 255var spanObj = new JsonObject 377public static JsonObject GetTraceDto( 388var spanObj = GetSpanDto(s, context, getResourceName, dashboardBaseUrl: null); 400var traceData = new JsonObject 512private static JsonObject StripNullProperties(JsonObject obj) 709public static JsonObject GetLogEntryDto( 722var attributesObject = new JsonObject(); 730var log = new JsonObject
src\Shared\Json\JsonFlattener.cs (13)
16public static JsonObject FlattenJsonObject(JsonObject source) 18var result = new JsonObject(); 26public static JsonObject UnflattenJsonObject(JsonObject source) 28var result = new JsonObject(); 33var current = result; 38if (!current.TryGetPropertyValue(key, out var existing) || existing is not JsonObject) 40var newObject = new JsonObject(); 56private static void FlattenJsonObjectRecursive(JsonObject source, string prefix, JsonObject result) 66if (kvp.Value is JsonObject nestedObject) 75if (array[i] is JsonObject arrayObject)
src\Shared\UserSecrets\SecretsStore.cs (3)
79var obj = new JsonObject(); 127var parsed = JsonNode.Parse(json)?.AsObject(); 134var flat = JsonFlattener.FlattenJsonObject(parsed);
Telemetry\InternalMicrosoftDetector.cs (9)
698var deviceConfiguration = TryParseMacPlatformSsoSection(output, "Device Configuration"); 699var loginConfiguration = TryParseMacPlatformSsoSection(output, "Login Configuration"); 700var userConfiguration = TryParseMacPlatformSsoSection(output, "User Configuration"); 767if (kerberosStatusNodeEntry is not JsonObject kerberosStatus) 1643private static JsonObject? TryParseMacPlatformSsoSection(string output, string sectionName) 1691documentOptions: new JsonDocumentOptions { AllowTrailingCommas = true }) as JsonObject; 1857private static bool TryGetBoolean(JsonObject json, string propertyName, out bool value) 1865private static Uri? TryGetAbsoluteUri(JsonObject json, string propertyName) 1884private static string? TryGetString(JsonObject json, string propertyName)
Utils\ConfigurationHelper.cs (6)
191if (node is not JsonObject) 225internal static async Task WriteSettingsFileAsync(string filePath, JsonObject settings, CancellationToken cancellationToken = default) 236internal static void WriteSettingsFile(string filePath, JsonObject settings) 299var settings = JsonNode.Parse(content, documentOptions: ParseOptions)?.AsObject(); 331var currentObject = settings; 343else if (currentObject[part] is JsonObject)
Utils\EnvironmentChecker\AspireVersionCheck.cs (4)
423private static JsonObject BuildCliVersionMetadata(string? currentVersion, string? latestVersion, string? updateCommand, string? updateCheckError, string? identityChannel, string? latestVersionChannel) 425var metadata = new JsonObject(); 460private static JsonObject BuildAppHostVersionMetadata(string relativePath, string? version, string? pinnedChannel) 462var metadata = new JsonObject
Utils\EnvironmentChecker\DeprecatedAgentConfigCheck.cs (8)
56var config = JsonNode.Parse(content)?.AsObject(); 91private static bool HasDeprecatedMcpCommand(JsonObject config, AgentConfigLocation location) 105private static bool HasDeprecatedMcpServersArgs(JsonObject config, string serversKey) 107if (!config.TryGetPropertyValue(serversKey, out var serversNode) || serversNode is not JsonObject servers) 112if (!servers.TryGetPropertyValue("aspire", out var aspireNode) || aspireNode is not JsonObject aspire) 137private static bool HasDeprecatedMcpCommandArray(JsonObject config, string serversKey) 139if (!config.TryGetPropertyValue(serversKey, out var mcpNode) || mcpNode is not JsonObject mcp) 144if (!mcp.TryGetPropertyValue("aspire", out var aspireNode) || aspireNode is not JsonObject aspire)
Utils\EnvironmentChecker\DevCertsCheck.cs (3)
97var metadata = BuildCertificateMetadata(certInfos); 525private static JsonObject BuildCertificateMetadata(IReadOnlyList<DevCertInfo> certInfos) 530var certNode = new JsonObject
Utils\EnvironmentChecker\EnvironmentCheckResult.cs (1)
108public JsonObject? Metadata { get; init; }
Utils\EnvironmentChecker\OperatingSystemCheck.cs (2)
142private static JsonObject BuildMetadata(OperatingSystemDetails details) 144var metadata = new JsonObject
Utils\EnvironmentChecker\VsCodeExtensionCheck.cs (2)
68var metadata = BuildMetadata(detection); 220private static JsonObject BuildMetadata(VsCodeExtensionDetection detection)
Aspire.Cli.EndToEnd.Tests (29)
Helpers\CliE2ETestHelpers.cs (1)
1114var config = File.Exists(configPath)
Helpers\TypeScriptAppHostToolchainTestHelpers.cs (1)
37var packageJson = JsonNode.Parse(File.ReadAllText(packageJsonPath))?.AsObject()
ProjectReferenceTests.cs (3)
116var config = JsonNode.Parse(configJson)?.AsObject() 118var packages = config["packages"] as JsonObject ?? new JsonObject();
SelfUpdateChannelPersistenceTests.cs (3)
47var createdConfig = ReadConfig(configPath); 102var updatedConfig = ReadConfig(configPath); 106private static JsonObject ReadConfig(string path)
SingleFileAppHostInitDotnetRunTests.cs (3)
83var runJson = JsonNode.Parse(File.ReadAllText(appHostRunJson))?.AsObject(); 85var httpsProfile = runJson["profiles"]?["https"]?.AsObject(); 89var httpsEnv = httpsProfile["environmentVariables"]?.AsObject();
TypeScriptEmptyAppHostTemplateTests.cs (1)
178var config = JsonNode.Parse(File.ReadAllText(configPath))?.AsObject()
TypeScriptLegacyAppHostTests.cs (2)
136var configJson = JsonNode.Parse(File.ReadAllText(configPath))!.AsObject(); 137var appHost = configJson["appHost"]!.AsObject();
TypeScriptMigrateAppHostTests.cs (3)
123var configJson = JsonNode.Parse(File.ReadAllText(configPath))!.AsObject(); 124var appHost = configJson["appHost"]!.AsObject(); 215var tsconfig = JsonNode.Parse(File.ReadAllText(Path.Combine(projectRoot, "tsconfig.apphost.json")))!.AsObject();
TypeScriptPolyglotTests.cs (12)
353var config = JsonNode.Parse(File.ReadAllText(configPath))!.AsObject(); 448var packageJson = JsonNode.Parse(File.ReadAllText(Path.Combine(projectRoot, "package.json")))!.AsObject(); 449var scripts = packageJson["scripts"]!.AsObject(); 490var rootDependencies = packageJson["dependencies"]?.AsObject(); 491var rootDevDependencies = packageJson["devDependencies"]?.AsObject(); 504var appHostPackageJson = JsonNode.Parse(File.ReadAllText(Path.Combine(appHostDirectory, "package.json")))!.AsObject(); 505var appHostScripts = appHostPackageJson["scripts"]!.AsObject(); 506var appHostDependencies = appHostPackageJson["dependencies"]!.AsObject(); 507var appHostDevDependencies = appHostPackageJson["devDependencies"]!.AsObject(); 520var config = JsonNode.Parse(File.ReadAllText(configPath))!.AsObject(); 521var appHost = config["appHost"]!.AsObject(); 525var packages = packagesNode!.AsObject();
Aspire.Cli.Tests (204)
Agents\CopilotAgentEnvironmentScannerTests.cs (8)
63var config = JsonNode.Parse(content)?.AsObject(); 67var servers = config["mcpServers"]?.AsObject(); 71var aspireServer = servers["aspire"]?.AsObject(); 83var env = aspireServer["env"]?.AsObject(); 121var existingConfig = new JsonObject 143var config = JsonNode.Parse(content)?.AsObject(); 146var servers = config["mcpServers"]?.AsObject(); 161var existingConfig = new JsonObject
Agents\TelemetryHookConfiguratorTests.cs (13)
30var root = JsonNode.Parse(await File.ReadAllTextAsync(hookFile).DefaultTimeout())!.AsObject(); 33var entry = root["hooks"]!["postToolUse"]!.AsArray()[0]!.AsObject(); 93var entry = FindAspireHook(postToolUse); 136var existing = new JsonObject 159var root = JsonNode.Parse(await File.ReadAllTextAsync(settingsPath).DefaultTimeout())!.AsObject(); 245var root = JsonNode.Parse(await File.ReadAllTextAsync(settingsPath))!.AsObject(); 253=> group is JsonObject obj 260=> hook is JsonObject ho 268=> group is JsonObject obj 270&& hooks.Any(h => h is JsonObject ho 274private static JsonObject FindAspireHook(JsonArray postToolUse) 278if (group is JsonObject obj && obj["hooks"] is JsonArray hooks) 282if (hook is JsonObject ho && HookReferencesTelemetryScript(ho))
Agents\VsCodeAgentEnvironmentScannerTests.cs (10)
147var config = JsonNode.Parse(content)?.AsObject(); 151var servers = config["servers"]?.AsObject(); 155var aspireServer = servers["aspire"]?.AsObject(); 177var existingConfig = new JsonObject 200var config = JsonNode.Parse(content)?.AsObject(); 203var servers = config["servers"]?.AsObject(); 218var existingConfig = new JsonObject 246var config = JsonNode.Parse(content)?.AsObject(); 247var aspireServer = config?["servers"]?["aspire"]?.AsObject(); 254var otherServer = config?["servers"]?["other-server"]?.AsObject();
Commands\ConfigCommandTests.cs (36)
126var settings = JsonNode.Parse(json)?.AsObject(); 151var settings = JsonNode.Parse(settingsJson)?.AsObject(); 154Assert.True(settings["docs"] is JsonObject); 155var docsObject = settings["docs"]!.AsObject(); 157Assert.True(docsObject["api"] is JsonObject); 186var settings = JsonNode.Parse(json)?.AsObject(); 188Assert.True(settings["foo"] is JsonObject); 189var fooObject = settings["foo"]!.AsObject(); 211var settings = JsonNode.Parse(json)?.AsObject(); 214Assert.True(settings["foo"] is JsonObject); 215var fooObject = settings["foo"]!.AsObject(); 216Assert.True(fooObject["bar"] is JsonObject); 217var barObject = fooObject["bar"]!.AsObject(); 243var settings = JsonNode.Parse(json)?.AsObject(); 246Assert.True(settings["foo"] is JsonObject); 247var fooObject = settings["foo"]!.AsObject(); 363var settings = JsonNode.Parse(json)?.AsObject(); 692var settings = JsonNode.Parse(json)?.AsObject(); 697Assert.True(settings["features"] is JsonObject); 698var featuresObject = settings["features"]!.AsObject(); 724var settings = JsonNode.Parse(json)?.AsObject(); 728Assert.True(settings["features"] is JsonObject); 729var featuresObject = settings["features"]!.AsObject(); 755var settings = JsonNode.Parse(json)?.AsObject(); 759Assert.True(settings["features"] is JsonObject); 760var featuresObject = settings["features"]!.AsObject(); 786var settings = JsonNode.Parse(json)?.AsObject(); 816var settings = JsonNode.Parse(json)?.AsObject(); 819Assert.True(settings["features"] is JsonObject); 820var featuresObject = settings["features"]!.AsObject(); 849var settings = JsonNode.Parse(json)?.AsObject(); 852var featuresObject = settings["features"]!.AsObject(); 875var settings = JsonNode.Parse(json)?.AsObject(); 878var appHost = settings["appHost"]?.AsObject(); 905var settings = JsonNode.Parse(json)?.AsObject(); 909var appHost = settings["appHost"]?.AsObject();
Commands\InitCommandTests.cs (30)
225var config = JsonNode.Parse(await File.ReadAllTextAsync(Path.Combine(workspace.WorkspaceRoot.FullName, AspireConfigFile.FileName)))!.AsObject(); 267var config = JsonNode.Parse(File.ReadAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json")))!.AsObject(); 268var appHost = config["appHost"]!.AsObject(); 295var runJson = JsonNode.Parse(File.ReadAllText(runJsonPath))!.AsObject(); 296var profiles = runJson["profiles"]!.AsObject(); 298var https = profiles["https"]!.AsObject(); 303var httpsEnv = https["environmentVariables"]!.AsObject(); 309var http = profiles["http"]!.AsObject(); 311var httpEnv = http["environmentVariables"]!.AsObject(); 319var aspireConfig = JsonNode.Parse(File.ReadAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json")))!.AsObject(); 320var aspireProfiles = aspireConfig["profiles"]!.AsObject(); 373var runJson = JsonNode.Parse(File.ReadAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "apphost.run.json")))!.AsObject(); 374var profiles = runJson["profiles"]!.AsObject(); 375var https = profiles["https"]!.AsObject(); 376var http = profiles["http"]!.AsObject(); 426var aspireConfig = JsonNode.Parse(File.ReadAllText(aspireConfigPath))!.AsObject(); 427var preservedProfiles = aspireConfig["profiles"]!.AsObject(); 429var preservedHttps = preservedProfiles["https"]!.AsObject(); 431var preservedEnv = preservedHttps["environmentVariables"]!.AsObject(); 565var config = JsonNode.Parse(File.ReadAllText(Path.Combine(workspace.WorkspaceRoot.FullName, "aspire.config.json")))!.AsObject(); 566var appHost = config["appHost"]!.AsObject(); 853var existingConfig = new JsonObject 869var merged = JsonNode.Parse(await File.ReadAllTextAsync(configPath))!.AsObject(); 1316var config = JsonNode.Parse(File.ReadAllText(configPath))!.AsObject(); 1338var existing = new JsonObject { ["channel"] = "pr-99999" }; 1355var config = JsonNode.Parse(await File.ReadAllTextAsync(configPath))!.AsObject(); 1387var config = JsonNode.Parse(File.ReadAllText(configPath))!.AsObject(); 1431var config = JsonNode.Parse(File.ReadAllText(configPath))!.AsObject(); 1546var existing = new JsonObject { ["channel"] = "pr-99999" }; 2373var config = new JsonObject
Commands\ResourceCommandHelperTests.cs (1)
127var arguments = new JsonObject
Commands\ResourceCommandTests.cs (2)
2281var actualObject = Assert.IsType<JsonObject>(actual);
Mcp\ListStructuredLogsToolTests.cs (5)
197var firstLog = logsArray[0]?.AsObject(); 201var firstLogAttributes = firstLog["attributes"]?.AsObject(); 210var secondLog = logsArray[1]?.AsObject(); 214var secondLogAttributes = secondLog["attributes"]?.AsObject(); 221var thirdLog = logsArray[2]?.AsObject();
Mcp\ListTracesToolTests.cs (5)
170var firstTrace = tracesArray[0]?.AsObject(); 183var serverSpan = spans.FirstOrDefault(s => s?["kind"]?.GetValue<string>() == "Server")?.AsObject(); 189var clientSpan = spans.FirstOrDefault(s => s?["kind"]?.GetValue<string>() == "Client")?.AsObject(); 195var secondTrace = tracesArray[1]?.AsObject(); 207var internalSpan = secondTraceSpans[0]?.AsObject();
Projects\ProjectUpdaterTests.cs (55)
107var itemsAndProperties = new JsonObject(); 232var itemsAndProperties = new JsonObject(); 387var itemsAndProperties = new JsonObject(); 506var itemsAndProperties = new JsonObject(); 659var itemsAndProperties = new JsonObject(); 779var itemsAndProperties = new JsonObject(); 940var itemsAndProperties = new JsonObject(); 1058var itemsAndProperties = new JsonObject(); 1160var itemsAndProperties = new JsonObject(); 1286var itemsAndProperties = new JsonObject(); 1380var itemsAndProperties = new JsonObject(); 1454var itemsAndProperties = new JsonObject(); 1550var itemsAndProperties = new JsonObject(); 1713var itemsAndProperties = new JsonObject(); 1861var itemsAndProperties = new JsonObject(); 1978var itemsAndProperties = new JsonObject(); 2098var itemsAndProperties = new JsonObject(); 2211var itemsAndProperties = new JsonObject(); 2578var itemsAndProperties = new JsonObject(); 2660var itemsAndProperties = new JsonObject(); 2756var itemsAndProperties = new JsonObject(); 2760var items = new JsonObject 2847var itemsAndProperties = new JsonObject(); 2849var items = new JsonObject 2923var itemsAndProperties = new JsonObject(); 3004var itemsAndProperties = new JsonObject(); 3093var itemsAndProperties = new JsonObject(); 3172var itemsAndProperties = new JsonObject(); 3252var itemsAndProperties = new JsonObject(); 3396var itemsAndProperties = new JsonObject(); 3782var itemsAndProperties = new JsonObject(); 3890var itemsAndProperties = new JsonObject(); 3967var itemsAndProperties = new JsonObject(); 4057var itemsAndProperties = new JsonObject(); 4099public static JsonObject WithSdkVersion(this JsonObject root, string sdkVersion) 4103JsonObject properties = new JsonObject(); 4113public static JsonObject WithMSBuildOutput(this JsonObject root) 4115JsonObject items = new JsonObject(); 4137public static JsonObject WithPackageReference(this JsonObject root, string packageId, string packageVersion) 4140var items = root["Items"]!.AsObject(); 4143JsonObject newPackageReference = new JsonObject 4153public static JsonObject WithPackageReferenceWithoutVersion(this JsonObject root, string packageId) 4156var items = root["Items"]!.AsObject(); 4159JsonObject newPackageReference = new JsonObject 4169public static JsonObject WithProjectReference(this JsonObject root, string fullPath) 4172var items = root["Items"]!.AsObject(); 4175JsonObject newProjectReference = new JsonObject 4184public static JsonObject WithProperty(this JsonObject root, string propertyName, string propertyValue) 4186JsonObject properties = new JsonObject();
Scaffolding\PackageJsonMergerTests.cs (28)
18private static JsonObject ParseJson(string json) => 24private static JsonObject GetScripts(string mergedJson) => 54var scripts = GetScripts(result); 91var scripts = GetScripts(result); 128var scripts = GetScripts(result); 166var scripts = GetScripts(result); 199var scripts = GetScripts(result); 224var scripts = GetScripts(result); 256var scripts = GetScripts(result); 299var scripts = GetScripts(result); 392var json = ParseJson(result); 467var json = ParseJson(result); 512var first = ParseJson(firstMerge); 513var second = ParseJson(secondMerge); 541var scripts = GetScripts(result); 598var json = ParseJson(result); 599var scripts = json["scripts"]!.AsObject(); 657var scripts = GetScripts(result); 723var scripts = GetScripts(result); 999Assert.True(weirdPkg is JsonObject); 1172var engines = ParseJson(result)["engines"]!.AsObject(); 1199var engines = ParseJson(result)["engines"]!.AsObject(); 1225var engines = ParseJson(result)["engines"]!.AsObject(); 1248var doc = JsonNode.Parse(result)!.AsObject(); 1301var doc = JsonNode.Parse(result)!.AsObject(); 1312var scripts = doc["scripts"]!.AsObject(); 1486var doc = JsonNode.Parse(result)!.AsObject(); 1494var scripts = doc["scripts"]!.AsObject();
Scaffolding\ScaffoldingServiceTests.cs (10)
89var packageJson = JsonNode.Parse("""{ "scripts": { "aspire:start": "npm --prefix aspire-apphost run aspire:start" } }""")!.AsObject(); 99var packageJson = JsonNode.Parse("""{ "scripts": { "aspire:start": "npm --prefix aspire-apphost run aspire:start" } }""")!.AsObject(); 109var packageJson = JsonNode.Parse("""{ "scripts": { "aspire:start": "npm --prefix aspire-apphost run aspire:start" } }""")!.AsObject(); 119var scripts = JsonNode.Parse("""{ "test": "vitest" }""")!.AsObject(); 136var scripts = new JsonObject(); 159var scripts = new JsonObject(); 182var scripts = JsonNode.Parse(""" 321var merged = JsonNode.Parse( 344var merged = JsonNode.Parse( 368var merged = JsonNode.Parse(
Utils\DevCertsCheckTests.cs (1)
308var certNode = certificates[0]!.AsObject();
Aspire.Dashboard (13)
Model\GenAI\GenAIItemPartViewModel.cs (4)
77JsonObject obj when obj.Count == 0 => string.Empty, 116JsonObject obj when obj.Count == 0 => string.Empty, 138private static JsonObject ToJsonObject(Dictionary<string, JsonElement> dict) 140var jsonObject = new JsonObject();
Model\GenAI\GenAISchemaHelpers.cs (4)
18internal static ToolDefinitionSchema ParseToolDefinitionSchema(JsonObject schemaObj) 27if (schemaObj["properties"] is JsonObject propsObj) 32if (prop.Value is JsonObject propSchemaObj) 40if (schemaObj["items"] is JsonObject itemsObj)
Model\GenAI\GenAIVisualizerDialogViewModel.cs (2)
97if (item is not JsonObject obj) 110if (obj["parameters"] is JsonObject paramsObj)
Model\TelemetryExportService.cs (1)
805var jsonObject = new JsonObject();
Otlp\Model\OtlpHelpers.cs (2)
195static JsonObject ConvertKeyValues(KeyValueList value) 197var o = new JsonObject();
Aspire.Dashboard.Tests (6)
Integration\OtlpGrpcServiceTests.cs (1)
164var configJson = new JsonObject
Integration\StartupTests.cs (1)
636var configJson = new JsonObject
Model\GenAISchemaHelpersTests.cs (2)
185var schemaObj = JsonNode.Parse(schemaJson) as JsonObject;
Model\TelemetryExportServiceTests.cs (2)
1435var connectionPropertiesObject = Assert.IsType<JsonObject>(deserialized.Properties[KnownProperties.Resource.ConnectionProperties]);
Aspire.Hosting (151)
Ats\UserSecretsExports.cs (2)
43var state = JsonNode.Parse(json) as JsonObject
Backchannel\AuxiliaryBackchannelRpcTarget.cs (3)
377private static IReadOnlyDictionary<string, string?> ConvertObjectArgumentValues(JsonObject arguments) 1411private static JsonObject ConvertNameValuePropertyToJsonObject(IEnumerable<KeyValuePair<string, string>> properties) 1413var jsonObject = new JsonObject();
Dashboard\DashboardEventHandlers.cs (3)
145var configJson = JsonNode.Parse(configText)?.AsObject(); 237var configJson = JsonNode.Parse(originalConfigText)?.AsObject(); 1081public JsonObject? State { get; set; }
Dcp\JsonPatch.cs (8)
31if (operationNode is not JsonObject operation || 55if (current is JsonObject currentObject && changed is JsonObject changedObject) 105private static JsonObject CreateOperation(string operation, string path, JsonNode? value = null) 107var result = new JsonObject 205case JsonObject jsonObject: 227JsonObject jsonObject when jsonObject.TryGetPropertyValue(segment, out var child) && child is not null => child, 237private static void ApplyToObject(JsonObject target, string operation, string propertyName, JsonNode? value)
Devcontainers\DevcontainerSettingsWriter.cs (8)
120var settings = (JsonObject)JsonObject.Parse(settingsContent)!; 122JsonObject? portsAttributes; 130portsAttributes = (JsonObject)portsAttributesNode!; 146let attrs = props.Value as JsonObject 166JsonObject? portAttributes; 174portAttributes = (JsonObject)portAttributeNode!;
DistributedApplicationBuilder.cs (2)
1056var effectiveState = FileDeploymentStateManager.LoadEffectiveState( 1061var flattenedState = JsonFlattener.FlattenJsonObject(effectiveState);
Pipelines\DeploymentStateSection.cs (4)
19public sealed class DeploymentStateSection(string sectionName, JsonObject? data, long version) 35/// The <see cref="JsonObject"/> returned by this property is NOT thread-safe. 38public JsonObject Data { get; } = data ?? []; 40internal JsonObject OriginalData { get; set; } = data?.DeepClone().AsObject() ?? [];
Pipelines\Internal\DeploymentStateManagerBase.cs (19)
39private JsonObject? _state; 58JsonObject state, 60JsonObject? originalSectionData, 66protected virtual JsonNode? GetSectionState(JsonObject? state, string sectionName, bool includeLegacyState) => 74protected async Task<JsonObject> LoadStateAsync(CancellationToken cancellationToken = default) 98protected virtual Task<JsonObject> LoadStateFromStorageAsync(CancellationToken cancellationToken = default) => 104protected static async Task<JsonObject> LoadStateFileAsync(string? statePath, CancellationToken cancellationToken) 115protected static JsonObject LoadStateFile(string? statePath) 123private static JsonObject ParseStateFile(string? fileContent) 136if (JsonNode.Parse(fileContent, documentOptions: jsonDocumentOptions) is not JsonObject flattenedState) 145public async Task SaveStateAsync(JsonObject state, CancellationToken cancellationToken = default) 189JsonObject? data = null; 193if (sectionData is JsonObject o) 224protected static JsonNode? TryGetNestedPropertyValue(JsonObject? node, string path) 236if (current is not JsonObject currentObj || !currentObj.TryGetPropertyValue(segment, out var nextNode)) 326protected static void SetNestedPropertyValue(JsonObject root, string path, JsonObject? value) 330var current = root; 334if (!current.TryGetPropertyValue(segment, out var nextNode) || nextNode is not JsonObject nextObj)
Pipelines\Internal\FileDeploymentStateManager.cs (68)
33private JsonObject _currentState = []; 34private JsonObject _legacyState = []; 35private JsonObject _legacyStateSnapshot = []; 91internal static async Task<JsonObject> LoadEffectiveStateAsync( 96JsonObject currentState; 119JsonObject legacyState = []; 141var effectiveState = MergeState(MergeState(legacyStateSnapshot, legacyState), currentState); 147internal static JsonObject LoadEffectiveState(string canonicalStatePath, string? legacyStatePath) 149JsonObject currentState; 171JsonObject legacyState = []; 190var effectiveState = MergeState(MergeState(legacyStateSnapshot, legacyState), currentState); 230protected override async Task<JsonObject> LoadStateFromStorageAsync(CancellationToken cancellationToken = default) 271protected override JsonNode? GetSectionState(JsonObject? state, string sectionName, bool includeLegacyState) 289if (mergedSection is not JsonObject mergedObject) 308JsonObject state, 310JsonObject? originalSectionData, 349var sectionData = TryGetNestedPropertyValue(state, sectionName) as JsonObject; 351var latestEffectiveState = MergeState(GetLegacyFallbackState(), _currentState); 353var latestSectionData = NormalizeSectionData( 355var desiredSectionData = ApplyChanges(latestSectionData, originalSectionData, sectionData) as JsonObject; 381private static JsonObject? NormalizeSectionData(JsonNode? sectionData) => 384JsonObject sectionObject => sectionObject, 431private static JsonObject MergeState(JsonObject legacyState, JsonObject currentState) 433var mergedState = legacyState.DeepClone().AsObject(); 437static void MergeInto(JsonObject target, JsonObject source) 441if (sourceValue is JsonObject sourceObject && 442target[name] is JsonObject targetObject) 454private JsonObject GetLegacyFallbackState() => 457private static async Task WriteStateAsync(string statePath, JsonObject state, CancellationToken cancellationToken) 459var flattenedSecrets = JsonFlattener.FlattenJsonObject(state); 500JsonObject currentState, 520if (baseline is JsonObject baselineObject && value is JsonObject valueObject) 550if (originalValue is JsonObject originalObject && 551savedValue is JsonObject savedObject && 554(latestValue is not JsonObject latestObject || !IsScalarSectionData(latestObject))) 556var result = latestValue?.DeepClone() as JsonObject ?? []; 600if (savedValue is JsonObject savedObject && 601(originalValue is JsonObject || !originalExists) && 603(originalValue is not JsonObject originalObject || !IsScalarSectionData(originalObject)) && 604(latestValue is not JsonObject latestObject || !IsScalarSectionData(latestObject))) 606return (true, ApplyChanges(latestValue, originalValue as JsonObject ?? [], savedObject)); 615private static bool IsScalarSectionData(JsonObject value) => value.ContainsKey(string.Empty); 621JsonObject effectiveState, 622JsonObject currentState, 642private static bool NestedPropertyExists(JsonObject root, string path) 645JsonObject current = root; 649nextNode is not JsonObject nextObject) 660private static void SetNestedNodeValue(JsonObject root, string path, JsonNode? value, bool valueExists) 663var current = root; 667if (!current.TryGetPropertyValue(segment, out var nextNode) || nextNode is not JsonObject nextObject) 705var legacyStateSnapshot = migrationState.LegacyStateSnapshot; 734var migrationState = await LoadStateFileAsync(migrationStatePath, cancellationToken).ConfigureAwait(false); 746private static MigrationState ParseMigrationState(JsonObject migrationState) 749var legacyStateSnapshot = migrationState[LegacyStateProperty] switch 752JsonObject legacyState => legacyState, 761var currentState = migrationState[CurrentStateProperty] switch 797JsonObject currentState, 798JsonObject legacyStateSnapshot, 803var migrationState = new JsonObject 817JsonObject LegacyStateSnapshot, 819JsonObject? CurrentState);
Pipelines\Internal\JsonFlattener.cs (13)
19public static JsonObject FlattenJsonObject(JsonObject source) 21var result = new JsonObject(); 32public static JsonObject UnflattenJsonObject(JsonObject source) 34var result = new JsonObject(); 39var current = result; 44if (!current.TryGetPropertyValue(key, out var existing) || existing is not JsonObject) 46var newObject = new JsonObject(); 62private static void FlattenJsonObjectRecursive(JsonObject source, string prefix, JsonObject result) 72if (kvp.Value is JsonObject nestedObject) 81if (array[i] is JsonObject arrayObject)
Pipelines\Internal\UserSecretsDeploymentStateManager.cs (2)
36JsonObject state, 38JsonObject? originalSectionData,
Publishing\ContainerRuntimeBase.cs (14)
188var root = JsonNode.Parse(output) as JsonObject; 249foreach (var item in verboseManifests.OfType<JsonObject>()) 251if (TryCreateManifest(item["Descriptor"] as JsonObject, operatingSystem, architecture, out var manifest)) 260if (root is not JsonObject manifestObject) 267foreach (var item in manifests.OfType<JsonObject>()) 278var descriptor = manifestObject["Descriptor"] as JsonObject ?? 279manifestObject["descriptor"] as JsonObject ?? 296JsonObject? descriptor, 307var platform = descriptor["platform"] as JsonObject;
UserSecrets\IUserSecretsManager.cs (1)
69Task SaveStateAsync(JsonObject state, CancellationToken cancellationToken = default);
UserSecrets\NoopUserSecretsManager.cs (1)
46public Task SaveStateAsync(JsonObject state, CancellationToken cancellationToken = default)
UserSecrets\UserSecretsManagerFactory.cs (3)
159public async Task SaveStateAsync(JsonObject state, CancellationToken cancellationToken = default) 164var flattenedState = JsonFlattener.FlattenJsonObject(state); 208var contents = new JsonObject();
Aspire.Hosting.Azure (65)
AzureDeploymentOperationDetails.cs (5)
76internal JsonObject ToJsonObject() 78var json = new JsonObject 134internal JsonObject ToJsonObject() 136var json = new JsonObject(); 169internal JsonObject ToJsonObject()
AzureProvisioningController.cs (16)
2430var json = await CreateCommandResultJsonAsync(commandName, resourceName: null, cancellationToken).ConfigureAwait(false); 2450var json = await CreateResourceCommandResultJsonAsync(DeleteAzureResourceCommandName, model, resourceName, cancellationToken).ConfigureAwait(false); 2462private async Task<JsonObject> CreateResourceCommandResultJsonAsync(string commandName, DistributedApplicationModel model, string resourceName, CancellationToken cancellationToken) 2464var json = await CreateCommandResultJsonAsync(commandName, resourceName, cancellationToken).ConfigureAwait(false); 2484var json = await CreateCommandResultJsonAsync(GetAzureResourceCommandName, resourceName, cancellationToken).ConfigureAwait(false); 2496var deployment = await CreateCachedDeploymentStateInfoAsync(bicepResource, context, cancellationToken).ConfigureAwait(false); 2507private async Task<JsonObject> CreateCachedDeploymentStateInfoAsync(AzureBicepResource resource, AzureContextState context, CancellationToken cancellationToken) 2518var json = new JsonObject 2550private async Task<JsonObject> CreateLiveResourceInfoAsync(string? resourceId, AzureContextState context, CancellationToken cancellationToken) 2554var json = new JsonObject 2658if (outputs is not JsonObject outputsObject || 2660outputNode is not JsonObject outputObject || 2669private async Task<JsonObject> CreateCommandResultJsonAsync(string commandName, string? resourceName, CancellationToken cancellationToken) 2675var json = new JsonObject 2701private static CommandResultData CreateJsonResultData(JsonObject json, bool displayImmediately = false) => 2721var json = new JsonObject
AzureProvisioningFailureDetails.cs (17)
453internal JsonObject ToJsonObject() 455var json = new JsonObject 566if (JsonNode.Parse(content) is not JsonObject responseObj) 582private static JsonObject? TryGetErrorObject(JsonObject responseObj) 592if (responseObj["error"] is JsonObject errorObj) 597if (responseObj["properties"] is JsonObject propertiesObj && 598propertiesObj["error"] is JsonObject deploymentErrorObj) 603if (responseObj["properties"] is JsonObject operationPropertiesObj && 604operationPropertiesObj["statusMessage"] is JsonObject statusMessageObj && 605statusMessageObj["error"] is JsonObject statusMessageErrorObj) 613private static ParsedAzureError? TryParseAzureError(JsonObject errorObj, ParsedAzureTargetResource? targetResource) 626if (detail is JsonObject detailObj && 672private static ParsedAzureError? CreateParsedAzureError(JsonObject errorObj, ParsedAzureTargetResource? targetResource) 710private static ParsedAzureTargetResource? TryParseTargetResource(JsonObject responseObj) 712if (responseObj["properties"] is not JsonObject propertiesObj || 713propertiesObj["targetResource"] is not JsonObject targetResourceObj)
AzureProvisioningJsonHelpers.cs (1)
35internal static string ToCommandResultJsonString(JsonObject json)
Provisioning\BicepUtilities.cs (9)
40public static async Task SetParametersAsync(JsonObject parameters, AzureBicepResource resource, bool skipKnownValues = false, CancellationToken cancellationToken = default) 76public static async Task SetScopeAsync(JsonObject scope, AzureBicepResource resource, CancellationToken cancellationToken = default) 103public static string GetChecksum(AzureBicepResource resource, JsonObject parameters, JsonObject? scope) 134var parameters = JsonNode.Parse(jsonString)?.AsObject(); 135var scope = section[DeploymentStateScopeKey] is string scopeString 178var parameters = JsonNode.Parse(jsonString)?.AsObject(); 179var scope = section.Data[DeploymentStateScopeKey]?.GetValue<string>() is { Length: > 0 } scopeString 219private static async Task SetScopeValueAsync(JsonObject scope, string propertyName, object? value, CancellationToken cancellationToken)
Provisioning\Internal\BaseProvisioningContextProvider.cs (1)
218var azureSection = azureStateSection.Data;
Provisioning\Internal\DefaultArmClientProvider.cs (1)
343data.Properties.Outputs?.ToObjectFromJson<JsonObject>());
Provisioning\Internal\IProvisioningServices.cs (1)
342internal sealed record AzureDeploymentState(string ProvisioningState, JsonObject? Outputs);
Provisioning\Internal\RunModeProvisioningContextProvider.cs (1)
236var data = azureSection.Data;
Provisioning\JsonExtensions.cs (1)
12var jsonObj = obj.AsObject();
Provisioning\Provisioners\BicepProvisioner.cs (12)
353JsonObject? outputs, 357if (!TryGetDeploymentStateJsonObject(stateSection, BicepUtilities.DeploymentStateParametersKey, resource.Name, out var parameters) || 371var scope = TryGetDeploymentStateJsonObject(stateSection, BicepUtilities.DeploymentStateScopeKey, resource.Name, out var cachedScope) 473[NotNullWhen(true)] out JsonObject? value) 568var parameters = new JsonObject(); 571var scope = new JsonObject(); 791var outputObj = outputs?.ToObjectFromJson<JsonObject>(); 1319JsonObject parameters, 1320JsonObject? outputObj, 1321JsonObject? scope,
Aspire.Hosting.Azure.Kubernetes (4)
AzureKubernetesEnvironmentResource.AksPipeline.cs (3)
419var scope = JsonNode.Parse(scopeJson)?.AsObject() 451private static bool HasPersistedAksIdentity(JsonObject deploymentState) 467private static ResourceIdentifier? GetPersistedAksResourceId(JsonObject deploymentState)
AzureKubernetesEnvironmentResource.cs (1)
198private static bool HasPersistedHelmReleaseState(JsonObject deploymentState)
Aspire.Hosting.Azure.Kubernetes.Tests (4)
AzureKubernetesInfrastructureTests.cs (1)
1802var azureState = new JsonObject { ["SubscriptionId"] = subscriptionId };
tests\Shared\InMemoryDeploymentStateManager.cs (3)
16private readonly Dictionary<string, JsonObject> _sections = new(); 21public void SetSection(string name, JsonObject data) 29if (_sections.TryGetValue(sectionName, out var data))
Aspire.Hosting.Azure.Sandboxes (18)
AzureSandboxContainerDeployment.cs (14)
275var pendingLegacyDeploymentCleanup = CreatePendingLegacyDeploymentCleanup( 496if (portStates.FirstOrDefault() is JsonObject firstPort && firstPort["Url"]?.GetValue<string>() is { } publicUrl) 1372if (GetPendingLegacyDeploymentCleanup(stateSection) is JsonObject pendingLegacyDeploymentCleanup) 1402.Where(pair => pair.Value is JsonObject) 1443if (GetPendingLegacyDeploymentCleanup(stateSection) is JsonObject pendingLegacyDeploymentCleanup) 1963internal static JsonObject? CreatePendingLegacyDeploymentCleanup( 1968var pendingDeploymentCleanup = GetPendingLegacyDeploymentCleanup(stateSection); 1981private static JsonObject? GetPendingLegacyDeploymentCleanup(DeploymentStateSection stateSection) => 1982stateSection.Data["PendingLegacyDeploymentCleanup"]?.DeepClone() as JsonObject; 1986JsonObject? pendingDeploymentCleanup) 2159foreach (var port in ports.OfType<JsonObject>()) 2204foreach (var port in ports.OfType<JsonObject>())
AzureSandboxEndpointPropertyValueProvider.cs (4)
135JsonObject? fallbackPort = null; 136foreach (var port in ports.OfType<JsonObject>()) 152private static bool TryGetUrl(JsonObject port, [NotNullWhen(true)] out string? url)
Aspire.Hosting.Azure.Tests (101)
AzureBicepProvisionerTests.cs (7)
866var parameters = new JsonObject(); 902var parameters = new JsonObject(); 953var parameters = new JsonObject(); 1599var outputs = JsonNode.Parse(section.Data[BicepUtilities.DeploymentStateOutputsKey]!.GetValue<string>())!.AsObject(); 1842var parameters = new JsonObject(); 1845var scope = new JsonObject(); 1857private static JsonObject CreateDeploymentOutputs(string blobEndpoint)
AzureDeployerTests.cs (1)
1692var cachedState = new JsonObject
AzureEnvironmentResourceExtensionsTests.cs (48)
367var resultData = AssertCommandJsonData(result); 761var data = AssertCommandJsonData(result); 841var data = AssertCommandJsonData(result); 850var azureContext = Assert.IsType<JsonObject>(data["azureContext"]); 856var deployment = Assert.IsType<JsonObject>(data["deployment"]); 866var outputs = Assert.IsType<JsonObject>(deployment["outputs"]); 869var scope = Assert.IsType<JsonObject>(deployment["scope"]); 872var live = Assert.IsType<JsonObject>(data["live"]); 924var data = AssertCommandJsonData(result); 925var live = Assert.IsType<JsonObject>(data["live"]); 986var json = details.ToJsonObject(); 1194var data = AssertCommandJsonData(result); 1195var deployment = Assert.IsType<JsonObject>(data["deployment"]); 1199var live = Assert.IsType<JsonObject>(data["live"]); 1257var data = AssertCommandJsonData(result); 1258var live = Assert.IsType<JsonObject>(data["live"]); 1318var data = AssertCommandJsonData(result); 1319var live = Assert.IsType<JsonObject>(data["live"]); 1810var resultData = AssertCommandJsonData(result); 1901var resultData = AssertCommandJsonData(result); 2853var data = AssertCommandJsonData(result); 2860var azureContext = Assert.IsType<JsonObject>(data["azureContext"]); 3467var data = AssertCommandJsonData(result); 3474var azureContext = Assert.IsType<JsonObject>(data["azureContext"]); 3534var data = AssertCommandJsonData(result); 4025var data = AssertCommandJsonData(result); 4028var diagnostic = Assert.IsType<JsonObject>(Assert.Single(diagnostics)); 4232var data = AssertCommandJsonData(result); 4236var diagnostic = Assert.IsType<JsonObject>(Assert.Single(diagnostics)); 5024private static JsonObject AssertCommandJsonData(ExecuteCommandResult result) 5029return Assert.IsType<JsonObject>(JsonNode.Parse(data.Value)); 5364private readonly Dictionary<string, JsonObject> _sections = new(StringComparer.Ordinal); 5376JsonObject data; 5379_sections.TryGetValue(sectionName, out var existingData);
AzureSandboxesTests.cs (1)
919var directCleanupState = AzureSandboxContainerDeployment.CreatePendingLegacyDeploymentCleanup(
BicepUtilitiesTests.cs (34)
22var parameters = new JsonObject(); 58var parameters = new JsonObject(); 109var parameters0 = new JsonObject(); 113var parameters1 = new JsonObject(); 136var parameters0 = new JsonObject(); 140var parameters1 = new JsonObject(); 160var parameters0 = new JsonObject(); 161var scope0 = new JsonObject(); 166var parameters1 = new JsonObject(); 167var scope1 = new JsonObject(); 188var parameters0 = new JsonObject(); 189var scope0 = new JsonObject(); 194var parameters1 = new JsonObject(); 195var scope1 = new JsonObject(); 211var parameters = new JsonObject 231var parameters1 = new JsonObject 236var parameters2 = new JsonObject 256var parameters = new JsonObject 261var scope1 = new JsonObject { ["resourceGroup"] = "rg1" }; 262var scope2 = new JsonObject { ["resourceGroup"] = "rg2" }; 284var parameters1 = new JsonObject 289var parameters2 = new JsonObject 319var parameters = new JsonObject(); 338var scope = new JsonObject(); 353var scope = new JsonObject(); 369var scope = new JsonObject(); 384var scope = new JsonObject 403var scope = new JsonObject(); 417var scope = new JsonObject(); 462var parameters = new JsonObject 488var legacyParameters = new JsonObject(); 503var currentParameters = new JsonObject(); 504var currentScope = new JsonObject(); 527var parameters = new JsonObject
JsonExtensionsTests.cs (3)
14var rootJson = new JsonObject(); 30var rootJson = new JsonObject(); 44var rootJson = new JsonObject();
ProvisioningTestHelpers.cs (4)
489private JsonObject? CreateDeploymentOutputs(string deploymentId) 1034private readonly JsonObject _state = []; 1040var sectionData = _state.TryGetPropertyValue(sectionName, out var node) && node is JsonObject obj
tests\Shared\InMemoryDeploymentStateManager.cs (3)
16private readonly Dictionary<string, JsonObject> _sections = new(); 21public void SetSection(string name, JsonObject data) 29if (_sections.TryGetValue(sectionName, out var data))
Aspire.Hosting.Blazor (2)
GatewayConfigurationBuilder.cs (2)
222var environment = new JsonObject(); 253var config = new JsonObject
Aspire.Hosting.Browsers.Tests (1)
BrowserLogsBuilderExtensionsTests.cs (1)
1978public Task SaveStateAsync(JsonObject state, CancellationToken cancellationToken = default) => Task.CompletedTask;
Aspire.Hosting.CodeGeneration.Go (3)
AtsGoCodeGenerator.cs (3)
695AtsTypeCategory.Dto when value is JsonObject obj && dtoTypesById.TryGetValue(typeRef.TypeId, out var dtoInfo) 699AtsTypeCategory.Dict when value is JsonObject obj 716JsonObject value,
Aspire.Hosting.CodeGeneration.Java (3)
AtsJavaCodeGenerator.cs (3)
865AtsTypeCategory.Dto when value is JsonObject obj && dtoTypesById.TryGetValue(typeRef.TypeId, out var dtoInfo) 871AtsTypeCategory.Dict when value is JsonObject obj 878JsonObject value,
Aspire.Hosting.CodeGeneration.Python (3)
AtsPythonCodeGenerator.cs (3)
1001AtsTypeCategory.Dto when value is JsonObject obj && dtoTypesById.TryGetValue(typeRef.TypeId, out var dtoInfo) 1005AtsTypeCategory.Dict when value is JsonObject obj 1020JsonObject value,
Aspire.Hosting.CodeGeneration.TypeScript (21)
TypeScriptApiExportWriter.cs (10)
21public static JsonObject Write(TypeScriptApiModel model) 72private static JsonObject WriteModule(TypeScriptApiModule module) 80var json = new JsonObject { ["name"] = module.Name }; 86private static JsonObject WriteItem(TypeScriptApiItem item) 88var json = new JsonObject 117private static JsonObject WriteMember(TypeScriptApiMember member) 119var json = new JsonObject 142var parameterJson = new JsonObject 173private static void AddIfPresent(JsonObject json, string name, string? value) 181private static void AddIfPresent(JsonObject json, string name, IReadOnlyList<string> values)
TypeScriptApiProjector.cs (3)
773AtsTypeCategory.Dto when value is JsonObject obj && _dtoTypesById.TryGetValue(typeRef.TypeId, out var dtoInfo) 777AtsTypeCategory.Dict when value is JsonObject obj 783private string RenderTypeScriptDtoValue(JsonObject value, AtsDtoTypeInfo dtoInfo)
TypeScriptLanguageSupport.cs (8)
127var packageJson = new JsonObject(); 145var engines = EnsureObject(packageJson, "engines"); 148var scripts = EnsureObject(packageJson, "scripts"); 189private static void EnsureDependency(JsonObject packageJson, string sectionName, string packageName, string version) 191var section = EnsureObject(packageJson, sectionName); 206private static JsonObject EnsureObject(JsonObject parent, string propertyName) 208if (parent[propertyName] is JsonObject obj)
Aspire.Hosting.CodeGeneration.TypeScript.Tests (19)
AtsTypeScriptCodeGeneratorTests.cs (1)
43var packageJson = System.Text.Json.Nodes.JsonNode.Parse(content)!.AsObject();
TypeScriptLanguageSupportTests.cs (18)
30var packageJson = ParseJson(files["package.json"]); 31var scripts = packageJson["scripts"]!.AsObject(); 32var devDependencies = packageJson["devDependencies"]!.AsObject(); 51var engines = packageJson["engines"]!.AsObject(); 60var tsConfig = ParseJson(files["tsconfig.apphost.json"]); 96var packageJson = ParseJson(files["package.json"]); 97var scripts = packageJson["scripts"]!.AsObject(); 98var dependencies = packageJson["dependencies"]!.AsObject(); 99var devDependencies = packageJson["devDependencies"]!.AsObject(); 126var engines = packageJson["engines"]!.AsObject(); 143var packageJson = ParseJson(files["package.json"]); 176var packageJson = ParseJson(files["package.json"]); 177var dependencies = packageJson["dependencies"]!.AsObject(); 178var devDependencies = packageJson["devDependencies"]!.AsObject(); 232var appHostRunJson = ParseJson(files["apphost.run.json"]); 233var httpsProfile = appHostRunJson["profiles"]!["https"]!.AsObject(); 235var environmentVariables = httpsProfile["environmentVariables"]!.AsObject(); 315private static JsonObject ParseJson(string content) => JsonNode.Parse(content)!.AsObject();
Aspire.Hosting.Docker.Tests (3)
tests\Shared\InMemoryDeploymentStateManager.cs (3)
16private readonly Dictionary<string, JsonObject> _sections = new(); 21public void SetSection(string name, JsonObject data) 29if (_sections.TryGetValue(sectionName, out var data))
Aspire.Hosting.Kubernetes (2)
KubernetesEnvironmentResource.cs (2)
2074var metadataNode = new System.Text.Json.Nodes.JsonObject 2094var minimal = new System.Text.Json.Nodes.JsonObject
Aspire.Hosting.Kubernetes.Tests (3)
tests\Shared\InMemoryDeploymentStateManager.cs (3)
16private readonly Dictionary<string, JsonObject> _sections = new(); 21public void SetSection(string name, JsonObject data) 29if (_sections.TryGetValue(sectionName, out var data))
Aspire.Hosting.Radius (2)
Publishing\RadiusDeploymentPipelineStep.cs (2)
268var parametersNode = new JsonObject(); 275var document = new JsonObject
Aspire.Hosting.RemoteHost (54)
Ats\AtsCallbackProxyFactory.cs (16)
128var jsonObjectType = typeof(JsonObject); 188argsExpr ?? Expression.Constant(null, typeof(JsonObject)), 203argsExpr ?? Expression.Constant(null, typeof(JsonObject)), 218argsExpr ?? Expression.Constant(null, typeof(JsonObject)), 233argsExpr ?? Expression.Constant(null, typeof(JsonObject)), 238private void InvokeSyncVoid(string callbackId, JsonObject? args, CancellationToken cancellationToken, int ctParamIndex) 244private void InvokeSyncVoidWithDtoWriteback(string callbackId, JsonObject? args, object?[] originalArgs, Type[] argTypes, CancellationToken cancellationToken, int ctParamIndex) 251private T? InvokeSyncResult<T>(string callbackId, JsonObject? args, CancellationToken cancellationToken, int ctParamIndex) 258private async Task InvokeAsyncVoid(string callbackId, JsonObject? args, CancellationToken cancellationToken, int ctParamIndex) 264private async Task InvokeAsyncVoidWithDtoWriteback(string callbackId, JsonObject? args, object?[] originalArgs, Type[] argTypes, CancellationToken cancellationToken, int ctParamIndex) 271private async Task<T?> InvokeAsyncResult<T>(string callbackId, JsonObject? args, CancellationToken cancellationToken, int ctParamIndex) 294private void AddCancellationTokenToArgs(ref JsonObject? args, CancellationToken cancellationToken, int ctParamIndex) 327argsExpr ?? Expression.Constant(null, typeof(JsonObject)), 346argsExpr ?? Expression.Constant(null, typeof(JsonObject)), 377if (result is not JsonObject returnedArgs) 405if (returnedArgs[key] is JsonObject modifiedDto)
Ats\AtsError.cs (4)
43public JsonObject ToJsonObject() 45var obj = new JsonObject 94public JsonObject ToJsonObject() 96var obj = new JsonObject();
Ats\AtsMarshaller.cs (5)
275private object? DeserializeDto(JsonObject jsonObj, Type targetType, UnmarshalContext context) 664if (node is JsonObject jsonObj) 747JsonObject obj when obj.ContainsKey("$handle") => "handle", 748JsonObject => "object", 1028public void ApplyDtoProperties(JsonObject source, object target, Type targetType)
Ats\CapabilityDispatcher.cs (15)
22JsonObject? args, 538public async Task<JsonNode?> InvokeAsync(string capabilityId, JsonObject? args) 623public JsonNode? Invoke(string capabilityId, JsonObject? args) 756JsonObject? args, 799JsonObject? args, 957JsonObject obj when obj.ContainsKey("$handle") => "handle", 958JsonObject => "object", 966JsonObject? args, 1028public static string GetRequiredString(this JsonObject args, string name, string capabilityId) 1042public static string? GetOptionalString(this JsonObject args, string name) 1054public static int? GetOptionalInt(this JsonObject args, string name) 1067this JsonObject args, 1097public static T? GetDto<T>(this JsonObject args, string name) where T : class 1099if (args.TryGetPropertyValue(name, out var node) && node is JsonObject obj) 1109public static JsonObject CreateHandleResult(this HandleRegistry handles, object obj, string typeId)
Ats\HandleRegistry.cs (3)
145public JsonObject Marshal(object obj, string typeId) 198if (node is JsonObject obj && obj.TryGetPropertyValue("$handle", out var handleNode)) 214return node is JsonObject obj && obj.ContainsKey("$handle");
Ats\PolyglotCapabilityInvocationException.cs (4)
130JsonObject? args, 154JsonObject? args, 180JsonObject? args, 251private static string TryGetTargetContext(JsonObject? args, HandleRegistry handles, string? targetParameterName)
Ats\ReferenceExpressionRef.cs (3)
71if (node is not JsonObject obj || !obj.TryGetPropertyValue("$expr", out var exprNode)) 76if (exprNode is not JsonObject exprObj) 138return node is JsonObject obj && obj.ContainsKey("$expr");
Diagnostics\RemoteHostProfilingTelemetry.cs (3)
151public ActivityScope StartJsonRpcInvokeCapability(string capabilityId, JsonObject? args) 426public void SetCapabilityInvocation(string capabilityId, JsonObject? args) 487private static string[] SanitizeArgumentNames(JsonObject? args)
RemoteAppHostService.cs (1)
120public async Task<JsonNode?> InvokeCapabilityAsync(string capabilityId, JsonObject? args)
Aspire.Hosting.RemoteHost.Tests (186)
AtsCapabilityScannerTests.cs (2)
699var valueObject = Assert.IsType<JsonObject>(exportedValue.Value);
AtsMarshallerTests.cs (53)
333var json = new JsonObject 374var json = new JsonObject { ["$handle"] = handleId }; 386var json = new JsonObject { ["$handle"] = "aspire/Unknown:999" }; 422var json = new JsonObject { ["key1"] = 1, ["key2"] = 2 }; 540Assert.IsType<JsonObject>(result); 541var jsonObj = (JsonObject)result; 559Assert.IsType<JsonObject>(result); 560var jsonObj = (JsonObject)result; 578Assert.IsType<JsonObject>(result); 579var jsonObj = (JsonObject)result; 700var json = new JsonObject { ["a"] = 1, ["b"] = 2 }; 713var json = new JsonObject { ["value"] = 42 }; 726var json = new JsonObject { ["name"] = "test", ["count"] = 5 }; 740var json = new JsonObject 774Assert.IsType<JsonObject>(result); 775var jsonObj = (JsonObject)result; 784var json = new JsonObject 803var json = new JsonObject 828var json = Assert.IsType<JsonObject>(result); 838var json = new JsonObject { ["required"] = double.MaxValue }; 922var obj = Assert.IsType<JsonObject>(result); 938var obj = Assert.IsType<JsonObject>(result); 940var childObj = Assert.IsType<JsonObject>(obj["child"]); 958var obj = Assert.IsType<JsonObject>(result); 974var obj = Assert.IsType<JsonObject>(result); 976var childObj = Assert.IsType<JsonObject>(obj["child"]); 986var source = new JsonObject { ["name"] = "updated", ["count"] = 42 }; 999var source = new JsonObject { ["name"] = "updated" }; 1012var source = new JsonObject 1029var source = new JsonObject { ["display_name"] = "updated", ["val"] = 99 }; 1043var source = new JsonObject { ["displayName"] = "should-not-apply" }; 1055var source = new JsonObject { ["name"] = "updated", ["secret"] = "should-be-ignored" }; 1068var source = new JsonObject { ["name"] = "updated", ["computed"] = "should-be-ignored" }; 1082var source = new JsonObject { ["count"] = "not-a-number" }; 1095var source = new JsonObject 1245Assert.IsType<JsonObject>(result); 1246var jsonObj = (JsonObject)result; 1331var json = new JsonObject 1372var json = new JsonObject 1414var json = new JsonObject 1453var json = new JsonObject
CallbackProxyTests.cs (12)
125var args = invoker.Invocations[0].Args as JsonObject; 142var args = invoker.Invocations[0].Args as JsonObject; 168var args = Assert.IsAssignableFrom<JsonObject>(invoker.Invocations[0].Args); 169var handle = Assert.IsAssignableFrom<JsonObject>(args["p0"]); 199var args = invoker.Invocations[0].Args as JsonObject; 220var args = invoker.Invocations[0].Args as JsonObject;
CapabilityDispatcherTests.cs (104)
184var args = new JsonObject { ["value"] = "hello" }; 196var args = new JsonObject { ["required"] = "test" }; 208var args = new JsonObject { ["required"] = "test", ["optional"] = "custom" }; 220var args = new JsonObject { ["value"] = "test" }; 263var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } }; 290var args = new JsonObject { ["context"] = "not-a-handle" }; 302var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = "Aspire.Hosting.RemoteHost.Tests/Aspire.Hosting.RemoteHost.Tests.TestContextType:999" } }; 319var getArgs = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } }; 326var invokeArgs = new JsonObject { ["cancellationToken"] = tokenResult }; 379var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } }; 386var handleRef = result.AsObject(); 398var nestedArgs = new JsonObject { ["context"] = new JsonObject { ["$handle"] = nestedHandleId } }; 456var args = new JsonObject 477var args = new JsonObject 496var args = new JsonObject 515var args = new JsonObject 548var args = new JsonObject 566var args = new JsonObject 587var args = new JsonObject 607var args = new JsonObject 623var args = new JsonObject { ["value"] = "value-task" }; 664var args = new JsonObject 687var args = new JsonObject 708var args = new JsonObject 716var callbackArgs = invoker.Invocations[0].Args as JsonObject; 731var args = new JsonObject 873var args = new JsonObject 901var args = new JsonObject { ["value"] = "test" }; 912var args = new JsonObject { ["value"] = "hello" }; 924var args = new JsonObject { ["value"] = "test" }; 938var args = new JsonObject 953var args = new JsonObject { ["count"] = 3 }; 970var args = new JsonObject 986var args = new JsonObject { ["value"] = "hello" }; 998var args = new JsonObject { ["value"] = 42 }; 1010var args = new JsonObject 1028var args = new JsonObject { ["value"] = nameof(TestDispatchEnum.ValueB) }; 1040var args = new JsonObject { ["value"] = "/usr/local/lib/redis/modules/redisearch.so" }; 1052var args = new JsonObject 1078var args = new JsonObject 1093var args = new JsonObject 1111var args = new JsonObject 1139var resultObj = result as JsonObject; 1152var listHandle = (listResult as JsonObject)?["$handle"]?.GetValue<string>(); 1156var args = new JsonObject 1175var listHandle = (listResult as JsonObject)?["$handle"]?.GetValue<string>(); 1178var args = new JsonObject 1198var listHandle = (listResult as JsonObject)?["$handle"]?.GetValue<string>(); 1202var removeArgs = new JsonObject 1213var lengthArgs = new JsonObject 1231var listHandle = (listResult as JsonObject)?["$handle"]?.GetValue<string>(); 1234var args = new JsonObject 1253var listHandle = (listResult as JsonObject)?["$handle"]?.GetValue<string>(); 1257var clearArgs = new JsonObject 1264var lengthArgs = new JsonObject 1285var resultObj = result as JsonObject; 1298var dictHandle = (dictResult as JsonObject)?["$handle"]?.GetValue<string>(); 1302var args = new JsonObject 1321var dictHandle = (dictResult as JsonObject)?["$handle"]?.GetValue<string>(); 1324var args = new JsonObject 1343var dictHandle = (dictResult as JsonObject)?["$handle"]?.GetValue<string>(); 1346var args = new JsonObject 1366var dictHandle = (dictResult as JsonObject)?["$handle"]?.GetValue<string>(); 1370var removeArgs = new JsonObject 1381var countArgs = new JsonObject 1399var dictHandle = (dictResult as JsonObject)?["$handle"]?.GetValue<string>(); 1403var hasArgs = new JsonObject 1414var hasArgs2 = new JsonObject 1433var dictHandle = (dictResult as JsonObject)?["$handle"]?.GetValue<string>(); 1436var args = new JsonObject 1458var dictHandle = (dictResult as JsonObject)?["$handle"]?.GetValue<string>(); 1461var args = new JsonObject 1482var dictHandle = (dictResult as JsonObject)?["$handle"]?.GetValue<string>(); 1485var args = new JsonObject 1502var dictHandle = (dictResult as JsonObject)?["$handle"]?.GetValue<string>(); 1505var args = new JsonObject 1522var args = new JsonObject 1539var args = new JsonObject 1556var args = new JsonObject 1573var args = new JsonObject 1599var args = new JsonObject 1618var args = new JsonObject 1636var args = new JsonObject 1654var args = new JsonObject(); 1676var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } }; 1694var args = new JsonObject 1714var args = new JsonObject 1735var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } }; 1752var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } }; 1767var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } }; 1787var args = new JsonObject 1811var args = new JsonObject 1833var args = new JsonObject 1855var args = new JsonObject 1876var args = new JsonObject 1902var args = new JsonObject 1930var args = new JsonObject 1950var args = new JsonObject 1977var args = new JsonObject 2005var args = new JsonObject 2091var args = new JsonObject
HandleRegistryTests.cs (8)
172var json = registry.Marshal(obj, "aspire/TestObject"); 248var json = new JsonObject { ["$handle"] = "42" }; 277var json = new JsonObject { ["name"] = "test", ["value"] = 42 }; 287var json = new JsonObject { ["$handle"] = 42 }; 296var json = new JsonObject 312var json = new JsonObject { ["$handle"] = "1" }; 334var json = new JsonObject { ["name"] = "test" }; 343var json = new JsonObject { ["$handle"] = 42 };
ReferenceExpressionRefTests.cs (7)
17var json = new JsonObject 38var json = new JsonObject 65var json = new JsonObject 91var json = new JsonObject 104var json = new JsonObject { ["format"] = "test" }; 236var json = new JsonObject 251((JsonObject)json["$expr"]!)["valueProviders"] = providersArray;
Aspire.Hosting.Tests (31)
Backchannel\AuxiliaryBackchannelRpcTargetTests.cs (2)
1332var nameValueObject = Assert.IsAssignableFrom<JsonObject>(snapshot.Properties["object"]);
JsonFlattenerTests.cs (16)
16var userSecrets = new JsonObject 34var result = JsonFlattener.FlattenJsonObject(userSecrets); 50var userSecrets = new JsonObject 58var result = JsonFlattener.FlattenJsonObject(userSecrets); 71var userSecrets = new JsonObject(); 74var result = JsonFlattener.FlattenJsonObject(userSecrets); 84var userSecrets = new JsonObject 99var result = JsonFlattener.FlattenJsonObject(userSecrets); 110var userSecrets = new JsonObject 124var result = JsonFlattener.FlattenJsonObject(userSecrets); 139var userSecrets = new JsonObject 147var result = JsonFlattener.FlattenJsonObject(userSecrets); 168var userSecrets = new JsonObject 187var result = JsonFlattener.FlattenJsonObject(userSecrets); 203var userSecrets = new JsonObject 210var result = JsonFlattener.FlattenJsonObject(userSecrets);
Orchestrator\ParameterProcessorTests.cs (5)
1653private readonly JsonObject _unflattenedState = []; 1654private JsonObject? _flattenedState; 1657public JsonObject State => _flattenedState ?? []; 1664var sectionData = _unflattenedState.TryGetPropertyValue(sectionName, out var sectionNode) && sectionNode is JsonObject obj
Publishing\DeploymentStateManagerTests.cs (8)
227var state = new JsonObject 721var features = Assert.IsType<JsonObject>(restartedSection.Data["Features"]); 1027var asyncEffectiveState = await FileDeploymentStateManager.LoadEffectiveStateAsync( 1030var syncEffectiveState = FileDeploymentStateManager.LoadEffectiveState( 1051var asyncEffectiveState = await FileDeploymentStateManager.LoadEffectiveStateAsync( 1054var syncEffectiveState = FileDeploymentStateManager.LoadEffectiveState( 1208var effectiveState = FileDeploymentStateManager.LoadEffectiveState(canonicalPath, legacyPath);
Aspire.Hosting.TestUtilities (1)
Utils\MockUserSecretsManager.cs (1)
51public Task SaveStateAsync(JsonObject state, CancellationToken cancellationToken = default)
Aspire.Hosting.Yarp (5)
YarpJsonConfigGeneratorBuilder.cs (5)
83var jsonObject = new JsonObject(); 94private JsonObject AddRoutes() 96var routesNode = new JsonObject(); 108private JsonObject AddClusters() 110var routesNode = new JsonObject();
ConfigurationSchemaGenerator (23)
ConfigSchemaEmitter.cs (23)
44var root = new JsonObject(); 51private void GenerateLogCategories(JsonObject parent) 59var propertiesNode = new JsonObject(s_ignoreCaseNodeOptions); 62var categoryNode = new JsonObject(); 76private void GenerateGraph(JsonObject rootNode) 101private bool GeneratePathSegment(JsonObject currentNode, TypeSpec type, Queue<string> pathSegments) 123if (currentNode[propertiesName] is not JsonObject propertiesNode) 132if (propertiesNode[pathSegment] is not JsonObject pathSegmentNode) 182private bool GenerateType(JsonObject currentNode, TypeSpec type) 226private bool GenerateObject(JsonObject currentNode, ObjectSpec objectSpec) 244if (currentNode["properties"] is not JsonObject propertiesNode) 275private bool GenerateProperty(JsonObject currentNode, PropertySpec property, IPropertySymbol? propertySymbol) 286var propertyNode = new JsonObject(); 306private bool GenerateCollection(JsonObject currentNode, CollectionSpec collection, string typeName, string containerName) 319var containerNode = new JsonObject(); 334private static void RestoreBackup(JsonNode? backupNode, string name, JsonObject parentNode) 434private static void GenerateDescriptionFromDocComment(JsonObject propertyNode, string docComment) 490private void GenerateDescriptionForType(JsonObject currentNode, TypeSpec type) 587private void GenerateParsableFromString(JsonObject propertyNode, ParsableFromStringSpec parsable) 678private bool IsExcluded(JsonObject currentNode, PropertySpec property) 718private static void ReplaceNodeWithKeyCasingChange(JsonObject jsonObject, string key, JsonNode value) 739case JsonObject obj: 743obj.Parent is JsonObject && obj.GetPropertyName() == "properties" ?
dotnet-user-jwts (19)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JwtSerializerContext.GetJsonTypeInfo.g.cs (1)
54if (type == typeof(global::System.Text.Json.Nodes.JsonObject))
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JwtSerializerContext.JsonObject.g.cs (8)
13private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Text.Json.Nodes.JsonObject>? _JsonObject; 19public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Text.Json.Nodes.JsonObject> JsonObject 22get => _JsonObject ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Text.Json.Nodes.JsonObject>)Options.GetTypeInfo(typeof(global::System.Text.Json.Nodes.JsonObject)); 25private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Text.Json.Nodes.JsonObject> Create_JsonObject(global::System.Text.Json.JsonSerializerOptions options) 27if (!TryGetTypeInfoForRuntimeCustomConverter<global::System.Text.Json.Nodes.JsonObject>(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo<global::System.Text.Json.Nodes.JsonObject> jsonTypeInfo)) 29jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo<global::System.Text.Json.Nodes.JsonObject>(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.JsonObjectConverter);
Helpers\JwtAuthenticationSchemeSettings.cs (8)
18var config = File.Exists(filePath) 22var settingsObject = new JsonObject 28if (config[AuthenticationKey] is JsonObject authentication) 30if (authentication[SchemesKey] is JsonObject schemes) 63static JsonObject ReadConfiguration(string filePath) 73var config = JsonSerializer.Deserialize(reader, JwtSerializerContext.Default.JsonObject); 76if (config[AuthenticationKey] is JsonObject authentication && 77authentication[SchemesKey] is JsonObject schemes)
Helpers\JwtSerializerOptions.cs (1)
24[JsonSerializable(typeof(JsonObject))]
Helpers\SigningKeysHandler.cs (1)
65JsonObject secrets = null;
Infrastructure.Tests (29)
Pipelines\NixCliPackageTests.cs (20)
27var manifest = await ReadJsonObjectAsync("eng/nix/versions.json"); 33var systems = GetRequiredObject(manifest, "systems"); 40var entry = GetRequiredObject(systems, system); 59var manifest = await ReadJsonObjectAsync("eng/nix/versions.json"); 103var manifest = await ReadJsonObjectAsync(outputPath); 104var systems = GetRequiredObject(manifest, "systems"); 109var entry = GetRequiredObject(systems, system); 165var manifest = await ReadJsonObjectAsync(outputPath); 166var systems = GetRequiredObject(manifest, "systems"); 170var entry = GetRequiredObject(systems, system); 200var flakeLock = await ReadJsonObjectAsync("flake.lock"); 201var nodes = GetRequiredObject(flakeLock, "nodes"); 202var nixpkgs = GetRequiredObject(nodes, "nixpkgs"); 203var locked = GetRequiredObject(nixpkgs, "locked"); 204var original = GetRequiredObject(nixpkgs, "original"); 213private static async Task<JsonObject> ReadJsonObjectAsync(string relativePath) 256private static JsonObject GetRequiredObject(JsonObject obj, string propertyName) 259return Assert.IsType<JsonObject>(value); 262private static string GetRequiredString(JsonObject obj, string propertyName)
Pipelines\NpmCliPackageTests.cs (9)
249var packageJson = ReadJsonObject(Path.Combine(package.PointerPackageRoot, "package.json")); 265var packageMap = ReadJsonObject(Path.Combine(package.PointerPackageRoot, "bin", "aspire-package-map.json")); 335var packageJson = ReadJsonObject(Path.Combine(package.RidPackageRoot, "package.json")); 595var packageMap = new JsonObject(); 764private static JsonObject ReadJsonObject(string path) 771private static JsonObject GetObject(JsonObject jsonObject, string propertyName) 777private static string GetString(JsonObject jsonObject, string propertyName) 789private static Dictionary<string, string> GetStringMap(JsonObject jsonObject)
Microsoft.AspNetCore.JsonPatch.SystemTextJson (13)
Adapters\AdapterFactory.cs (1)
33JsonObject => new JsonObjectAdapter(),
Internal\JsonObjectAdapter.cs (12)
20var obj = (JsonObject)target; 35var obj = (JsonObject)target; 55var obj = (JsonObject)target; 74var obj = (JsonObject)target; 96var obj = (JsonObject)target; 127var obj = (JsonObject)target;
Microsoft.AspNetCore.OpenApi (10)
Extensions\JsonNodeSchemaExtensions.cs (2)
444var mappings = new JsonObject(); 570else if (schema is JsonObject schemaObject)
Schemas\OpenApiJsonSchema.Helpers.cs (1)
157var obj = new JsonObject();
Services\Schemas\OpenApiSchemaService.cs (7)
159private static JsonObject CreateSchemaForJsonPatch() 161var addReplaceTest = new JsonObject() 181var moveCopy = new JsonObject() 204var remove = new JsonObject() 589if (node is JsonObject jsonObject) 617var newObject = new JsonObject(); 730if (currentNode is JsonObject currentObject)
Microsoft.Extensions.AI (4)
ChatCompletion\ChatClientStructuredOutputExtensions.cs (2)
169}, AIJsonUtilities.DefaultOptions.GetTypeInfo(typeof(JsonObject))); 225JsonValueKind.Object => JsonObject.Create(element),
Realtime\LoggingRealtimeClientSession.cs (2)
189var obj = new JsonObject 212var obj = new JsonObject
Microsoft.Extensions.AI.Abstractions (29)
Utilities\AIJsonUtilities.cs (1)
174case JsonObject obj:
Utilities\AIJsonUtilities.Defaults.cs (1)
73[JsonSerializable(typeof(JsonObject))]
Utilities\AIJsonUtilities.Schema.Create.cs (23)
90JsonObject parameterSchemas = new(); 240JsonObject? schemaObj = null; 285if (schema is JsonObject objSchema) 324JsonObject obj = ConvertSchemaToObject(ref schema); 404static JsonObject ConvertSchemaToObject(ref JsonNode schema) 406JsonObject obj; 411return (JsonObject)schema; 454JsonObject obj = ConvertSchemaToObject(ref schema); 467JsonObject obj = ConvertSchemaToObject(ref schema); 481JsonObject obj = ConvertSchemaToObject(ref schema); 495JsonObject obj = ConvertSchemaToObject(ref schema); 564schema is JsonObject requiredSchemaObj && 607JsonObject obj = ConvertSchemaToObject(ref schema); 631JsonObject obj = ConvertSchemaToObject(ref schema); 644JsonObject obj = ConvertSchemaToObject(ref schema); 647if (notNode is null or JsonObject) 649JsonObject notObj = 650notNode as JsonObject ?? 651(JsonObject)(obj[NotPropertyName] = new JsonObject()); 666JsonObject obj = ConvertSchemaToObject(ref schema); 711static bool TryGetSchemaType(JsonObject schema, [NotNullWhen(true)] out string? schemaType, out bool isNullable) 777private static bool TypeIsIntegerWithStringNumberHandling(AIJsonSchemaCreateContext ctx, JsonObject schema, [NotNullWhen(true)] out string? numericType, out bool isNullable) 821private static void InsertAtStart(this JsonObject jsonObject, string key, JsonNode value)
Utilities\AIJsonUtilities.Schema.Transform.cs (4)
64JsonObject schemaObj = (JsonObject)schema; 65JsonObject? properties = null; 68if (schemaObj.TryGetPropertyValue(PropertiesPropertyName, out JsonNode? props) && props is JsonObject propsObj)
Microsoft.Extensions.AI.Abstractions.Tests (8)
Contents\FunctionCallContentTests.cs (1)
97var jsonObj = json!.AsObject();
test\Shared\JsonSchemaExporter\TestTypes.cs (2)
105yield return new TestData<JsonObject>(new() { ["x"] = 42 }, """{"type":["object","null"]}"""); 1249[JsonSerializable(typeof(JsonObject))]
Utilities\AIJsonUtilitiesTests.cs (5)
1829var schemaObj = Assert.IsType<JsonObject>(schema); 1844var schemaObj = Assert.IsType<JsonObject>(schema); 1850Assert.Equal(((JsonArray)schemaObj["required"]!).Count, ((JsonObject)props!).Count);
Microsoft.Extensions.AI.Evaluation.Safety (9)
ContentSafetyServicePayloadUtilities.cs (9)
148var payload = 194IEnumerable<JsonObject> userTextListItems = 200var item = new JsonObject(); 230var payload = 274IEnumerable<JsonObject> GetMessages(Dictionary<string, ChatMessage> turn, int turnIndex) 280IEnumerable<JsonObject> contents = GetContents(question); 291IEnumerable<JsonObject> contents = GetContents(answer); 314IEnumerable<JsonObject> GetContents(ChatMessage message) 356var payload =
Microsoft.Extensions.AI.OpenAI (2)
OpenAIClientExtensions.cs (1)
59if (node is JsonObject schemaObj)
OpenAIRealtimeClientSession.cs (1)
367JsonObject obj => obj.ToJsonString(),
Microsoft.ML.AutoML (1)
SweepableEstimator\Converter\SweepableEstimatorConverter.cs (1)
29var jObject = JsonObject.Parse("{}");
Microsoft.ML.AutoML.SourceGenerator (1)
SearchSpaceGenerator.cs (1)
93else if (searchSpaceNode is JsonObject searchSpaceObject && searchSpaceObject.ContainsKey("min"))
Microsoft.ML.GenAI.Mistral (2)
Mistral_7B_0_3ChatTemplateBuilder.cs (1)
125arguments = JsonObject.Parse(tc.FunctionArguments),
MistralCausalLMAgent.cs (1)
140public JsonObject? Arguments { get; set; }
Microsoft.NET.Build.Containers (16)
ImageConfig.cs (14)
15private readonly JsonObject _config; 50_config = config as JsonObject ?? throw new ArgumentException($"{nameof(config)} should be a JSON object.", nameof(config)); 51if (_config["config"] is not JsonObject) 90var newConfig = new JsonObject(); 151var configContainer = new JsonObject() 171private JsonObject CreateHistory(HistoryEntry h) 173var history = new JsonObject(); 246if (_config["config"]?["ExposedPorts"] is JsonObject portsJson) 252&& property.Value is JsonObject propertyValue 265if (_config["config"]?["Labels"] is JsonObject labelsJson) 300private JsonObject CreatePortMap() 304JsonObject container = new(); 323private JsonObject CreateLabelMap() 325JsonObject container = new();
Tasks\CreateImageIndex.cs (2)
145var configJson = JsonNode.Parse(config) as JsonObject;
Microsoft.NET.Build.Tasks (12)
GenerateRuntimeConfigurationFiles.cs (12)
295JsonObject runtimeOptionsFromProject = (JsonObject)JsonNode.Parse( 312JsonObject configProperties = GetConfigProperties(runtimeOptions); 320private static JsonObject GetConfigProperties(RuntimeOptions runtimeOptions) 323|| configProperties is not JsonObject) 329return (JsonObject)configProperties; 363JsonObject configProperties = GetConfigProperties(devConfig.RuntimeOptions); 416JsonObject json = new() 435private static JsonObject SerializeRuntimeOptions(RuntimeOptions runtimeOptions) 438JsonObject json = new(); 503private static JsonObject SerializeFramework(RuntimeConfigFramework framework) 505JsonObject json = new();
Microsoft.NETCore.Platforms (1)
UpdateRuntimeIdentifierGraph.cs (1)
32JsonObject runtimes = json!["runtimes"]!.AsObject();
Microsoft.TemplateEngine.Cli (23)
Alias\AliasRegistry.cs (5)
139JsonObject parsed = _environmentSettings.Host.FileSystem.ReadObject(_aliasesFilePath); 149JsonObject root = new(); 150JsonObject commandAliases = new(); 170private IReadOnlyDictionary<string, IReadOnlyList<string>> ToStringListDictionary(JsonObject token, StringComparer? comparer = null, string? propertyName = null) 190if (element is not JsonObject jObj)
HostSpecificDataLoader.cs (2)
48JsonObject? jObject = JsonNode.Parse(hostData, nodeOptions: null, s_jsonDocumentOptions)?.AsObject(); 69JsonObject? jsonData;
HostSpecificTemplateData.cs (5)
18internal HostSpecificTemplateData(JsonObject? jObject) 37if (symbolsNode is JsonObject symbols) 41if (symbolInfo.Value is not JsonObject symbol) 177internal static HostSpecificTemplateData Default { get; } = new HostSpecificTemplateData((JsonObject?)null); 190private static JsonNode? GetPropertyCaseInsensitive(JsonObject obj, string key)
JExtensions.cs (8)
36if (token is not JsonObject obj) 123if (token is not JsonObject obj) 162if (token is not JsonObject currentJObj) 170if (element is not JsonObject nested) 183if (token is not JsonObject obj || key == null) 217internal static JsonObject ReadObject(this IPhysicalFileSystem fileSystem, string path) 222return (JsonObject?)JsonNode.Parse(json, null, DocOptions) 267private static JsonNode? GetPropertyCaseInsensitive(JsonObject obj, string key)
TemplateSearch\CliHostSearchCacheData.cs (3)
16JsonObject? cacheObject = obj as JsonObject; 40cliData[data.Key] = new HostSpecificTemplateData(data.Value as JsonObject);
Microsoft.TemplateEngine.Edge (59)
BuiltInManagedProvider\GlobalSettings.cs (1)
83var jObject = _environmentSettings.Host.FileSystem.ReadObject(_globalSettingsFile);
Constraints\ConstraintsExtensions.cs (2)
52public static IEnumerable<JsonObject> ParseArrayOfConstraintJObjects(this string? args) 59if (value is not JsonObject jObj)
Constraints\HostConstraint.cs (1)
74foreach (JsonObject jObj in args.ParseArrayOfConstraintJObjects())
parent\Shared\JExtensions.cs (33)
44if (token is not JsonObject obj) 156if (token is not JsonObject obj) 197internal static IReadOnlyList<string> ToStringReadOnlyList(this JsonObject jObject, string propertyName, IReadOnlyList<string>? defaultValue = null) 210if (token is not JsonObject obj) 222return element is not JsonObject jObj ? [] : GetObjectProperties(jObj); 228/// Enumerates the properties of a <see cref="JsonObject"/>, handling duplicate keys gracefully. 231/// <see cref="JsonObject"/> lazily initializes its internal dictionary when first accessed. 236private static IReadOnlyList<KeyValuePair<string, JsonNode?>> GetObjectProperties(JsonObject obj) 251/// Enumerates the properties of a <see cref="JsonObject"/> by re-parsing its JSON text via 255/// <see cref="JsonObject.WriteTo"/> falls back to the underlying <see cref="System.Text.Json.JsonElement"/> 257/// safe to call even after a failed <see cref="JsonObject"/> initialization. 260private static List<KeyValuePair<string, JsonNode?>> GetObjectPropertiesViaDocument(JsonObject obj) 285if (token is not JsonObject obj || key == null) 439internal static JsonObject ReadJObjectFromIFile(this IFile file) 444return (JsonObject?)JsonNode.Parse(json, null, DocOptions) 448internal static JsonObject ReadObject(this IPhysicalFileSystem fileSystem, string path) 453return (JsonObject?)JsonNode.Parse(json, null, DocOptions) 501/// Tries to get a property value from a <see cref="JsonObject"/> using case-insensitive key matching. 503internal static bool TryGetValueCaseInsensitive(this JsonObject obj, string key, out JsonNode? result) 513internal static JsonNode? GetPropertyCaseInsensitive(JsonObject obj, string key) 546private static JsonNode? GetPropertyCaseInsensitiveViaDocument(JsonObject obj, string key) 574internal static JsonObject ParseJsonObject(string json) 576return (JsonObject?)JsonNode.Parse(json, null, DocOptions) 596internal static JsonObject FromObject(object obj) 599return (JsonObject?)JsonNode.Parse(json, null, DocOptions) 604/// Creates a deep clone of a <see cref="JsonObject"/> by round-tripping through JSON text. 606internal static JsonObject DeepCloneObject(this JsonObject source) 608return (JsonObject?)JsonNode.Parse(source.ToJsonString(), null, DocOptions) 619internal static void Merge(this JsonObject target, JsonObject source) 623if (property.Value is JsonObject sourceObj 625&& targetNode is JsonObject targetObj)
Settings\SettingsStore.cs (4)
14internal SettingsStore(JsonObject? obj) 23if (componentGuidToAssemblyQualifiedNameToken is JsonObject componentGuidToAssemblyQualifiedNameObject) 51if (componentTypeToGuidListToken is JsonObject componentTypeToGuidListObject) 92JsonObject parsed;
Settings\TemplateCache.cs (6)
61(string, JsonObject?)? hostFile = GetBestHostConfigMatch(chosenTemplate.Template, environmentSettings, chosenTemplate.MountPoint); 74public TemplateCache(JsonObject? contentJObject) 95if (contentJObject.TryGetValueCaseInsensitive(nameof(MountPointsInfo), out JsonNode? mountPointInfoToken) && mountPointInfoToken is JsonObject mountPointInfoObj) 114if (entry is JsonObject entryObj) 201private (string, JsonObject?)? GetBestHostConfigMatch(IScanTemplateInfo newTemplate, IEngineEnvironmentSettings settings, IMountPoint mountPoint) 218private JsonObject? ReadHostFile(IScanTemplateInfo template, string path, IEngineEnvironmentSettings settings, IMountPoint mountPoint)
Settings\TemplateInfo.cs (2)
70internal TemplateInfo(IScanTemplateInfo template, ILocalizationLocator? localizationInfo, (string Path, JsonObject? Content)? hostConfig) 242public static TemplateInfo FromJObject(JsonObject entry)
Settings\TemplateInfoReader.cs (10)
17internal static TemplateInfo FromJObject(JsonObject entry) 55JsonObject? baselineJObject = entry.Get<JsonObject>(nameof(ITemplateInfo.BaselineInfo)); 82if (item is JsonObject jObj) 93JsonObject? tagsObject = entry.Get<JsonObject>(nameof(TagsCollection)); 140/// Parses <see cref="ITemplateParameter"/> from <see cref="JsonObject"/>. 143private static ITemplateParameter ParameterFromJObject(JsonObject jObject) 166JsonObject? cdToken = jObject.Get<JsonObject>(nameof(ITemplateParameter.Choices));
Microsoft.TemplateEngine.Orchestrator.RunnableProjects (103)
ConfigModel\BaseReplaceSymbol.cs (1)
23private protected BaseReplaceSymbol(JsonObject jObject, string name) : base(name)
ConfigModel\BaseValueSymbol.cs (2)
18private protected BaseValueSymbol(string name, JsonObject jObject, string? defaultOverride, bool symbolConditionsSupported = false) : base(jObject, name) 23if (!jObject.TryGetValue(nameof(Forms), out JsonNode? formsToken) || formsToken is not JsonObject formsObject)
ConfigModel\BindSymbol.cs (1)
26internal BindSymbol(string name, JsonObject jObject) : base(jObject, name)
ConfigModel\ComputedSymbol.cs (1)
26internal ComputedSymbol(string name, JsonObject jObject) : base(name)
ConfigModel\CustomFileGlobModel.cs (2)
40internal static CustomFileGlobModel FromJObject(JsonObject globData, string globName) 48if (operationConfig is JsonObject obj)
ConfigModel\CustomOperationModel.cs (2)
25internal static CustomOperationModel FromJObject(JsonObject jObject) 31Configuration = jObject.Get<JsonObject>(nameof(Configuration))?.ToJsonString(),
ConfigModel\DerivedSymbol.cs (1)
32internal DerivedSymbol(string name, JsonObject jObject, string? defaultOverride)
ConfigModel\ExtendedFileSource.cs (5)
57internal static ExtendedFileSource FromJObject(JsonObject jObject) 66Rename = jObject.Get<JsonObject>(nameof(Rename))?.ToStringDictionary().ToDictionary(x => x.Key, x => x.Value) ?? RenameDefaults, 72foreach (JsonObject entry in jObject.Items<JsonObject>(nameof(src.Modifiers))) 80Rename = entry.Get<JsonObject>(nameof(Rename))?.ToStringDictionary().ToDictionary(x => x.Key, x => x.Value) ?? RenameDefaults,
ConfigModel\GeneratedSymbol.cs (1)
32internal GeneratedSymbol(string name, JsonObject jObject) : base(jObject, name)
ConfigModel\ParameterSymbol.cs (4)
29internal ParameterSymbol(string name, JsonObject jObject, string? defaultOverride) 42foreach (JsonObject choiceObject in jObject.Items<JsonObject>(nameof(Choices))) 191private static TemplateParameterPrecedence GetPrecedence(bool isRequired, JsonObject jObject)
ConfigModel\ReplacementContext.cs (2)
31internal static IReadOnlyList<ReplacementContext> FromJObject(JsonObject jObject) 40if (entry is not JsonObject)
ConfigModel\SymbolModelConverter.cs (1)
14internal static BaseSymbol? GetModelForObject(string name, JsonObject jObject, ILogger? logger, string? defaultOverride)
ConfigModel\SymbolValueFormsModel.cs (1)
33internal static SymbolValueFormsModel FromJObject(JsonObject configJson)
ConfigModel\TemplateConfigModel.cs (13)
47private TemplateConfigModel(JsonObject source, ILogger? logger, string? baselineName = null) 80foreach (JsonObject item in source.Items<JsonObject>(nameof(Sources))) 111if (prop.Value is not JsonObject obj) 161GlobalCustomOperations = CustomFileGlobModel.FromJObject((JsonObject)globalCustomConfigData, string.Empty); 173CustomFileGlobModel globModel = CustomFileGlobModel.FromJObject((JsonObject)globData, globName); 182if (prop.Value is not JsonObject obj) 434JsonObject source = JExtensions.ParseJsonObject(json); 438internal static TemplateConfigModel FromJObject(JsonObject source, ILogger? logger = null, string? baselineName = null) 523private static Dictionary<string, IValueForm> SetupValueFormMapForTemplate(JsonObject? source = null) 546if (form.Value is JsonObject o) 560if (property.Value is not JsonObject obj) 565IReadOnlyDictionary<string, string>? defaultOverrides = obj.Get<JsonObject>(nameof(Utils.BaselineInfo.DefaultOverrides))?.ToStringDictionary() ?? new Dictionary<string, string>();
DirectoryBasedTemplate.cs (4)
160private static JsonObject MergeAdditionalConfiguration(JsonObject primarySource, IFileSystemInfo primarySourceConfig) 169JsonObject combinedSource = primarySource.DeepCloneObject(); 184JsonObject partialConfigJson = partialConfigFile.ReadJObjectFromIFile();
LocalizationModelDeserializer.cs (1)
29System.Text.Json.Nodes.JsonObject srcObject = file.ReadJObjectFromIFile();
Macros\JoinMacroConfig.cs (1)
36if (entry is not JsonObject jObj)
Macros\RegexMacroConfig.cs (1)
38if (entry is not JsonObject jObj)
Macros\SwitchMacroConfig.cs (1)
37if (entry is not JsonObject jObj)
OperationConfig\BalancedNestingConfig.cs (3)
21JsonObject rawConfiguration = JExtensions.ParseJsonObject(configuration); 32internal static JsonObject CreateConfiguration(string startToken, string realEndToken, string pseudoEndToken, string id, string resetFlag) 34JsonObject config = new JsonObject
OperationConfig\ConditionalBlockCommentConfig.cs (1)
14internal static List<IOperationProvider> ConfigureFromJObject(JsonObject rawConfiguration)
OperationConfig\ConditionalConfig.cs (1)
22JsonObject rawConfiguration = JExtensions.ParseJsonObject(configuration);
OperationConfig\ConditionalCustomConfig.cs (1)
13internal static List<IOperationProvider> ConfigureFromJObject(JsonObject rawConfiguration)
OperationConfig\ConditionalKeywords.cs (1)
37internal static ConditionalKeywords FromJObject(JsonObject rawConfiguration)
OperationConfig\ConditionalLineCommentConfig.cs (1)
14internal static List<IOperationProvider> ConfigureFromJObject(JsonObject rawConfiguration)
OperationConfig\ConditionalOperationOptions.cs (1)
31internal static ConditionalOperationOptions FromJObject(JsonObject rawConfiguration)
OperationConfig\FlagsConfig.cs (1)
28JsonObject rawConfiguration = JExtensions.ParseJsonObject(configuration);
OperationConfig\IncludeConfig.cs (1)
22JsonObject rawConfiguration = JExtensions.ParseJsonObject(configuration);
OperationConfig\RegionConfig.cs (1)
21JsonObject rawConfiguration = JExtensions.ParseJsonObject(configuration);
OperationConfig\ReplacementConfig.cs (2)
23JsonObject rawConfiguration = JExtensions.ParseJsonObject(configuration); 36if (entry is not JsonObject)
parent\Shared\JExtensions.cs (33)
44if (token is not JsonObject obj) 156if (token is not JsonObject obj) 197internal static IReadOnlyList<string> ToStringReadOnlyList(this JsonObject jObject, string propertyName, IReadOnlyList<string>? defaultValue = null) 210if (token is not JsonObject obj) 222return element is not JsonObject jObj ? [] : GetObjectProperties(jObj); 228/// Enumerates the properties of a <see cref="JsonObject"/>, handling duplicate keys gracefully. 231/// <see cref="JsonObject"/> lazily initializes its internal dictionary when first accessed. 236private static IReadOnlyList<KeyValuePair<string, JsonNode?>> GetObjectProperties(JsonObject obj) 251/// Enumerates the properties of a <see cref="JsonObject"/> by re-parsing its JSON text via 255/// <see cref="JsonObject.WriteTo"/> falls back to the underlying <see cref="System.Text.Json.JsonElement"/> 257/// safe to call even after a failed <see cref="JsonObject"/> initialization. 260private static List<KeyValuePair<string, JsonNode?>> GetObjectPropertiesViaDocument(JsonObject obj) 285if (token is not JsonObject obj || key == null) 439internal static JsonObject ReadJObjectFromIFile(this IFile file) 444return (JsonObject?)JsonNode.Parse(json, null, DocOptions) 448internal static JsonObject ReadObject(this IPhysicalFileSystem fileSystem, string path) 453return (JsonObject?)JsonNode.Parse(json, null, DocOptions) 501/// Tries to get a property value from a <see cref="JsonObject"/> using case-insensitive key matching. 503internal static bool TryGetValueCaseInsensitive(this JsonObject obj, string key, out JsonNode? result) 513internal static JsonNode? GetPropertyCaseInsensitive(JsonObject obj, string key) 546private static JsonNode? GetPropertyCaseInsensitiveViaDocument(JsonObject obj, string key) 574internal static JsonObject ParseJsonObject(string json) 576return (JsonObject?)JsonNode.Parse(json, null, DocOptions) 596internal static JsonObject FromObject(object obj) 599return (JsonObject?)JsonNode.Parse(json, null, DocOptions) 604/// Creates a deep clone of a <see cref="JsonObject"/> by round-tripping through JSON text. 606internal static JsonObject DeepCloneObject(this JsonObject source) 608return (JsonObject?)JsonNode.Parse(source.ToJsonString(), null, DocOptions) 619internal static void Merge(this JsonObject target, JsonObject source) 623if (property.Value is JsonObject sourceObj 625&& targetNode is JsonObject targetObj)
ValueFormRegistry.cs (1)
39internal static IValueForm GetForm(string name, JsonObject? obj)
ValueForms\ActionableValueFormFactory.cs (1)
15public override IValueForm FromJObject(string name, JsonObject? configuration = null)
ValueForms\BaseValueFormFactory.cs (1)
27public abstract IValueForm FromJObject(string name, JsonObject? configuration = null);
ValueForms\ChainValueFormFactory.cs (1)
30protected override IReadOnlyList<string> ReadConfiguration(JsonObject jObject)
ValueForms\ConfigurableValueFormFactory.cs (2)
15public override IValueForm FromJObject(string name, JsonObject? configuration) 37protected abstract T ReadConfiguration(JsonObject jObject);
ValueForms\DependentValueFormFactory.cs (2)
15public override IValueForm FromJObject(string name, JsonObject? configuration) 37protected abstract T ReadConfiguration(JsonObject jObject);
ValueForms\IValueForm.cs (1)
26/// See <see cref="TemplateConfigModel.SetupValueFormMapForTemplate(System.Text.Json.Nodes.JsonObject?)"/> for more details.
ValueForms\IValueFormFactory.cs (1)
23IValueForm FromJObject(string name, JsonObject? configuration = null);
ValueForms\ReplacementValueFormFactory.cs (1)
37protected override ReplacementValueFormSettings ReadConfiguration(JsonObject jObject)
Microsoft.TemplateEngine.Utils (33)
parent\Shared\JExtensions.cs (33)
44if (token is not JsonObject obj) 156if (token is not JsonObject obj) 197internal static IReadOnlyList<string> ToStringReadOnlyList(this JsonObject jObject, string propertyName, IReadOnlyList<string>? defaultValue = null) 210if (token is not JsonObject obj) 222return element is not JsonObject jObj ? [] : GetObjectProperties(jObj); 228/// Enumerates the properties of a <see cref="JsonObject"/>, handling duplicate keys gracefully. 231/// <see cref="JsonObject"/> lazily initializes its internal dictionary when first accessed. 236private static IReadOnlyList<KeyValuePair<string, JsonNode?>> GetObjectProperties(JsonObject obj) 251/// Enumerates the properties of a <see cref="JsonObject"/> by re-parsing its JSON text via 255/// <see cref="JsonObject.WriteTo"/> falls back to the underlying <see cref="System.Text.Json.JsonElement"/> 257/// safe to call even after a failed <see cref="JsonObject"/> initialization. 260private static List<KeyValuePair<string, JsonNode?>> GetObjectPropertiesViaDocument(JsonObject obj) 285if (token is not JsonObject obj || key == null) 439internal static JsonObject ReadJObjectFromIFile(this IFile file) 444return (JsonObject?)JsonNode.Parse(json, null, DocOptions) 448internal static JsonObject ReadObject(this IPhysicalFileSystem fileSystem, string path) 453return (JsonObject?)JsonNode.Parse(json, null, DocOptions) 501/// Tries to get a property value from a <see cref="JsonObject"/> using case-insensitive key matching. 503internal static bool TryGetValueCaseInsensitive(this JsonObject obj, string key, out JsonNode? result) 513internal static JsonNode? GetPropertyCaseInsensitive(JsonObject obj, string key) 546private static JsonNode? GetPropertyCaseInsensitiveViaDocument(JsonObject obj, string key) 574internal static JsonObject ParseJsonObject(string json) 576return (JsonObject?)JsonNode.Parse(json, null, DocOptions) 596internal static JsonObject FromObject(object obj) 599return (JsonObject?)JsonNode.Parse(json, null, DocOptions) 604/// Creates a deep clone of a <see cref="JsonObject"/> by round-tripping through JSON text. 606internal static JsonObject DeepCloneObject(this JsonObject source) 608return (JsonObject?)JsonNode.Parse(source.ToJsonString(), null, DocOptions) 619internal static void Merge(this JsonObject target, JsonObject source) 623if (property.Value is JsonObject sourceObj 625&& targetNode is JsonObject targetObj)
Microsoft.TemplateSearch.Common (71)
parent\Shared\JExtensions.cs (33)
44if (token is not JsonObject obj) 156if (token is not JsonObject obj) 197internal static IReadOnlyList<string> ToStringReadOnlyList(this JsonObject jObject, string propertyName, IReadOnlyList<string>? defaultValue = null) 210if (token is not JsonObject obj) 222return element is not JsonObject jObj ? [] : GetObjectProperties(jObj); 228/// Enumerates the properties of a <see cref="JsonObject"/>, handling duplicate keys gracefully. 231/// <see cref="JsonObject"/> lazily initializes its internal dictionary when first accessed. 236private static IReadOnlyList<KeyValuePair<string, JsonNode?>> GetObjectProperties(JsonObject obj) 251/// Enumerates the properties of a <see cref="JsonObject"/> by re-parsing its JSON text via 255/// <see cref="JsonObject.WriteTo"/> falls back to the underlying <see cref="System.Text.Json.JsonElement"/> 257/// safe to call even after a failed <see cref="JsonObject"/> initialization. 260private static List<KeyValuePair<string, JsonNode?>> GetObjectPropertiesViaDocument(JsonObject obj) 285if (token is not JsonObject obj || key == null) 439internal static JsonObject ReadJObjectFromIFile(this IFile file) 444return (JsonObject?)JsonNode.Parse(json, null, DocOptions) 448internal static JsonObject ReadObject(this IPhysicalFileSystem fileSystem, string path) 453return (JsonObject?)JsonNode.Parse(json, null, DocOptions) 501/// Tries to get a property value from a <see cref="JsonObject"/> using case-insensitive key matching. 503internal static bool TryGetValueCaseInsensitive(this JsonObject obj, string key, out JsonNode? result) 513internal static JsonNode? GetPropertyCaseInsensitive(JsonObject obj, string key) 546private static JsonNode? GetPropertyCaseInsensitiveViaDocument(JsonObject obj, string key) 574internal static JsonObject ParseJsonObject(string json) 576return (JsonObject?)JsonNode.Parse(json, null, DocOptions) 596internal static JsonObject FromObject(object obj) 599return (JsonObject?)JsonNode.Parse(json, null, DocOptions) 604/// Creates a deep clone of a <see cref="JsonObject"/> by round-tripping through JSON text. 606internal static JsonObject DeepCloneObject(this JsonObject source) 608return (JsonObject?)JsonNode.Parse(source.ToJsonString(), null, DocOptions) 619internal static void Merge(this JsonObject target, JsonObject source) 623if (property.Value is JsonObject sourceObj 625&& targetNode is JsonObject targetObj)
TemplateDiscoveryMetadata\BlobStorageTemplateInfo.cs (16)
148public static BlobStorageTemplateInfo FromJObject(JsonObject entry) 178JsonObject? baselineJObject = entry.Get<JsonObject>(nameof(ITemplateInfo.BaselineInfo)); 216if (item is JsonObject jObj) 224JsonObject? tagsObject = entry.Get<JsonObject>(nameof(TagsCollection)); 235tagsObject = entry.Get<JsonObject>("tags"); 253else if (item.Value is JsonObject tagObj) 255JsonObject? choicesObject = tagObj.Get<JsonObject>("ChoicesAndDescriptions"); 281JsonObject? cacheParametersObject = entry.Get<JsonObject>("cacheParameters"); 287if (item.Value is not JsonObject paramObj) 350internal BlobTemplateParameter(JsonObject jObject) 364JsonObject? cdToken = jObject.Get<JsonObject>(nameof(Choices));
TemplateDiscoveryMetadata\LegacySearchCacheReader.cs (12)
61JsonObject cacheObject = JExtensions.ParseJsonObject(cacheText); 66internal static bool TryReadDiscoveryMetadata(JsonObject cacheObject, ILogger logger, IReadOnlyDictionary<string, Func<object, object>>? additionalDataReaders, out TemplateDiscoveryMetadata? discoveryMetadata) 81private static bool TryReadVersion(ILogger logger, JsonObject cacheObject, out string? version) 97JsonObject cacheObject, 112if (entry is JsonObject entryObj) 143private static bool TryReadPackToTemplateMap(ILogger logger, JsonObject cacheObject, out IReadOnlyDictionary<string, PackToTemplateEntry>? packToTemplateMap) 149if (packToTemplateMapToken is not JsonObject packToTemplateMapObject) 163JsonObject entryValue = (JsonObject)packEntry.Value; 208private static bool TryReadAdditionalData(ILogger logger, JsonObject cacheObject, IReadOnlyDictionary<string, Func<object, object>>? additionalDataReaders, out IReadOnlyDictionary<string, object>? additionalData) 218if (additionalDataToken is not JsonObject additionalDataObject) 233if (dataNode is not JsonObject dataObject)
TemplateDiscoveryMetadata\TemplateDiscoveryMetadata.cs (1)
41internal JsonObject ToJObject()
TemplateSearchCache\TemplatePackageSearchData.Json.cs (2)
17internal TemplatePackageSearchData(JsonObject jObject, ILogger logger, IReadOnlyDictionary<string, Func<object, object>>? additionalDataReaders = null) 46if (template is JsonObject templateObj)
TemplateSearchCache\TemplateSearchCache.Json.cs (6)
18JsonObject cacheObject, 59if (templatePackage is not JsonObject templatePackageObj) 74JsonObject cacheObject, 82if (dataNode is not JsonObject dataObject) 106internal JsonObject ToJObject() 111private static bool TryReadVersion(ILogger logger, JsonObject cacheObject, out string? version)
TemplateSearchCache\TemplateSearchData.Json.cs (1)
17internal TemplateSearchData(JsonObject jObject, ILogger logger, IReadOnlyDictionary<string, Func<object, object>>? additionalDataReaders = null)
MSBuild (5)
JsonOutputFormatter.cs (4)
60JsonObject jsonItem = new(); 90JsonObject targetResultsNode = new(); 94JsonObject targetResults = new(); 99JsonObject jsonItem = new();
XMake.cs (1)
4735var jsonNode = new JsonObject();
NuGet.Protocol (11)
Plugins\Logging\AssemblyLogMessage.cs (1)
41var message = new JsonObject
Plugins\Logging\CommunicationLogMessage.cs (1)
27var message = new JsonObject
Plugins\Logging\EnvironmentVariablesLogMessage.cs (1)
34var message = new JsonObject();
Plugins\Logging\MachineLogMessage.cs (1)
21var message = new JsonObject
Plugins\Logging\PluginInstanceLogMessage.cs (1)
30var message = new JsonObject
Plugins\Logging\PluginLogMessage.cs (2)
19protected string ToString(string type, JsonObject message) 31var outerMessage = new JsonObject
Plugins\Logging\ProcessLogMessage.cs (1)
30var message = new JsonObject
Plugins\Logging\StopwatchLogMessage.cs (1)
21var message = new JsonObject
Plugins\Logging\TaskLogMessage.cs (1)
30var message = new JsonObject
Plugins\Logging\ThreadPoolLogMessage.cs (1)
26var message = new JsonObject
sdk-tasks (6)
GetRuntimePackRids.cs (1)
22var runtimeJsonRoot = JsonNode.Parse(runtimeJsonContents)!.AsObject();
PublishMutationUtilities.cs (2)
22var targetObj = target.Value!.AsObject(); 38var librariesObj = deps["libraries"]!.AsObject();
RemoveAssetFromDepsPackages.cs (1)
44var sectionObj = section.AsObject();
UpdateRuntimeConfig.cs (2)
37var config = JsonNode.Parse(text)!.AsObject(); 57var framework = item.AsObject();
SelectTests (2)
Program.cs (2)
586var selection = new JsonObject(); 624var root = new JsonObject
Shared.Tests (2)
JsonSchemaExporter\TestTypes.cs (2)
105yield return new TestData<JsonObject>(new() { ["x"] = 42 }, """{"type":["object","null"]}"""); 1249[JsonSerializable(typeof(JsonObject))]
System.Text.Json (81)
System\Text\Json\Nodes\JsonArray.cs (2)
102case JsonObject: 393if (Value is JsonObject jsonObject)
System\Text\Json\Nodes\JsonNode.cs (17)
76/// Casts to the derived <see cref="JsonObject"/> type. 79/// A <see cref="JsonObject"/>. 82/// The node is not a <see cref="JsonObject"/>. 84public JsonObject AsObject() 86JsonObject? jObject = this as JsonObject; 90ThrowHelper.ThrowInvalidOperationException_NodeWrongType(nameof(JsonObject)); 120/// A parent can either be a <see cref="JsonObject"/> or a <see cref="JsonArray"/>. 210/// The current <see cref="JsonNode"/> is not a <see cref="JsonArray"/> or <see cref="JsonObject"/>. 220ThrowHelper.ThrowInvalidOperationException_NodeWrongType(nameof(JsonArray), nameof(JsonObject)); 225ThrowHelper.ThrowInvalidOperationException_NodeWrongType(nameof(JsonArray), nameof(JsonObject)); 236/// The current <see cref="JsonNode"/> is not a <see cref="JsonObject"/>. 269/// The current parent is not a <see cref="JsonObject"/>. 273JsonObject? parentObject = _parent as JsonObject; 277ThrowHelper.ThrowInvalidOperationException_NodeParentWrongType(nameof(JsonObject)); 335case JsonObject jsonObject:
System\Text\Json\Nodes\JsonNodeOptions.cs (1)
12/// Specifies whether property names on <see cref="JsonObject"/> are case insensitive.
System\Text\Json\Nodes\JsonObject.cs (13)
14/// It's safe to perform multiple concurrent read operations on a <see cref="JsonObject"/>, 26/// Initializes a new instance of the <see cref="JsonObject"/> class that is empty. 32/// Initializes a new instance of the <see cref="JsonObject"/> class that contains the specified <paramref name="properties"/>. 51/// Initializes a new instance of the <see cref="JsonObject"/> class that contains properties from the specified <see cref="JsonElement"/>. 54/// The new instance of the <see cref="JsonObject"/> class that contains properties from the specified <see cref="JsonElement"/>. 58/// <returns>A <see cref="JsonObject"/>.</returns> 59public static JsonObject? Create(JsonElement element, JsonNodeOptions? options = null) 94var jObject = new JsonObject(Options) 139/// <see langword="true"/> if the <see cref="JsonObject"/> contains an element with the specified property name; otherwise, <see langword="false"/>. 214case JsonObject jsonObject: 319private readonly JsonObject _node; 321public DebugView(JsonObject node) 372if (Value is JsonObject jsonObject)
System\Text\Json\Nodes\JsonObject.IDictionary.cs (28)
16/// Adds an element with the provided property name and value to the <see cref="JsonObject"/>. 24/// An element with the same property name already exists in the <see cref="JsonObject"/>. 35/// Adds an element with the provided name and value to the <see cref="JsonObject"/>, if a property named <paramref name="propertyName"/> doesn't already exist. 46/// Adds an element with the provided name and value to the <see cref="JsonObject"/>, if a property named <paramref name="propertyName"/> doesn't already exist. 50/// <param name="index">The index of the added or existing <paramref name="propertyName"/>. This is always a valid index into the <see cref="JsonObject"/>.</param> 70/// Adds the specified property to the <see cref="JsonObject"/>. 73/// The KeyValuePair structure representing the property name and value to add to the <see cref="JsonObject"/>. 76/// An element with the same property name already exists in the <see cref="JsonObject"/>. 84/// Removes all elements from the <see cref="JsonObject"/>. 105/// Determines whether the <see cref="JsonObject"/> contains an element with the specified property name. 107/// <param name="propertyName">The property name to locate in the <see cref="JsonObject"/>.</param> 109/// <see langword="true"/> if the <see cref="JsonObject"/> contains an element with the specified property name; otherwise, <see langword="false"/>. 122/// Gets the number of elements contained in <see cref="JsonObject"/>. 127/// Removes the element with the specified property name from the <see cref="JsonObject"/>. 150/// Determines whether the <see cref="JsonObject"/> contains a specific property name and <see cref="JsonNode"/> reference. 152/// <param name="item">The element to locate in the <see cref="JsonObject"/>.</param> 154/// <see langword="true"/> if the <see cref="JsonObject"/> contains an element with the property name; otherwise, <see langword="false"/>. 160/// Copies the elements of the <see cref="JsonObject"/> to an array of type KeyValuePair starting at the specified array index. 163/// The one-dimensional Array that is the destination of the elements copied from <see cref="JsonObject"/>. 180/// Returns an enumerator that iterates through the <see cref="JsonObject"/>. 183/// An enumerator that iterates through the <see cref="JsonObject"/>. 188/// Removes a key and value from the <see cref="JsonObject"/>. 191/// The KeyValuePair structure representing the property name and value to remove from the <see cref="JsonObject"/>. 199/// Gets a collection containing the property names in the <see cref="JsonObject"/>. 204/// Gets a collection containing the property values in the <see cref="JsonObject"/>. 217/// <see langword="true"/> if the <see cref="JsonObject"/> contains an element with the specified property name; otherwise, <see langword="false"/>. 235/// Returns an enumerator that iterates through the <see cref="JsonObject"/>. 238/// An enumerator that iterates through the <see cref="JsonObject"/>.
System\Text\Json\Nodes\JsonObject.IList.cs (1)
65/// <exception cref="ArgumentException">An element with the same key already exists in the <see cref="JsonObject"/>.</exception>
System\Text\Json\Schema\JsonSchema.cs (2)
149var objSchema = new JsonObject(); 183var properties = new JsonObject();
System\Text\Json\Serialization\Attributes\JsonExtensionDataAttribute.cs (1)
7/// When placed on a property or field of type <see cref="System.Text.Json.Nodes.JsonObject"/>,
System\Text\Json\Serialization\Converters\Node\JsonNodeConverterFactory.cs (1)
23if (typeof(JsonObject) == typeToConvert)
System\Text\Json\Serialization\Converters\Node\JsonObjectConverter.cs (10)
11internal sealed class JsonObjectConverter : JsonConverter<JsonObject?> 28Debug.Assert(obj is JsonObject); 29JsonObject jObject = (JsonObject)obj; 44internal override void WriteExtensionDataValue(Utf8JsonWriter writer, JsonObject? value, JsonSerializerOptions options) 50public override void Write(Utf8JsonWriter writer, JsonObject? value, JsonSerializerOptions options) 61public override JsonObject? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 76internal static JsonObject ReadAsJsonElement(ref Utf8JsonReader reader, JsonNodeOptions options) 82internal static JsonObject ReadAsJsonNode(ref Utf8JsonReader reader, JsonNodeOptions options) 86JsonObject jObject = new JsonObject(options);
System\Text\Json\Serialization\JsonConverterOfT.cs (1)
462Debug.Assert(Type == typeof(Nodes.JsonObject));
System\Text\Json\Serialization\JsonSerializer.Read.HandleMetadata.cs (1)
468if (jsonNode is JsonObject jsonObject)
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Converters.cs (2)
135/// Returns a <see cref="JsonConverter{T}"/> instance that converts <see cref="JsonObject"/> values. 138public static JsonConverter<JsonObject?> JsonObjectConverter => field ??= new JsonObjectConverter();
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (1)
874Debug.Assert(propValue is Nodes.JsonObject);
TestProject.AppHost (3)
TestProgram.cs (3)
174var root = new JsonObject(); 177var projectJson = new JsonObject(); 191var endpointJsonObject = new JsonObject