786 instantiations of JsonObject
aspire (71)
Utils\EnvironmentChecker\VsCodeExtensionCheck.cs (1)
221=> new()
Aspire.Cli.EndToEnd.Tests (10)
Aspire.Cli.Tests (74)
Aspire.Dashboard (3)
Aspire.Dashboard.Tests (10)
Aspire.Hosting (11)
Aspire.Hosting.Azure (16)
Aspire.Hosting.Azure.Kubernetes.Tests (49)
AzureKubernetesInfrastructureTests.cs (49)
251stateManager.SetSection("Azure", new JsonObject
256stateManager.SetSection("Azure:Deployments:aks", new JsonObject
258["Outputs"] = new JsonObject
260["id"] = new JsonObject
267["name"] = new JsonObject
273["Scope"] = new JsonObject
279stateManager.SetSection("HelmChart:aks:podinfo", new JsonObject
413stateManager.SetSection("Azure", new JsonObject
418stateManager.SetSection("Azure:Deployments:aks", new JsonObject
420["Outputs"] = new JsonObject
422["id"] = new JsonObject
427["name"] = new JsonObject
433["Scope"] = new JsonObject
439stateManager.SetSection("Helm:aks", new JsonObject
502stateManager.SetSection("Azure", new JsonObject
507stateManager.SetSection("Azure:Deployments:aks", new JsonObject
509["Outputs"] = new JsonObject
511["id"] = new JsonObject
518stateManager.SetSection("Helm:aks", new JsonObject
582stateManager.SetSection("Azure:Deployments:aks", new JsonObject
586stateManager.SetSection("Helm:aks", new JsonObject
627stateManager.SetSection("Azure:Deployments:aks", new JsonObject
629["Outputs"] = new JsonObject
631["id"] = new JsonObject
675stateManager.SetSection("Sentinel", new JsonObject { ["Value"] = "cleared-by-destroy" });
710stateManager.SetSection("Azure:Deployments:aks", new JsonObject
751stateManager.SetSection("Azure:Deployments:aks", new JsonObject
753["Outputs"] = new JsonObject
755["id"] = new JsonObject
806stateManager.SetSection("Azure:Deployments:aks", new JsonObject
808["Outputs"] = new JsonObject
810["id"] = new JsonObject
817stateManager.SetSection("Helm:aks", new JsonObject
874stateManager.SetSection("Azure:Deployments:aks", new JsonObject
876["Outputs"] = new JsonObject
878["id"] = new JsonObject
946stateManager.SetSection("Azure:Deployments:aks", new JsonObject
948["Outputs"] = new JsonObject
950["id"] = new JsonObject
1015stateManager.SetSection("Azure:Deployments:aks", new JsonObject
1017["Outputs"] = new JsonObject
1019["id"] = new JsonObject
1119deploymentStateManager.SetSection("Azure", new JsonObject
1144deploymentStateManager.SetSection("Azure", new JsonObject
1333deploymentStateManager.SetSection("Azure", new JsonObject
1433deploymentStateManager.SetSection("Azure", new JsonObject
1644deploymentStateManager.SetSection("Azure", new JsonObject
1715deploymentStateManager.SetSection("Azure", new JsonObject
1799var azureState = new JsonObject { ["SubscriptionId"] = subscriptionId };
Aspire.Hosting.Azure.Sandboxes (6)
Aspire.Hosting.Azure.Tests (90)
BicepUtilitiesTests.cs (52)
23var parameters = new JsonObject();
54.WithParameter("jsonObj", new JsonObject { ["key"] = "value" })
59var parameters = new JsonObject();
115var parameters = new JsonObject();
134.WithParameter("jsonObj", new JsonObject { ["key"] = "value" });
140.WithParameter("jsonObj", new JsonObject { ["key"] = "value" });
142var parameters0 = new JsonObject();
146var parameters1 = new JsonObject();
167.WithParameter("jsonObj", new JsonObject { ["key"] = "value" });
169var parameters0 = new JsonObject();
173var parameters1 = new JsonObject();
193var parameters0 = new JsonObject();
194var scope0 = new JsonObject();
199var parameters1 = new JsonObject();
200var scope1 = new JsonObject();
221var parameters0 = new JsonObject();
222var scope0 = new JsonObject();
227var parameters1 = new JsonObject();
228var scope1 = new JsonObject();
244var parameters = new JsonObject
246["param1"] = new JsonObject { ["value"] = "value1" }
264var parameters1 = new JsonObject
266["param1"] = new JsonObject { ["value"] = "value1" }
269var parameters2 = new JsonObject
271["param1"] = new JsonObject { ["value"] = "value2" }
289var parameters = new JsonObject
291["param1"] = new JsonObject { ["value"] = "value1" }
294var scope1 = new JsonObject { ["resourceGroup"] = "rg1" };
295var scope2 = new JsonObject { ["resourceGroup"] = "rg2" };
317var parameters1 = new JsonObject
319["param1"] = new JsonObject { ["value"] = value1 }
322var parameters2 = new JsonObject
324["param1"] = new JsonObject { ["value"] = value2 }
352var parameters = new JsonObject();
371var scope = new JsonObject();
386var scope = new JsonObject();
402var scope = new JsonObject();
417var scope = new JsonObject
436var scope = new JsonObject();
450var scope = new JsonObject();
476var stateSection = new DeploymentStateSection("test", new JsonObject
493var parameters = new JsonObject
495["param1"] = new JsonObject { ["value"] = "value1" }
498var stateSection = new DeploymentStateSection("test", new JsonObject
517var legacyParameters = new JsonObject();
523var stateSection = new DeploymentStateSection("test", new JsonObject
530var currentParameters = new JsonObject();
531var currentScope = new JsonObject();
554var parameters = new JsonObject
556[AzureBicepResource.KnownParameters.PrincipalType] = new JsonObject { ["value"] = "User" },
557[AzureBicepResource.KnownParameters.PrincipalId] = new JsonObject { ["value"] = "1234" },
560var stateSection = new DeploymentStateSection("test", new JsonObject
Aspire.Hosting.Blazor (3)
Aspire.Hosting.CodeGeneration.Java.Tests (1)
Aspire.Hosting.CodeGeneration.TypeScript (10)
Aspire.Hosting.Docker.Tests (1)
Aspire.Hosting.Kubernetes (2)
Aspire.Hosting.Kubernetes.Tests (4)
Aspire.Hosting.Radius (3)
Aspire.Hosting.RemoteHost (8)
Aspire.Hosting.RemoteHost.Tests (242)
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 },
ExternalCapabilityRegistryTests.cs (12)
36await registry.TryInvokeAsync("test.external/callback", new JsonObject { ["configure"] = "guest_callback" }, owner);
198await registry.TryInvokeAsync("test.external/callback", new JsonObject { ["configure"] = "guest_callback" }, guest.CallbackInvoker);
202new JsonObject { ["p0"] = "configured" }, TestContext.Current.CancellationToken);
211"test.external/callback", new JsonObject { ["configure"] = "late_callback" }, guest.CallbackInvoker));
270new JsonObject { ["cancellationToken"] = "ct_guest" }, cancellationToken: TestContext.Current.CancellationToken);
313await registry.TryInvokeAsync("test.external/callback", new JsonObject { ["configure"] = "guest_callback" }, guestInvoker);
327"test.external/callback", new JsonObject { ["configure"] = "guest_callback" }, guestInvoker)).Found);
372await registry.TryInvokeAsync("test.external/callback", new JsonObject { ["configure"] = "guest_callback" }, guestInvoker);
637new JsonObject { ["configure"] = "guest_callback" }, new JsonRpcCallbackInvoker(NullLogger<JsonRpcCallbackInvoker>.Instance));
674var firstArgs = new JsonObject { ["name"] = "first", ["configure"] = "guest_callback" };
675var secondArgs = new JsonObject { ["name"] = "second", ["configure"] = "guest_callback" };
726new JsonObject { ["configure"] = "guest_callback" },
Aspire.Hosting.Tests (33)
Aspire.Hosting.Yarp (4)
ConfigurationSchemaGenerator (13)
dotnet-user-jwts (7)
GenerateTemplateManifest (4)
Infrastructure.Tests (2)
Microsoft.AspNetCore.OpenApi (23)
Microsoft.Extensions.AI (4)
Microsoft.Extensions.AI.Abstractions (9)
Microsoft.Extensions.AI.Abstractions.Tests (2)
Microsoft.Extensions.AI.Evaluation.Quality (1)
Microsoft.Extensions.AI.Evaluation.Safety (13)
Microsoft.NET.Build.Containers (9)
Microsoft.NET.Build.Tasks (4)
Microsoft.NETCore.Platforms (1)
Microsoft.TemplateEngine.Cli (3)
Microsoft.TemplateEngine.Orchestrator.RunnableProjects (1)
MSBuild (8)
NuGet.Protocol (10)
SelectTests (5)
ServiceBus.AppHost (1)
Shared.Tests (1)
Stress.ApiService (1)
System.Text.Json (10)
TestProject.AppHost (3)
1777 references to JsonObject
aspire (212)
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)
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)
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)
310JsonObject packageJson;
313packageJson = JsonNode.Parse(existingContent, documentOptions: s_scaffoldJsonDocumentOptions) as JsonObject
323var scripts = EnsureJsonObject(packageJson, "scripts");
338internal static IReadOnlyList<string> AddRootTypeScriptAppHostDelegateScripts(JsonObject scripts, TypeScriptAppHostToolchain toolchain, string relativeAppHostDirectory)
349internal static IReadOnlyList<string> AddRootTypeScriptAppHostDelegateScripts(JsonObject scripts, DirectoryInfo appHostDirectory, string relativeAppHostDirectory, IEnvironment environment, ILogger? logger)
355internal static string SerializePackageJson(JsonObject packageJson, string existingContent)
385private static JsonObject EnsureJsonObject(JsonObject parent, string propertyName)
387if (parent[propertyName] is JsonObject obj)
412private static void AddRootTypeScriptAppHostDelegateScript(JsonObject scripts, TypeScriptAppHostToolchain toolchain, string relativeAppHostDirectory, string scriptName, ref List<string>? preservedScriptNames)
705private static JsonObject? ParseJsonC(string content)
709return JsonNode.Parse(content, documentOptions: s_scaffoldJsonDocumentOptions) as JsonObject;
Aspire.Cli.EndToEnd.Tests (32)
Aspire.Cli.Tests (213)
Aspire.Dashboard (13)
Aspire.Dashboard.Tests (10)
Aspire.Hosting (158)
Pipelines\Internal\DeploymentStateManagerBase.cs (19)
37private JsonObject? _state;
56JsonObject state,
58JsonObject? originalSectionData,
64protected virtual JsonNode? GetSectionState(JsonObject? state, string sectionName, bool includeLegacyState) =>
72protected async Task<JsonObject> LoadStateAsync(CancellationToken cancellationToken = default)
96protected virtual Task<JsonObject> LoadStateFromStorageAsync(CancellationToken cancellationToken = default) =>
102protected static async Task<JsonObject> LoadStateFileAsync(string? statePath, CancellationToken cancellationToken)
113protected static JsonObject LoadStateFile(string? statePath)
121private static JsonObject ParseStateFile(string? fileContent)
134if (JsonNode.Parse(fileContent, documentOptions: jsonDocumentOptions) is not JsonObject flattenedState)
143public async Task SaveStateAsync(JsonObject state, CancellationToken cancellationToken = default)
187JsonObject? data = null;
191if (sectionData is JsonObject o)
222protected static JsonNode? TryGetNestedPropertyValue(JsonObject? node, string path)
234if (current is not JsonObject currentObj || !currentObj.TryGetPropertyValue(segment, out var nextNode))
324protected static void SetNestedPropertyValue(JsonObject root, string path, JsonObject? value)
328var current = root;
332if (!current.TryGetPropertyValue(segment, out var nextNode) || nextNode is not JsonObject nextObj)
Pipelines\Internal\FileDeploymentStateManager.cs (68)
30private JsonObject _currentState = [];
31private JsonObject _legacyState = [];
32private JsonObject _legacyStateSnapshot = [];
88internal static async Task<JsonObject> LoadEffectiveStateAsync(
93JsonObject currentState;
116JsonObject legacyState = [];
138var effectiveState = MergeState(MergeState(legacyStateSnapshot, legacyState), currentState);
144internal static JsonObject LoadEffectiveState(string canonicalStatePath, string? legacyStatePath)
146JsonObject currentState;
168JsonObject legacyState = [];
187var effectiveState = MergeState(MergeState(legacyStateSnapshot, legacyState), currentState);
227protected override async Task<JsonObject> LoadStateFromStorageAsync(CancellationToken cancellationToken = default)
268protected override JsonNode? GetSectionState(JsonObject? state, string sectionName, bool includeLegacyState)
286if (mergedSection is not JsonObject mergedObject)
305JsonObject state,
307JsonObject? originalSectionData,
346var sectionData = TryGetNestedPropertyValue(state, sectionName) as JsonObject;
348var latestEffectiveState = MergeState(GetLegacyFallbackState(), _currentState);
350var latestSectionData = NormalizeSectionData(
352var desiredSectionData = ApplyChanges(latestSectionData, originalSectionData, sectionData) as JsonObject;
378private static JsonObject? NormalizeSectionData(JsonNode? sectionData) =>
381JsonObject sectionObject => sectionObject,
428private static JsonObject MergeState(JsonObject legacyState, JsonObject currentState)
430var mergedState = legacyState.DeepClone().AsObject();
434static void MergeInto(JsonObject target, JsonObject source)
438if (sourceValue is JsonObject sourceObject &&
439target[name] is JsonObject targetObject)
451private JsonObject GetLegacyFallbackState() =>
454private static async Task WriteStateAsync(string statePath, JsonObject state, CancellationToken cancellationToken)
456var flattenedSecrets = JsonFlattener.FlattenJsonObject(state);
497JsonObject currentState,
517if (baseline is JsonObject baselineObject && value is JsonObject valueObject)
547if (originalValue is JsonObject originalObject &&
548savedValue is JsonObject savedObject &&
551(latestValue is not JsonObject latestObject || !IsScalarSectionData(latestObject)))
553var result = latestValue?.DeepClone() as JsonObject ?? [];
597if (savedValue is JsonObject savedObject &&
598(originalValue is JsonObject || !originalExists) &&
600(originalValue is not JsonObject originalObject || !IsScalarSectionData(originalObject)) &&
601(latestValue is not JsonObject latestObject || !IsScalarSectionData(latestObject)))
603return (true, ApplyChanges(latestValue, originalValue as JsonObject ?? [], savedObject));
612private static bool IsScalarSectionData(JsonObject value) => value.ContainsKey(string.Empty);
618JsonObject effectiveState,
619JsonObject currentState,
639private static bool NestedPropertyExists(JsonObject root, string path)
642JsonObject current = root;
646nextNode is not JsonObject nextObject)
657private static void SetNestedNodeValue(JsonObject root, string path, JsonNode? value, bool valueExists)
660var current = root;
664if (!current.TryGetPropertyValue(segment, out var nextNode) || nextNode is not JsonObject nextObject)
702var legacyStateSnapshot = migrationState.LegacyStateSnapshot;
731var migrationState = await LoadStateFileAsync(migrationStatePath, cancellationToken).ConfigureAwait(false);
743private static MigrationState ParseMigrationState(JsonObject migrationState)
746var legacyStateSnapshot = migrationState[LegacyStateProperty] switch
749JsonObject legacyState => legacyState,
758var currentState = migrationState[CurrentStateProperty] switch
794JsonObject currentState,
795JsonObject legacyStateSnapshot,
800var migrationState = new JsonObject
814JsonObject LegacyStateSnapshot,
816JsonObject? CurrentState);
Aspire.Hosting.Azure (63)
AzureProvisioningController.cs (16)
2427var json = await CreateCommandResultJsonAsync(commandName, resourceName: null, cancellationToken).ConfigureAwait(false);
2447var json = await CreateResourceCommandResultJsonAsync(DeleteAzureResourceCommandName, model, resourceName, cancellationToken).ConfigureAwait(false);
2459private async Task<JsonObject> CreateResourceCommandResultJsonAsync(string commandName, DistributedApplicationModel model, string resourceName, CancellationToken cancellationToken)
2461var json = await CreateCommandResultJsonAsync(commandName, resourceName, cancellationToken).ConfigureAwait(false);
2481var json = await CreateCommandResultJsonAsync(GetAzureResourceCommandName, resourceName, cancellationToken).ConfigureAwait(false);
2493var deployment = await CreateCachedDeploymentStateInfoAsync(bicepResource, context, cancellationToken).ConfigureAwait(false);
2504private async Task<JsonObject> CreateCachedDeploymentStateInfoAsync(AzureBicepResource resource, AzureContextState context, CancellationToken cancellationToken)
2515var json = new JsonObject
2547private async Task<JsonObject> CreateLiveResourceInfoAsync(string? resourceId, AzureContextState context, CancellationToken cancellationToken)
2551var json = new JsonObject
2655if (outputs is not JsonObject outputsObject ||
2657outputNode is not JsonObject outputObject ||
2666private async Task<JsonObject> CreateCommandResultJsonAsync(string commandName, string? resourceName, CancellationToken cancellationToken)
2672var json = new JsonObject
2698private static CommandResultData CreateJsonResultData(JsonObject json, bool displayImmediately = false) =>
2718var json = new JsonObject
Provisioning\BicepUtilities.cs (7)
37public static async Task SetParametersAsync(JsonObject parameters, AzureBicepResource resource, DistributedApplicationExecutionContext executionContext, bool skipKnownValues = false, CancellationToken cancellationToken = default)
75public static async Task SetScopeAsync(JsonObject scope, AzureBicepResource resource, CancellationToken cancellationToken = default)
102public static string GetChecksum(AzureBicepResource resource, JsonObject parameters, JsonObject? scope)
132var parameters = JsonNode.Parse(jsonString)?.AsObject();
133var scope = section.Data[DeploymentStateScopeKey]?.GetValue<string>() is { Length: > 0 } scopeString
173private static async Task SetScopeValueAsync(JsonObject scope, string propertyName, object? value, CancellationToken cancellationToken)
Provisioning\Provisioners\BicepProvisioner.cs (12)
349JsonObject? outputs,
353if (!TryGetDeploymentStateJsonObject(stateSection, BicepUtilities.DeploymentStateParametersKey, resource.Name, out var parameters) ||
367var scope = TryGetDeploymentStateJsonObject(stateSection, BicepUtilities.DeploymentStateScopeKey, resource.Name, out var cachedScope)
469[NotNullWhen(true)] out JsonObject? value)
564var parameters = new JsonObject();
567var scope = new JsonObject();
787var outputObj = outputs?.ToObjectFromJson<JsonObject>();
1315JsonObject parameters,
1316JsonObject? outputObj,
1317JsonObject? scope,
Aspire.Hosting.Azure.Kubernetes (4)
Aspire.Hosting.Azure.Kubernetes.Tests (4)
Aspire.Hosting.Azure.Sandboxes (18)
Aspire.Hosting.Azure.Tests (102)
Aspire.Hosting.Blazor (2)
Aspire.Hosting.Browsers.Tests (1)
Aspire.Hosting.CodeGeneration.Go (3)
Aspire.Hosting.CodeGeneration.Java (3)
Aspire.Hosting.CodeGeneration.Python (3)
Aspire.Hosting.CodeGeneration.TypeScript (21)
Aspire.Hosting.CodeGeneration.TypeScript.Tests (19)
Aspire.Hosting.Docker.Tests (3)
Aspire.Hosting.Kubernetes (2)
Aspire.Hosting.Kubernetes.Tests (3)
Aspire.Hosting.Radius (4)
Aspire.Hosting.RemoteHost (60)
Ats\AtsCallbackProxyFactory.cs (16)
135var jsonObjectType = typeof(JsonObject);
195argsExpr ?? Expression.Constant(null, typeof(JsonObject)),
210argsExpr ?? Expression.Constant(null, typeof(JsonObject)),
225argsExpr ?? Expression.Constant(null, typeof(JsonObject)),
240argsExpr ?? Expression.Constant(null, typeof(JsonObject)),
245private void InvokeSyncVoid(string callbackId, JsonObject? args, CancellationToken cancellationToken, int ctParamIndex)
251private void InvokeSyncVoidWithDtoWriteback(string callbackId, JsonObject? args, object?[] originalArgs, Type[] argTypes, CancellationToken cancellationToken, int ctParamIndex)
258private T? InvokeSyncResult<T>(string callbackId, JsonObject? args, CancellationToken cancellationToken, int ctParamIndex)
265private async Task InvokeAsyncVoid(string callbackId, JsonObject? args, CancellationToken cancellationToken, int ctParamIndex)
271private async Task InvokeAsyncVoidWithDtoWriteback(string callbackId, JsonObject? args, object?[] originalArgs, Type[] argTypes, CancellationToken cancellationToken, int ctParamIndex)
278private async Task<T?> InvokeAsyncResult<T>(string callbackId, JsonObject? args, CancellationToken cancellationToken, int ctParamIndex)
301private void AddCancellationTokenToArgs(ref JsonObject? args, CancellationToken cancellationToken, int ctParamIndex)
334argsExpr ?? Expression.Constant(null, typeof(JsonObject)),
353argsExpr ?? Expression.Constant(null, typeof(JsonObject)),
384if (result is not JsonObject returnedArgs)
412if (returnedArgs[key] is JsonObject modifiedDto)
Ats\CapabilityDispatcher.cs (15)
22JsonObject? args,
546string capabilityId, JsonObject? args, JsonRpcCallbackInvoker? ownerInvoker = null, CancellationToken cancellationToken = default)
650public JsonNode? Invoke(string capabilityId, JsonObject? args)
783JsonObject? args,
826JsonObject? args,
984JsonObject obj when obj.ContainsKey("$handle") => "handle",
985JsonObject => "object",
993JsonObject? args,
1055public static string GetRequiredString(this JsonObject args, string name, string capabilityId)
1069public static string? GetOptionalString(this JsonObject args, string name)
1081public static int? GetOptionalInt(this JsonObject args, string name)
1094this JsonObject args,
1124public static T? GetDto<T>(this JsonObject args, string name) where T : class
1126if (args.TryGetPropertyValue(name, out var node) && node is JsonObject obj)
1136public static JsonObject CreateHandleResult(this HandleRegistry handles, object obj, string typeId)
Ats\ExternalCapabilityRegistry.cs (5)
445string capabilityId, JsonObject? args, JsonRpcCallbackInvoker? ownerInvoker = null, CancellationToken cancellationToken = default)
467var forwardedArgs = args?.DeepClone().AsObject();
552internal async Task<JsonNode?> InvokeGuestCallbackAsync(JsonRpc host, string callbackId, JsonObject? args, CancellationToken cancellationToken)
598internal CancellationToken[] GetCancellationTokens(string capabilityId, JsonObject? args, AtsMarshaller marshaller)
634private void RegisterCallbackOwners(ExternalCapabilityRegistration registration, JsonObject? args, JsonRpcCallbackInvoker? ownerInvoker, string invocationId)
Aspire.Hosting.RemoteHost.Tests (200)
TestServices\IntegrationHostTestConnection.cs (5)
22public IntegrationHostTestConnection(JsonElement capabilities, Func<string, JsonObject?, Task<JsonNode?>> handleCapability)
27public IntegrationHostTestConnection(JsonElement capabilities, Func<string, JsonObject?, CancellationToken, Task<JsonNode?>> invokeCallback)
39Func<string, JsonObject?, Task<JsonNode?>>? handleCapability,
40Func<string, JsonObject?, CancellationToken, Task<JsonNode?>>? invokeCallback)
52(string capabilityId, JsonObject? args, string invocationId) =>
Aspire.Hosting.Tests (32)
Aspire.Hosting.TestUtilities (1)
Aspire.Hosting.Yarp (5)
Aspire.Tray.Tests (1)
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)
GenerateTemplateManifest (6)
Infrastructure.Tests (32)
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)
Microsoft.AspNetCore.JsonPatch.SystemTextJson (13)
Microsoft.AspNetCore.OpenApi (10)
Microsoft.Extensions.AI (4)
Microsoft.Extensions.AI.Abstractions (29)
Microsoft.Extensions.AI.Abstractions.Tests (8)
Microsoft.Extensions.AI.Evaluation.Safety (9)
Microsoft.Extensions.AI.OpenAI (2)
Microsoft.ML.AutoML (1)
Microsoft.ML.AutoML.SourceGenerator (1)
Microsoft.NET.Build.Containers (16)
Microsoft.NET.Build.Tasks (12)
Microsoft.NETCore.Platforms (1)
Microsoft.TemplateEngine.Cli (23)
Microsoft.TemplateEngine.Edge (59)
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)
507/// Tries to get a property value from a <see cref="JsonObject"/> using case-insensitive key matching.
509internal static bool TryGetValueCaseInsensitive(this JsonObject obj, string key, out JsonNode? result)
519internal static JsonNode? GetPropertyCaseInsensitive(JsonObject obj, string key)
552private static JsonNode? GetPropertyCaseInsensitiveViaDocument(JsonObject obj, string key)
580internal static JsonObject ParseJsonObject(string json)
582return (JsonObject?)JsonNode.Parse(json, null, DocOptions)
602internal static JsonObject FromObject(object obj)
605return (JsonObject?)JsonNode.Parse(json, null, DocOptions)
610/// Creates a deep clone of a <see cref="JsonObject"/> by round-tripping through JSON text.
612internal static JsonObject DeepCloneObject(this JsonObject source)
614return (JsonObject?)JsonNode.Parse(source.ToJsonString(), null, DocOptions)
625internal static void Merge(this JsonObject target, JsonObject source)
629if (property.Value is JsonObject sourceObj
631&& targetNode is JsonObject targetObj)
Settings\TemplateCache.cs (6)
63(string, JsonObject?)? hostFile = GetBestHostConfigMatch(chosenTemplate.Template, environmentSettings, chosenTemplate.MountPoint);
76public TemplateCache(JsonObject? contentJObject)
97if (contentJObject.TryGetValueCaseInsensitive(nameof(MountPointsInfo), out JsonNode? mountPointInfoToken) && mountPointInfoToken is JsonObject mountPointInfoObj)
116if (entry is JsonObject entryObj)
286private (string, JsonObject?)? GetBestHostConfigMatch(IScanTemplateInfo newTemplate, IEngineEnvironmentSettings settings, IMountPoint mountPoint)
303private JsonObject? ReadHostFile(IScanTemplateInfo template, string path, IEngineEnvironmentSettings settings, IMountPoint mountPoint)
Microsoft.TemplateEngine.Orchestrator.RunnableProjects (103)
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)
507/// Tries to get a property value from a <see cref="JsonObject"/> using case-insensitive key matching.
509internal static bool TryGetValueCaseInsensitive(this JsonObject obj, string key, out JsonNode? result)
519internal static JsonNode? GetPropertyCaseInsensitive(JsonObject obj, string key)
552private static JsonNode? GetPropertyCaseInsensitiveViaDocument(JsonObject obj, string key)
580internal static JsonObject ParseJsonObject(string json)
582return (JsonObject?)JsonNode.Parse(json, null, DocOptions)
602internal static JsonObject FromObject(object obj)
605return (JsonObject?)JsonNode.Parse(json, null, DocOptions)
610/// Creates a deep clone of a <see cref="JsonObject"/> by round-tripping through JSON text.
612internal static JsonObject DeepCloneObject(this JsonObject source)
614return (JsonObject?)JsonNode.Parse(source.ToJsonString(), null, DocOptions)
625internal static void Merge(this JsonObject target, JsonObject source)
629if (property.Value is JsonObject sourceObj
631&& targetNode is JsonObject targetObj)
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)
507/// Tries to get a property value from a <see cref="JsonObject"/> using case-insensitive key matching.
509internal static bool TryGetValueCaseInsensitive(this JsonObject obj, string key, out JsonNode? result)
519internal static JsonNode? GetPropertyCaseInsensitive(JsonObject obj, string key)
552private static JsonNode? GetPropertyCaseInsensitiveViaDocument(JsonObject obj, string key)
580internal static JsonObject ParseJsonObject(string json)
582return (JsonObject?)JsonNode.Parse(json, null, DocOptions)
602internal static JsonObject FromObject(object obj)
605return (JsonObject?)JsonNode.Parse(json, null, DocOptions)
610/// Creates a deep clone of a <see cref="JsonObject"/> by round-tripping through JSON text.
612internal static JsonObject DeepCloneObject(this JsonObject source)
614return (JsonObject?)JsonNode.Parse(source.ToJsonString(), null, DocOptions)
625internal static void Merge(this JsonObject target, JsonObject source)
629if (property.Value is JsonObject sourceObj
631&& 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)
507/// Tries to get a property value from a <see cref="JsonObject"/> using case-insensitive key matching.
509internal static bool TryGetValueCaseInsensitive(this JsonObject obj, string key, out JsonNode? result)
519internal static JsonNode? GetPropertyCaseInsensitive(JsonObject obj, string key)
552private static JsonNode? GetPropertyCaseInsensitiveViaDocument(JsonObject obj, string key)
580internal static JsonObject ParseJsonObject(string json)
582return (JsonObject?)JsonNode.Parse(json, null, DocOptions)
602internal static JsonObject FromObject(object obj)
605return (JsonObject?)JsonNode.Parse(json, null, DocOptions)
610/// Creates a deep clone of a <see cref="JsonObject"/> by round-tripping through JSON text.
612internal static JsonObject DeepCloneObject(this JsonObject source)
614return (JsonObject?)JsonNode.Parse(source.ToJsonString(), null, DocOptions)
625internal static void Merge(this JsonObject target, JsonObject source)
629if (property.Value is JsonObject sourceObj
631&& targetNode is JsonObject targetObj)
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)
MSBuild (5)
NuGet.Protocol (11)
sdk-tasks (6)
SelectTests (2)
Shared.Tests (2)
System.Text.Json (81)
TestProject.AppHost (3)