462 instantiations of JsonObject
aspire (35)
Aspire.Cli.EndToEnd.Tests (1)
Aspire.Cli.Tests (37)
Aspire.Dashboard (15)
Aspire.Dashboard.Tests (9)
Aspire.Hosting (5)
Aspire.Hosting.Azure (4)
Aspire.Hosting.Azure.Tests (48)
Aspire.Hosting.Foundry (1)
Aspire.Hosting.RemoteHost (8)
Aspire.Hosting.RemoteHost.Tests (170)
CapabilityDispatcherTests.cs (94)
73dispatcher.Invoke("test/capability@1", new JsonObject { ["name"] = "test-value" });
168var args = new JsonObject { ["value"] = "hello" };
180var args = new JsonObject { ["required"] = "test" };
192var args = new JsonObject { ["required"] = "test", ["optional"] = "custom" };
233var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } };
260var args = new JsonObject { ["context"] = "not-a-handle" };
272var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = "Aspire.Hosting.RemoteHost.Tests/Aspire.Hosting.RemoteHost.Tests.TestContextType:999" } };
289var getArgs = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } };
296var invokeArgs = new JsonObject { ["cancellationToken"] = tokenResult };
349var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } };
368var nestedArgs = new JsonObject { ["context"] = new JsonObject { ["$handle"] = nestedHandleId } };
426var args = new JsonObject
428["context"] = new JsonObject { ["$handle"] = handleId },
447var args = new JsonObject
449["context"] = new JsonObject { ["$handle"] = handleId },
466var args = new JsonObject
468["context"] = new JsonObject { ["$handle"] = handleId },
485var args = new JsonObject
487["context"] = new JsonObject { ["$handle"] = handleId }
518var args = new JsonObject
520["context"] = new JsonObject { ["$handle"] = handleId }
536var args = new JsonObject
538["context"] = new JsonObject { ["$handle"] = handleId },
557var args = new JsonObject
559["context"] = new JsonObject { ["$handle"] = handleId },
577var args = new JsonObject
579["context"] = new JsonObject { ["$handle"] = handleId },
593var args = new JsonObject { ["value"] = "value-task" };
634var args = new JsonObject
657var args = new JsonObject
678var args = new JsonObject
701var args = new JsonObject
769var args = new JsonObject
797var args = new JsonObject { ["value"] = "test" };
808var args = new JsonObject { ["value"] = "hello" };
820var args = new JsonObject { ["value"] = "test" };
834var args = new JsonObject
849var args = new JsonObject { ["count"] = 3 };
866var args = new JsonObject
882var args = new JsonObject { ["value"] = "hello" };
894var args = new JsonObject { ["value"] = 42 };
930var args = new JsonObject
932["list"] = new JsonObject { ["$handle"] = listHandle },
954var removeArgs = new JsonObject
956["list"] = new JsonObject { ["$handle"] = listHandle },
965var lengthArgs = new JsonObject
967["list"] = new JsonObject { ["$handle"] = listHandle }
986var args = new JsonObject
988["list"] = new JsonObject { ["$handle"] = listHandle }
1009var clearArgs = new JsonObject
1011["list"] = new JsonObject { ["$handle"] = listHandle }
1016var lengthArgs = new JsonObject
1018["list"] = new JsonObject { ["$handle"] = listHandle }
1054var args = new JsonObject
1056["dict"] = new JsonObject { ["$handle"] = dictHandle },
1078var removeArgs = new JsonObject
1080["dict"] = new JsonObject { ["$handle"] = dictHandle },
1089var countArgs = new JsonObject
1091["dict"] = new JsonObject { ["$handle"] = dictHandle }
1111var hasArgs = new JsonObject
1113["dict"] = new JsonObject { ["$handle"] = dictHandle },
1122var hasArgs2 = new JsonObject
1124["dict"] = new JsonObject { ["$handle"] = dictHandle },
1144var args = new JsonObject
1146["dict"] = new JsonObject { ["$handle"] = dictHandle }
1170var args = new JsonObject
1172["dict"] = new JsonObject { ["$handle"] = dictHandle }
1187var args = new JsonObject
1204var args = new JsonObject
1221var args = new JsonObject
1238var args = new JsonObject
1255var result = dispatcher.Invoke("Aspire.Hosting.RemoteHost.Tests/acceptOptionalEnum", new JsonObject());
1264var args = new JsonObject
1266["dto"] = new JsonObject
1283var args = new JsonObject
1285["dto"] = new JsonObject
1301var args = new JsonObject();
1323var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } };
1341var args = new JsonObject
1343["context"] = new JsonObject { ["$handle"] = handleId },
1361var args = new JsonObject
1363["context"] = new JsonObject { ["$handle"] = handleId },
1382var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } };
1399var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } };
1414var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } };
Aspire.Hosting.Tests (21)
Aspire.Hosting.Yarp (4)
ConfigurationSchemaGenerator (13)
dotnet-user-jwts (5)
Microsoft.AspNetCore.JsonPatch.SystemTextJson.Tests (15)
JsonPatchDocumentJObjectTest.cs (6)
48var model = new ObjectWithJObject { CustomData = new JsonObject([new("Email", "foo@bar.com"), new("Name", "Bar")]) };
65var model = new ObjectWithJObject { CustomData = new JsonObject([new("Email", "foo@bar.com")]) };
81var model = new ObjectWithJObject { CustomData = new JsonObject([new("FirstName", "Bar"), new("LastName", "Bar")]) };
97var model = new ObjectWithJObject { CustomData = new JsonObject([new("FirstName", "Bar")]) };
147var model = new ObjectWithJObject { CustomData = new JsonObject([new("Email", "foo@bar.com"), new("Name", "Bar")]) };
163var model = new ObjectWithJObject { CustomData = new JsonObject([new("Email", "foo@bar.com"), new("Name", "Bar")]) };
Microsoft.AspNetCore.OpenApi (23)
Microsoft.AspNetCore.OpenApi.Tests (2)
Microsoft.DotNet.Internal.SymbolHelper (3)
Microsoft.Extensions.AI (2)
Microsoft.Extensions.AI.Abstractions (9)
Microsoft.Extensions.AI.Abstractions.Tests (2)
Microsoft.Extensions.AI.Evaluation.Quality (1)
Microsoft.Extensions.AI.Evaluation.Safety (13)
ServiceBus.AppHost (1)
Shared.Tests (1)
Stress.ApiService (1)
System.Text.Json (10)
TestProject.AppHost (3)
793 references to JsonObject
aspire (107)
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 (14)
17JsonObject settings;
58var settings = JsonNode.Parse(existingContent, nodeOptions: null, ConfigurationHelper.ParseOptions)?.AsObject();
165var settings = JsonNode.Parse(content, nodeOptions: null, ConfigurationHelper.ParseOptions)?.AsObject();
183private static void SetNestedValue(JsonObject settings, string key, string value)
196var currentObject = settings;
204if (!currentObject.ContainsKey(part) || currentObject[part] is not JsonObject)
221private static void RemoveConflictingFlattenedKeys(JsonObject settings, string[] keyParts)
234if (settings.ContainsKey(partialKey) && settings[partialKey] is not JsonObject)
246private static bool DeleteNestedValue(JsonObject settings, string key)
257var currentObject = settings;
258var objectPath = new List<(JsonObject obj, string key)>();
266if (!currentObject.ContainsKey(part) || currentObject[part] is not JsonObject)
308private static void FlattenJsonObject(JsonObject obj, Dictionary<string, string> result, string prefix)
316if (kvp.Value is JsonObject nestedObj)
Aspire.Cli.EndToEnd.Tests (3)
Aspire.Cli.Tests (102)
Aspire.Dashboard (25)
Aspire.Dashboard.Tests (4)
Aspire.Hosting (50)
Aspire.Hosting.Azure (16)
Aspire.Hosting.Azure.Tests (34)
Aspire.Hosting.Foundry (2)
Aspire.Hosting.RemoteHost (39)
Ats\AtsCallbackProxyFactory.cs (16)
128var jsonObjectType = typeof(JsonObject);
187argsExpr ?? Expression.Constant(null, typeof(JsonObject)),
202argsExpr ?? Expression.Constant(null, typeof(JsonObject)),
217argsExpr ?? Expression.Constant(null, typeof(JsonObject)),
232argsExpr ?? Expression.Constant(null, typeof(JsonObject)),
237private void InvokeSyncVoid(string callbackId, JsonObject? args, CancellationToken cancellationToken, int ctParamIndex)
243private void InvokeSyncVoidWithDtoWriteback(string callbackId, JsonObject? args, object?[] originalArgs, Type[] argTypes, CancellationToken cancellationToken, int ctParamIndex)
250private T? InvokeSyncResult<T>(string callbackId, JsonObject? args, CancellationToken cancellationToken, int ctParamIndex)
257private async Task InvokeAsyncVoid(string callbackId, JsonObject? args, CancellationToken cancellationToken, int ctParamIndex)
263private async Task InvokeAsyncVoidWithDtoWriteback(string callbackId, JsonObject? args, object?[] originalArgs, Type[] argTypes, CancellationToken cancellationToken, int ctParamIndex)
270private async Task<T?> InvokeAsyncResult<T>(string callbackId, JsonObject? args, CancellationToken cancellationToken, int ctParamIndex)
293private void AddCancellationTokenToArgs(ref JsonObject? args, CancellationToken cancellationToken, int ctParamIndex)
326argsExpr ?? Expression.Constant(null, typeof(JsonObject)),
345argsExpr ?? Expression.Constant(null, typeof(JsonObject)),
376if (result is not JsonObject returnedArgs)
404if (returnedArgs[key] is JsonObject modifiedDto)
Ats\CapabilityDispatcher.cs (10)
20JsonObject? args,
412public async Task<JsonNode?> InvokeAsync(string capabilityId, JsonObject? args)
455public JsonNode? Invoke(string capabilityId, JsonObject? args)
602public static string GetRequiredString(this JsonObject args, string name, string capabilityId)
616public static string? GetOptionalString(this JsonObject args, string name)
628public static int? GetOptionalInt(this JsonObject args, string name)
641this JsonObject args,
671public static T? GetDto<T>(this JsonObject args, string name) where T : class
673if (args.TryGetPropertyValue(name, out var node) && node is JsonObject obj)
683public static JsonObject CreateHandleResult(this HandleRegistry handles, object obj, string typeId)
Aspire.Hosting.RemoteHost.Tests (142)
Aspire.Hosting.Tests (23)
Aspire.Hosting.Yarp (5)
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 (11)
IdentitySample.PasskeyConformance (1)
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (18)
Microsoft.AspNetCore.Identity.Test (10)
Microsoft.AspNetCore.JsonPatch.SystemTextJson (13)
Microsoft.AspNetCore.JsonPatch.SystemTextJson.Tests (5)
Microsoft.AspNetCore.OpenApi (9)
Microsoft.AspNetCore.OpenApi.Tests (3)
Microsoft.DotNet.Internal.SymbolHelper (4)
Microsoft.Extensions.AI (2)
Microsoft.Extensions.AI.Abstractions (29)
Microsoft.Extensions.AI.Abstractions.Tests (8)
Microsoft.Extensions.AI.Evaluation.Safety (9)
Microsoft.Extensions.AI.OpenAI (1)
Microsoft.ML.AutoML (1)
Microsoft.ML.AutoML.SourceGenerator (1)
Microsoft.ML.GenAI.Mistral (2)
Roslyn.VisualStudio.Next.UnitTests (2)
Shared.Tests (2)
System.Text.Json (82)
System.Windows.Forms.Analyzers.Tests (2)
TestProject.AppHost (3)