449 instantiations of JsonObject
aspire (33)
Agents\ClaudeCode\ClaudeCodeAgentEnvironmentScanner.cs (2)
221config["mcpServers"] = new JsonObject(); 227servers[AspireServerName] = new JsonObject
Agents\CopilotCli\CopilotCliAgentEnvironmentScanner.cs (3)
217config["mcpServers"] = new JsonObject(); 223servers[AspireServerName] = new JsonObject 228["env"] = new JsonObject
Agents\McpConfigFileHelper.cs (2)
72return new JsonObject(); 84return JsonNode.Parse(content)?.AsObject() ?? new JsonObject();
Agents\OpenCode\OpenCodeAgentEnvironmentScanner.cs (2)
211config["mcp"] = new JsonObject(); 217mcp[AspireServerName] = new JsonObject
Agents\VsCode\VsCodeAgentEnvironmentScanner.cs (2)
261config["servers"] = new JsonObject(); 267servers[AspireServerName] = new JsonObject
Commands\SecretListCommand.cs (1)
60var obj = new JsonObject();
Configuration\ConfigurationService.cs (4)
24? new JsonObject() 25: JsonNode.Parse(existingContent)?.AsObject() ?? new JsonObject(); 29settings = new JsonObject(); 192currentObject[part] = 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();
src\Shared\ConsoleLogs\SharedAIHelpers.cs (7)
218var attributesObj = new JsonObject(); 231var linkObjects = span.Links.Select(link => (JsonNode)new JsonObject 249var spanObj = new JsonObject 274var traceData = new JsonObject 584var attributesObject = new JsonObject(); 592var log = new JsonObject 615return 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)
87var obj = new JsonObject();
Utils\ConfigurationHelper.cs (1)
145currentObject[part] = new JsonObject();
Aspire.Cli.Tests (52)
Agents\CopilotCliAgentEnvironmentScannerTests.cs (6)
100var existingConfig = new JsonObject 102["mcpServers"] = new JsonObject 104["other-server"] = new JsonObject 140var existingConfig = new JsonObject 142["mcpServers"] = new JsonObject 144["aspire"] = new JsonObject
Agents\NpmProvenanceCheckerTests.cs (15)
85var statement = new JsonObject 89["predicate"] = new JsonObject 91["buildDefinition"] = new JsonObject 93["externalParameters"] = new JsonObject() 216var statement = new JsonObject 220["predicate"] = new JsonObject 222["buildDefinition"] = new JsonObject 225["externalParameters"] = new JsonObject 227["workflow"] = new JsonObject 235["runDetails"] = new JsonObject 237["builder"] = new JsonObject 247var attestationResponse = new JsonObject 251new JsonObject 254["bundle"] = new JsonObject 256["dsseEnvelope"] = new 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
Projects\ProjectUpdaterTests.cs (25)
71var itemsAndProperties = new JsonObject(); 182var itemsAndProperties = new JsonObject(); 320var itemsAndProperties = new JsonObject(); 463var itemsAndProperties = new JsonObject(); 624var itemsAndProperties = new JsonObject(); 742var itemsAndProperties = new JsonObject(); 844var itemsAndProperties = new JsonObject(); 977var itemsAndProperties = new JsonObject(); 1094var itemsAndProperties = new JsonObject(); 1214var itemsAndProperties = new JsonObject(); 1327var itemsAndProperties = new JsonObject(); 1694var itemsAndProperties = new JsonObject(); 1776var itemsAndProperties = new JsonObject(); 1859var itemsAndProperties = new JsonObject(); 1940var itemsAndProperties = new JsonObject(); 2029var itemsAndProperties = new JsonObject(); 2108var itemsAndProperties = new JsonObject(); 2188var itemsAndProperties = new JsonObject(); 2315var itemsAndProperties = new JsonObject(); 2615JsonObject properties = new JsonObject(); 2627JsonObject items = new JsonObject(); 2655JsonObject newPackageReference = new JsonObject 2671JsonObject newPackageReference = new JsonObject 2687JsonObject newProjectReference = new JsonObject 2698JsonObject properties = new JsonObject();
Aspire.Dashboard (15)
Model\Assistant\AIHelpers.cs (6)
65var urlObj = new JsonObject 80healthReportsArray.Add(new JsonObject 88var healthObj = new JsonObject 97commandsArray.Add(new JsonObject 104var resourceObj = new JsonObject 150relationships.Add(new JsonObject
Model\GenAI\GenAIItemPartViewModel.cs (1)
96var jsonObject = new JsonObject();
Otlp\Model\OtlpHelpers.cs (1)
146var o = new JsonObject();
src\Shared\ConsoleLogs\SharedAIHelpers.cs (7)
218var attributesObj = new JsonObject(); 231var linkObjects = span.Links.Select(link => (JsonNode)new JsonObject 249var spanObj = new JsonObject 274var traceData = new JsonObject 584var attributesObject = new JsonObject(); 592var log = new JsonObject 615return new JsonObject
Aspire.Dashboard.Tests (9)
Integration\OtlpGrpcServiceTests.cs (6)
164var configJson = new JsonObject 166["Dashboard"] = new JsonObject 168["Otlp"] = new JsonObject 206configJson = new JsonObject 208["Dashboard"] = new JsonObject 210["Otlp"] = new JsonObject
Integration\StartupTests.cs (3)
635var configJson = new JsonObject 637["Logging"] = new JsonObject 639["LogLevel"] = new JsonObject
Aspire.Hosting (7)
Ats\AtsError.cs (2)
45var obj = new JsonObject 96var obj = new JsonObject();
Pipelines\Internal\DeploymentStateManagerBase.cs (1)
295nextObj = new JsonObject();
Pipelines\Internal\JsonFlattener.cs (3)
21var result = new JsonObject(); 34var result = new JsonObject(); 46var newObject = new JsonObject();
UserSecrets\UserSecretsManagerFactory.cs (1)
180var contents = new JsonObject();
Aspire.Hosting.Azure (4)
Provisioning\BicepUtilities.cs (1)
45parameters[parameter.Key] = new JsonObject()
Provisioning\JsonExtensions.cs (1)
22node = new JsonObject();
Provisioning\Provisioners\BicepProvisioner.cs (2)
163var parameters = new JsonObject(); 166var scope = new JsonObject();
Aspire.Hosting.Azure.Tests (48)
AzureBicepResourceTests.cs (1)
185.WithParameter("param3", new JsonObject() { ["value"] = "nested" })
AzureDeployerTests.cs (1)
1430var cachedState = new JsonObject
AzureEventHubsExtensionsTests.cs (1)
398document["UserConfig"]!["LoggingConfig"] = new JsonObject { ["Type"] = "Console" };
AzureServiceBusExtensionsTests.cs (1)
510document["UserConfig"]!["Logging"] = new JsonObject { ["Type"] = "Console" };
BicepUtilitiesTests.cs (40)
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(); 339var scope = new JsonObject(); 357var scope = new JsonObject(); 411var parameters = new JsonObject 413["param1"] = new JsonObject { ["value"] = "value1" } 445var parameters = new JsonObject 447[AzureBicepResource.KnownParameters.PrincipalType] = new JsonObject { ["value"] = "User" }, 448[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)
618: new JsonObject();
Aspire.Hosting.RemoteHost.Tests (136)
AtsMarshallerTests.cs (15)
233var json = new JsonObject { ["$handle"] = handleId }; 245var json = new JsonObject { ["$handle"] = "aspire/Unknown:999" }; 281var json = new JsonObject { ["key1"] = 1, ["key2"] = 2 }; 523var json = new JsonObject { ["a"] = 1, ["b"] = 2 }; 536var json = new JsonObject { ["value"] = 42 }; 549var json = new JsonObject { ["name"] = "test", ["count"] = 5 }; 714var source = new JsonObject { ["name"] = "updated", ["count"] = 42 }; 727var source = new JsonObject { ["name"] = "updated" }; 740var source = new JsonObject 743["complex"] = new JsonObject { ["value"] = "should-be-ignored" } 757var source = new JsonObject { ["display_name"] = "updated", ["val"] = 99 }; 771var source = new JsonObject { ["displayName"] = "should-not-apply" }; 783var source = new JsonObject { ["name"] = "updated", ["secret"] = "should-be-ignored" }; 796var source = new JsonObject { ["name"] = "updated", ["computed"] = "should-be-ignored" }; 810var source = new JsonObject { ["count"] = "not-a-number" };
CallbackProxyTests.cs (9)
234ResultToReturn = new JsonObject 236["p0"] = new JsonObject { ["name"] = "modified", ["count"] = 42 } 256ResultToReturn = new JsonObject 258["p0"] = new JsonObject { ["name"] = "async-modified", ["count"] = 99 } 280ResultToReturn = new JsonObject 283["p1"] = new JsonObject { ["name"] = "mixed-modified", ["count"] = 77 } 323ResultToReturn = new JsonObject 325["p0"] = new JsonObject { ["name"] = "first-updated", ["count"] = 10 }, 326["p1"] = new JsonObject { ["name"] = "second-updated", ["count"] = 20 }
CapabilityDispatcherTests.cs (88)
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" } }; 326var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } }; 345var nestedArgs = new JsonObject { ["context"] = new JsonObject { ["$handle"] = nestedHandleId } }; 403var args = new JsonObject 405["context"] = new JsonObject { ["$handle"] = handleId }, 424var args = new JsonObject 426["context"] = new JsonObject { ["$handle"] = handleId }, 443var args = new JsonObject 445["context"] = new JsonObject { ["$handle"] = handleId }, 462var args = new JsonObject 464["context"] = new JsonObject { ["$handle"] = handleId } 495var args = new JsonObject 497["context"] = new JsonObject { ["$handle"] = handleId } 513var args = new JsonObject 515["context"] = new JsonObject { ["$handle"] = handleId }, 534var args = new JsonObject 536["context"] = new JsonObject { ["$handle"] = handleId }, 579var args = new JsonObject 602var args = new JsonObject 623var args = new JsonObject 646var args = new JsonObject 665var args = new JsonObject 693var args = new JsonObject { ["value"] = "test" }; 704var args = new JsonObject { ["value"] = "hello" }; 716var args = new JsonObject { ["value"] = "test" }; 730var args = new JsonObject 745var args = new JsonObject { ["count"] = 3 }; 762var args = new JsonObject 778var args = new JsonObject { ["value"] = "hello" }; 790var args = new JsonObject { ["value"] = 42 }; 826var args = new JsonObject 828["list"] = new JsonObject { ["$handle"] = listHandle }, 850var removeArgs = new JsonObject 852["list"] = new JsonObject { ["$handle"] = listHandle }, 861var lengthArgs = new JsonObject 863["list"] = new JsonObject { ["$handle"] = listHandle } 882var args = new JsonObject 884["list"] = new JsonObject { ["$handle"] = listHandle } 905var clearArgs = new JsonObject 907["list"] = new JsonObject { ["$handle"] = listHandle } 912var lengthArgs = new JsonObject 914["list"] = new JsonObject { ["$handle"] = listHandle } 950var args = new JsonObject 952["dict"] = new JsonObject { ["$handle"] = dictHandle }, 974var removeArgs = new JsonObject 976["dict"] = new JsonObject { ["$handle"] = dictHandle }, 985var countArgs = new JsonObject 987["dict"] = new JsonObject { ["$handle"] = dictHandle } 1007var hasArgs = new JsonObject 1009["dict"] = new JsonObject { ["$handle"] = dictHandle }, 1018var hasArgs2 = new JsonObject 1020["dict"] = new JsonObject { ["$handle"] = dictHandle }, 1040var args = new JsonObject 1042["dict"] = new JsonObject { ["$handle"] = dictHandle } 1066var args = new JsonObject 1068["dict"] = new JsonObject { ["$handle"] = dictHandle } 1083var args = new JsonObject 1100var args = new JsonObject 1117var args = new JsonObject 1134var args = new JsonObject 1151var result = dispatcher.Invoke("Aspire.Hosting.RemoteHost.Tests/acceptOptionalEnum", new JsonObject()); 1160var args = new JsonObject 1162["dto"] = new JsonObject 1179var args = new JsonObject 1181["dto"] = new JsonObject 1197var args = new JsonObject(); 1219var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } }; 1237var args = new JsonObject 1239["context"] = new JsonObject { ["$handle"] = handleId }, 1257var args = new JsonObject 1259["context"] = new JsonObject { ["$handle"] = handleId }, 1278var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } }; 1295var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } }; 1310var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } };
HandleRegistryTests.cs (7)
246var json = new JsonObject { ["$handle"] = "42" }; 275var json = new JsonObject { ["name"] = "test", ["value"] = 42 }; 285var json = new JsonObject { ["$handle"] = 42 }; 294var json = new JsonObject 310var json = new JsonObject { ["$handle"] = "1" }; 332var json = new JsonObject { ["name"] = "test" }; 341var json = new JsonObject { ["$handle"] = 42 };
ReferenceExpressionRefTests.cs (17)
18var json = new JsonObject 20["$expr"] = new JsonObject 39var json = new JsonObject 41["$expr"] = new JsonObject 46new JsonObject { ["$handle"] = "aspire/EndpointReference:1" }, 47new JsonObject { ["$handle"] = "aspire/EndpointReference:2" } 66var json = new JsonObject 92var json = new JsonObject 94["$expr"] = new JsonObject { ["format"] = "test" } 105var json = new JsonObject { ["format"] = "test" }; 138new JsonObject { ["$handle"] = handle1 }, 139new JsonObject { ["$handle"] = handle2 } 159new JsonObject { ["$handle"] = "aspire/NonExistent:999" } 198new JsonObject { ["$handle"] = handle }, 219new JsonObject { ["invalid"] = "not-a-handle" } // Invalid format (not a handle or string) 237var json = new JsonObject 239["$expr"] = new JsonObject
Aspire.Hosting.Tests (21)
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 (1)
208var state = 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();
aspire-server (6)
Ats\AtsCallbackProxyFactory.cs (1)
294args ??= new JsonObject();
Ats\CapabilityDispatcher.cs (2)
227return Task.FromResult<JsonNode?>(new JsonObject 483args ??= new JsonObject();
Ats\HandleRegistry.cs (1)
148return new JsonObject
RemoteAppHostService.cs (2)
89return new JsonObject 104return 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 (5)
Helpers\JwtAuthenticationSchemeSettings.cs (4)
22var settingsObject = new JsonObject 38authentication.Add(SchemesKey, new JsonObject 46config[AuthenticationKey] = new JsonObject 48[SchemesKey] = new JsonObject
Helpers\SigningKeysHandler.cs (1)
75secrets ??= new JsonObject();
Microsoft.AspNetCore.JsonPatch.SystemTextJson.Tests (15)
IntegrationTests\AnonymousObjectIntegrationTest.cs (8)
171var doc = new JsonObject 173["data"] = new JsonObject 178new JsonObject 182new JsonObject { ["id"] = 100 }, 183new JsonObject 187new JsonObject { ["value"] = "old" }, 188new JsonObject { ["value"] = "target" }, 189new JsonObject { ["value"] = 999 }
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")]) };
TestObjectModels\ObjectWithJObject.cs (1)
10public JsonObject CustomData { get; set; } = new JsonObject();
Microsoft.AspNetCore.OpenApi (23)
Extensions\JsonNodeSchemaExtensions.cs (1)
398var mappings = new JsonObject();
Schemas\OpenApiJsonSchema.Helpers.cs (1)
154var obj = new JsonObject();
Services\Schemas\OpenApiSchemaService.cs (21)
64schema = new JsonObject 73schema = new JsonObject 76[OpenApiSchemaKeywords.ItemsKeyword] = new JsonObject 93schema = new JsonObject(); 141var addReplaceTest = new JsonObject() 146[OpenApiSchemaKeywords.PropertiesKeyword] = new JsonObject 148["op"] = new JsonObject() 153["path"] = new JsonObject() 157["value"] = new JsonObject() 161var moveCopy = new JsonObject() 166[OpenApiSchemaKeywords.PropertiesKeyword] = new JsonObject 168["op"] = new JsonObject() 173["path"] = new JsonObject() 177["from"] = new JsonObject() 184var remove = new JsonObject() 189[OpenApiSchemaKeywords.PropertiesKeyword] = new JsonObject 191["op"] = new JsonObject() 196["path"] = new JsonObject() 203return new JsonObject 207[OpenApiSchemaKeywords.ItemsKeyword] = new JsonObject 491var newObject = new JsonObject();
Microsoft.AspNetCore.OpenApi.Tests (2)
Extensions\JsonNodeSchemaExtensionsTests.cs (2)
101var schema = new JsonObject(); 139var schema = new JsonObject();
Microsoft.DotNet.Internal.SymbolHelper (3)
SymbolPromotionHelper.cs (3)
103JsonObject registrationPayload = new() 123JsonObject visibilityPayload = new() 252JsonObject extensionPayload = new()
Microsoft.Extensions.AI (2)
ChatCompletion\ChatClientStructuredOutputExtensions.cs (2)
162schema = JsonSerializer.SerializeToElement(new JsonObject 166{ "properties", new JsonObject { { "data", JsonElementToJsonNode(schema) } } },
Microsoft.Extensions.AI.Abstractions (9)
Utilities\AIJsonUtilities.Schema.Create.cs (7)
89JsonObject parameterSchemas = new(); 142JsonNode schema = new JsonObject(); 254return schemaObj ?? new JsonObject(); 259return new JsonObject { [TypePropertyName] = null }; 304objSchema.Add(ItemsPropertyName, new JsonObject()); 405schema = obj = new() { [NotPropertyName] = true }; 642(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
MSBuild (10)
JsonOutputFormatter.cs (9)
21private readonly JsonNode _topLevelNode = new JsonObject(); 37JsonNode propertiesNode = new JsonObject(); 55JsonNode itemsNode = new JsonObject(); 61JsonObject jsonItem = new(); 91JsonObject itemsNode = new(); 97JsonObject jsonItem = new(); 132JsonObject targetResultsNode = new(); 136JsonObject targetResults = new(); 141JsonObject jsonItem = new();
XMake.cs (1)
4237var jsonNode = new JsonObject();
ServiceBus.AppHost (1)
Program.cs (1)
36document["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)
310var 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)
158var objSchema = new JsonObject(); 192var 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)
172var root = new JsonObject(); 175var projectJson = new JsonObject(); 189var endpointJsonObject = new JsonObject
779 references to JsonObject
aspire (102)
Agents\ClaudeCode\ClaudeCodeAgentEnvironmentScanner.cs (5)
177var config = JsonNode.Parse(content)?.AsObject(); 184if (config.TryGetPropertyValue("mcpServers", out var serversNode) && serversNode is JsonObject servers) 216var config = await McpConfigFileHelper.ReadConfigAsync(configFilePath, cancellationToken); 219if (!config.ContainsKey("mcpServers") || config["mcpServers"] is not JsonObject) 224var servers = config["mcpServers"]!.AsObject();
Agents\CopilotCli\CopilotCliAgentEnvironmentScanner.cs (5)
160var config = JsonNode.Parse(content)?.AsObject(); 167if (config.TryGetPropertyValue("mcpServers", out var serversNode) && serversNode is JsonObject servers) 212var config = await McpConfigFileHelper.ReadConfigAsync(configFilePath, cancellationToken); 215if (!config.ContainsKey("mcpServers") || config["mcpServers"] is not JsonObject) 220var 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\McpConfigFileHelper.cs (6)
40var config = JsonNode.Parse(content)?.AsObject(); 47if (config.TryGetPropertyValue(serverContainerKey, out var serversNode) && serversNode is JsonObject servers) 61/// 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. 66/// <returns>The parsed <see cref="JsonObject"/> from the file, or a new empty <see cref="JsonObject"/> if the file doesn't exist.</returns> 68public static async Task<JsonObject> ReadConfigAsync(string configFilePath, CancellationToken cancellationToken, Func<string, string>? preprocessContent = null)
Agents\OpenCode\OpenCodeAgentEnvironmentScanner.cs (5)
125var config = JsonNode.Parse(content)?.AsObject(); 132if (config.TryGetPropertyValue("mcp", out var mcpNode) && mcpNode is JsonObject mcp) 200var config = await McpConfigFileHelper.ReadConfigAsync(configFilePath, cancellationToken, RemoveJsonComments); 209if (!config.ContainsKey("mcp") || config["mcp"] is not JsonObject) 214var mcp = config["mcp"]!.AsObject();
Agents\VsCode\VsCodeAgentEnvironmentScanner.cs (5)
211var config = JsonNode.Parse(content)?.AsObject(); 218if (config.TryGetPropertyValue("servers", out var serversNode) && serversNode is JsonObject servers) 256var config = await McpConfigFileHelper.ReadConfigAsync(mcpConfigPath, cancellationToken); 259if (!config.ContainsKey("servers") || config["servers"] is not JsonObject) 264var servers = config["servers"]!.AsObject();
Commands\SecretListCommand.cs (1)
60var obj = new JsonObject();
Configuration\ConfigurationService.cs (14)
16JsonObject settings; 57var settings = JsonNode.Parse(existingContent)?.AsObject(); 151var settings = JsonNode.Parse(content)?.AsObject(); 169private static void SetNestedValue(JsonObject settings, string key, string value) 182var currentObject = settings; 190if (!currentObject.ContainsKey(part) || currentObject[part] is not JsonObject) 207private static void RemoveConflictingFlattenedKeys(JsonObject settings, string[] keyParts) 220if (settings.ContainsKey(partialKey) && settings[partialKey] is not JsonObject) 232private static bool DeleteNestedValue(JsonObject settings, string key) 243var currentObject = settings; 244var objectPath = new List<(JsonObject obj, string key)>(); 252if (!currentObject.ContainsKey(part) || currentObject[part] is not JsonObject) 294private static void FlattenJsonObject(JsonObject obj, Dictionary<string, string> result, string prefix) 302if (kvp.Value is JsonObject nestedObj)
JsonSourceGenerationContext.cs (1)
19[JsonSerializable(typeof(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();
src\Shared\ConsoleLogs\SharedAIHelpers.cs (10)
95var dto = GetLogEntryDto(logEntry, promptContext, getResourceName, dashboardBaseUrl); 144var dto = GetTraceDto(trace, promptContext, getResourceName, dashboardBaseUrl); 206public static JsonObject GetTraceDto( 218var attributesObj = new JsonObject(); 249var spanObj = new JsonObject 274var traceData = new JsonObject 573public static JsonObject GetLogEntryDto( 584var attributesObject = new JsonObject(); 592var log = new JsonObject 613public static JsonObject? GetDashboardLinkObject(string dashboardBaseUrl, string path, string text)
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)
87var obj = new JsonObject(); 135var parsed = JsonNode.Parse(json)?.AsObject(); 142var flat = JsonFlattener.FlattenJsonObject(parsed);
Utils\ConfigurationHelper.cs (5)
53internal static async Task WriteSettingsFileAsync(string filePath, JsonObject settings, CancellationToken cancellationToken = default) 64internal static void WriteSettingsFile(string filePath, JsonObject settings) 105var settings = JsonNode.Parse(content)?.AsObject(); 135var currentObject = settings; 147else if (currentObject[part] is JsonObject)
Utils\EnvironmentChecker\DeprecatedAgentConfigCheck.cs (8)
54var config = JsonNode.Parse(content)?.AsObject(); 89private static bool HasDeprecatedMcpCommand(JsonObject config, AgentConfigLocation location) 103private static bool HasDeprecatedMcpServersArgs(JsonObject config, string serversKey) 105if (!config.TryGetPropertyValue(serversKey, out var serversNode) || serversNode is not JsonObject servers) 110if (!servers.TryGetPropertyValue("aspire", out var aspireNode) || aspireNode is not JsonObject aspire) 135private static bool HasDeprecatedMcpCommandArray(JsonObject config, string serversKey) 137if (!config.TryGetPropertyValue(serversKey, out var mcpNode) || mcpNode is not JsonObject mcp) 142if (!mcp.TryGetPropertyValue("aspire", out var aspireNode) || aspireNode is not JsonObject aspire)
Aspire.Cli.Tests (104)
Agents\CopilotCliAgentEnvironmentScannerTests.cs (8)
61var config = JsonNode.Parse(content)?.AsObject(); 65var servers = config["mcpServers"]?.AsObject(); 69var aspireServer = servers["aspire"]?.AsObject(); 81var env = aspireServer["env"]?.AsObject(); 100var existingConfig = new JsonObject 122var config = JsonNode.Parse(content)?.AsObject(); 125var servers = config["mcpServers"]?.AsObject(); 140var existingConfig = new JsonObject
Agents\NpmProvenanceCheckerTests.cs (3)
85var statement = new JsonObject 216var statement = new JsonObject 247var attestationResponse = new JsonObject
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 (28)
75var settings = JsonNode.Parse(json)?.AsObject(); 98var settings = JsonNode.Parse(json)?.AsObject(); 100Assert.True(settings["foo"] is JsonObject); 101var fooObject = settings["foo"]!.AsObject(); 123var settings = JsonNode.Parse(json)?.AsObject(); 126Assert.True(settings["foo"] is JsonObject); 127var fooObject = settings["foo"]!.AsObject(); 128Assert.True(fooObject["bar"] is JsonObject); 129var barObject = fooObject["bar"]!.AsObject(); 155var settings = JsonNode.Parse(json)?.AsObject(); 158Assert.True(settings["foo"] is JsonObject); 159var fooObject = settings["foo"]!.AsObject(); 275var settings = JsonNode.Parse(json)?.AsObject(); 439var settings = JsonNode.Parse(json)?.AsObject(); 444Assert.True(settings["features"] is JsonObject); 445var featuresObject = settings["features"]!.AsObject(); 471var settings = JsonNode.Parse(json)?.AsObject(); 475Assert.True(settings["features"] is JsonObject); 476var featuresObject = settings["features"]!.AsObject(); 502var settings = JsonNode.Parse(json)?.AsObject(); 506Assert.True(settings["features"] is JsonObject); 507var featuresObject = settings["features"]!.AsObject(); 533var settings = JsonNode.Parse(json)?.AsObject(); 563var settings = JsonNode.Parse(json)?.AsObject(); 566Assert.True(settings["features"] is JsonObject); 567var featuresObject = settings["features"]!.AsObject(); 596var settings = JsonNode.Parse(json)?.AsObject(); 599var featuresObject = settings["features"]!.AsObject();
Mcp\ListStructuredLogsToolTests.cs (8)
198var firstLog = logsArray[0]?.AsObject(); 202var firstLogAttributes = firstLog["attributes"]?.AsObject(); 208var firstDashboardLink = firstLog["dashboard_link"]?.AsObject(); 214var secondLog = logsArray[1]?.AsObject(); 218var secondLogAttributes = secondLog["attributes"]?.AsObject(); 222var secondDashboardLink = secondLog["dashboard_link"]?.AsObject(); 228var thirdLog = logsArray[2]?.AsObject(); 233var thirdDashboardLink = thirdLog["dashboard_link"]?.AsObject();
Mcp\ListTracesToolTests.cs (7)
171var firstTrace = tracesArray[0]?.AsObject(); 181var firstDashboardLink = firstTrace["dashboard_link"]?.AsObject(); 187var serverSpan = spans.FirstOrDefault(s => s?["kind"]?.GetValue<string>() == "Server")?.AsObject(); 193var clientSpan = spans.FirstOrDefault(s => s?["kind"]?.GetValue<string>() == "Client")?.AsObject(); 199var secondTrace = tracesArray[1]?.AsObject(); 203var secondDashboardLink = secondTrace["dashboard_link"]?.AsObject(); 214var internalSpan = secondTraceSpans[0]?.AsObject();
Projects\ProjectUpdaterTests.cs (40)
71var itemsAndProperties = new JsonObject(); 182var itemsAndProperties = new JsonObject(); 320var itemsAndProperties = new JsonObject(); 463var itemsAndProperties = new JsonObject(); 624var itemsAndProperties = new JsonObject(); 742var itemsAndProperties = new JsonObject(); 844var itemsAndProperties = new JsonObject(); 977var itemsAndProperties = new JsonObject(); 1094var itemsAndProperties = new JsonObject(); 1214var itemsAndProperties = new JsonObject(); 1327var itemsAndProperties = new JsonObject(); 1694var itemsAndProperties = new JsonObject(); 1776var itemsAndProperties = new JsonObject(); 1859var itemsAndProperties = new JsonObject(); 1940var itemsAndProperties = new JsonObject(); 2029var itemsAndProperties = new JsonObject(); 2108var itemsAndProperties = new JsonObject(); 2188var itemsAndProperties = new JsonObject(); 2315var itemsAndProperties = new JsonObject(); 2611public static JsonObject WithSdkVersion(this JsonObject root, string sdkVersion) 2615JsonObject properties = new JsonObject(); 2625public static JsonObject WithMSBuildOutput(this JsonObject root) 2627JsonObject items = new JsonObject(); 2649public static JsonObject WithPackageReference(this JsonObject root, string packageId, string packageVersion) 2652var items = root["Items"]!.AsObject(); 2655JsonObject newPackageReference = new JsonObject 2665public static JsonObject WithPackageReferenceWithoutVersion(this JsonObject root, string packageId) 2668var items = root["Items"]!.AsObject(); 2671JsonObject newPackageReference = new JsonObject 2681public static JsonObject WithProjectReference(this JsonObject root, string fullPath) 2684var items = root["Items"]!.AsObject(); 2687JsonObject newProjectReference = new JsonObject 2696public static JsonObject WithProperty(this JsonObject root, string propertyName, string propertyValue) 2698JsonObject properties = new JsonObject();
Aspire.Dashboard (24)
Model\Assistant\AIHelpers.cs (3)
65var urlObj = new JsonObject 88var healthObj = new JsonObject 104var resourceObj = new JsonObject
Model\GenAI\GenAIItemPartViewModel.cs (3)
69JsonObject obj when obj.Count == 0 => string.Empty, 94private static JsonObject ToJsonObject(Dictionary<string, JsonElement> dict) 96var jsonObject = new JsonObject();
Model\GenAI\GenAISchemaHelpers.cs (4)
19internal static OpenApiSchema? ParseOpenApiSchema(JsonObject schemaObj) 28if (schemaObj["properties"] is JsonObject propsObj) 33if (prop.Value is JsonObject propSchemaObj) 45if (schemaObj["items"] is JsonObject itemsObj)
Model\GenAI\GenAIVisualizerDialogViewModel.cs (2)
95if (item is not JsonObject obj) 108if (obj["parameters"] is JsonObject paramsObj)
Otlp\Model\OtlpHelpers.cs (2)
144static JsonObject ConvertKeyValues(KeyValueList value) 146var o = new JsonObject();
src\Shared\ConsoleLogs\SharedAIHelpers.cs (10)
95var dto = GetLogEntryDto(logEntry, promptContext, getResourceName, dashboardBaseUrl); 144var dto = GetTraceDto(trace, promptContext, getResourceName, dashboardBaseUrl); 206public static JsonObject GetTraceDto( 218var attributesObj = new JsonObject(); 249var spanObj = new JsonObject 274var traceData = new JsonObject 573public static JsonObject GetLogEntryDto( 584var attributesObject = new JsonObject(); 592var log = new JsonObject 613public static JsonObject? GetDashboardLinkObject(string dashboardBaseUrl, string path, string text)
Aspire.Dashboard.Tests (4)
Integration\OtlpGrpcServiceTests.cs (1)
164var configJson = new JsonObject
Integration\StartupTests.cs (1)
635var configJson = new JsonObject
Model\GenAISchemaHelpersTests.cs (2)
186var schemaObj = JsonNode.Parse(schemaJson) as JsonObject;
Aspire.Hosting (52)
Ats\AtsError.cs (4)
43public JsonObject ToJsonObject() 45var obj = new JsonObject 94public JsonObject ToJsonObject() 96var obj = new JsonObject();
Dashboard\DashboardEventHandlers.cs (3)
147var configJson = JsonNode.Parse(configText)?.AsObject(); 239var configJson = JsonNode.Parse(originalConfigText)?.AsObject(); 926public JsonObject? State { get; set; }
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!;
Pipelines\DeploymentStateSection.cs (3)
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 ?? [];
Pipelines\Internal\DeploymentStateManagerBase.cs (13)
47private JsonObject? _state; 63protected abstract Task SaveStateToStorageAsync(JsonObject state, CancellationToken cancellationToken); 70protected async Task<JsonObject> LoadStateAsync(CancellationToken cancellationToken = default) 91var flattenedState = JsonNode.Parse(fileContent, documentOptions: jsonDocumentOptions)!.AsObject(); 109public async Task SaveStateAsync(JsonObject state, CancellationToken cancellationToken = default) 146JsonObject? data = null; 150if (sectionData is JsonObject o) 180private static JsonNode? TryGetNestedPropertyValue(JsonObject? node, string path) 192if (current is not JsonObject currentObj || !currentObj.TryGetPropertyValue(segment, out var nextNode)) 280private static void SetNestedPropertyValue(JsonObject root, string path, JsonObject? value) 284var current = root; 288if (!current.TryGetPropertyValue(segment, out var nextNode) || nextNode is not JsonObject nextObj)
Pipelines\Internal\FileDeploymentStateManager.cs (2)
80protected override async Task SaveStateToStorageAsync(JsonObject state, CancellationToken cancellationToken) 97var flattenedSecrets = JsonFlattener.FlattenJsonObject(state);
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 (1)
35protected override async Task SaveStateToStorageAsync(JsonObject state, CancellationToken cancellationToken)
UserSecrets\IUserSecretsManager.cs (1)
51Task SaveStateAsync(JsonObject state, CancellationToken cancellationToken = default);
UserSecrets\NoopUserSecretsManager.cs (1)
40public Task SaveStateAsync(JsonObject state, CancellationToken cancellationToken = default)
UserSecrets\UserSecretsManagerFactory.cs (3)
141public async Task SaveStateAsync(JsonObject state, CancellationToken cancellationToken = default) 146var flattenedState = JsonFlattener.FlattenJsonObject(state); 180var contents = new JsonObject();
Aspire.Hosting.Azure (16)
AzureBicepResource.cs (4)
386if (JsonNode.Parse(responseContent) is JsonObject responseObj) 388if (responseObj["error"] is JsonObject errorObj) 408if (responseObj["properties"]?["error"] is JsonObject deploymentErrorObj) 431if (detail is JsonObject detailObj)
Provisioning\BicepUtilities.cs (6)
30public static async Task SetParametersAsync(JsonObject parameters, AzureBicepResource resource, bool skipKnownValues = false, CancellationToken cancellationToken = default) 66public static async Task SetScopeAsync(JsonObject scope, AzureBicepResource resource, CancellationToken cancellationToken = default) 84public static string GetChecksum(AzureBicepResource resource, JsonObject parameters, JsonObject? scope) 115var parameters = JsonNode.Parse(jsonString)?.AsObject(); 116var scope = section["Scope"] is string scopeString
Provisioning\Internal\BaseProvisioningContextProvider.cs (1)
173var azureSection = azureStateSection.Data;
Provisioning\JsonExtensions.cs (1)
12var jsonObj = obj.AsObject();
Provisioning\Provisioners\BicepProvisioner.cs (4)
163var parameters = new JsonObject(); 166var scope = new JsonObject(); 235var outputObj = outputs?.ToObjectFromJson<JsonObject>();
Aspire.Hosting.Azure.Tests (34)
AzureDeployerTests.cs (1)
1430var cachedState = new JsonObject
BicepUtilitiesTests.cs (27)
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(); 339var scope = new JsonObject(); 357var scope = new JsonObject(); 411var parameters = new JsonObject 445var parameters = new JsonObject
JsonExtensionsTests.cs (3)
14var rootJson = new JsonObject(); 30var rootJson = new JsonObject(); 44var rootJson = new JsonObject();
ProvisioningTestHelpers.cs (3)
610private readonly JsonObject _state = []; 616var sectionData = _state.TryGetPropertyValue(sectionName, out var node) && node is JsonObject obj
Aspire.Hosting.RemoteHost.Tests (129)
AtsMarshallerTests.cs (38)
233var json = new JsonObject { ["$handle"] = handleId }; 245var json = new JsonObject { ["$handle"] = "aspire/Unknown:999" }; 281var json = new JsonObject { ["key1"] = 1, ["key2"] = 2 }; 399Assert.IsType<JsonObject>(result); 400var jsonObj = (JsonObject)result; 418Assert.IsType<JsonObject>(result); 419var jsonObj = (JsonObject)result; 437Assert.IsType<JsonObject>(result); 438var jsonObj = (JsonObject)result; 523var json = new JsonObject { ["a"] = 1, ["b"] = 2 }; 536var json = new JsonObject { ["value"] = 42 }; 549var json = new JsonObject { ["name"] = "test", ["count"] = 5 }; 568Assert.IsType<JsonObject>(result); 569var jsonObj = (JsonObject)result; 650var obj = Assert.IsType<JsonObject>(result); 666var obj = Assert.IsType<JsonObject>(result); 668var childObj = Assert.IsType<JsonObject>(obj["child"]); 686var obj = Assert.IsType<JsonObject>(result); 702var obj = Assert.IsType<JsonObject>(result); 704var childObj = Assert.IsType<JsonObject>(obj["child"]); 714var source = new JsonObject { ["name"] = "updated", ["count"] = 42 }; 727var source = new JsonObject { ["name"] = "updated" }; 740var source = new JsonObject 757var source = new JsonObject { ["display_name"] = "updated", ["val"] = 99 }; 771var source = new JsonObject { ["displayName"] = "should-not-apply" }; 783var source = new JsonObject { ["name"] = "updated", ["secret"] = "should-be-ignored" }; 796var source = new JsonObject { ["name"] = "updated", ["computed"] = "should-be-ignored" }; 810var source = new JsonObject { ["count"] = "not-a-number" };
CallbackProxyTests.cs (6)
125var args = invoker.Invocations[0].Args as JsonObject; 142var args = invoker.Invocations[0].Args as JsonObject; 174var args = invoker.Invocations[0].Args as JsonObject;
CapabilityDispatcherTests.cs (70)
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" } }; 326var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } }; 333var handleRef = result.AsObject(); 345var nestedArgs = new JsonObject { ["context"] = new JsonObject { ["$handle"] = nestedHandleId } }; 403var args = new JsonObject 424var args = new JsonObject 443var args = new JsonObject 462var args = new JsonObject 495var args = new JsonObject 513var args = new JsonObject 534var args = new JsonObject 579var args = new JsonObject 602var args = new JsonObject 623var args = new JsonObject 631var callbackArgs = invoker.Invocations[0].Args as JsonObject; 646var args = new JsonObject 665var args = new JsonObject 693var args = new JsonObject { ["value"] = "test" }; 704var args = new JsonObject { ["value"] = "hello" }; 716var args = new JsonObject { ["value"] = "test" }; 730var args = new JsonObject 745var args = new JsonObject { ["count"] = 3 }; 762var args = new JsonObject 778var args = new JsonObject { ["value"] = "hello" }; 790var args = new JsonObject { ["value"] = 42 }; 809var resultObj = result as JsonObject; 822var listHandle = (listResult as JsonObject)?["$handle"]?.GetValue<string>(); 826var args = new JsonObject 846var listHandle = (listResult as JsonObject)?["$handle"]?.GetValue<string>(); 850var removeArgs = new JsonObject 861var lengthArgs = new JsonObject 879var listHandle = (listResult as JsonObject)?["$handle"]?.GetValue<string>(); 882var args = new JsonObject 901var listHandle = (listResult as JsonObject)?["$handle"]?.GetValue<string>(); 905var clearArgs = new JsonObject 912var lengthArgs = new JsonObject 933var resultObj = result as JsonObject; 946var dictHandle = (dictResult as JsonObject)?["$handle"]?.GetValue<string>(); 950var args = new JsonObject 970var dictHandle = (dictResult as JsonObject)?["$handle"]?.GetValue<string>(); 974var removeArgs = new JsonObject 985var countArgs = new JsonObject 1003var dictHandle = (dictResult as JsonObject)?["$handle"]?.GetValue<string>(); 1007var hasArgs = new JsonObject 1018var hasArgs2 = new JsonObject 1037var dictHandle = (dictResult as JsonObject)?["$handle"]?.GetValue<string>(); 1040var args = new JsonObject 1063var dictHandle = (dictResult as JsonObject)?["$handle"]?.GetValue<string>(); 1066var args = new JsonObject 1083var args = new JsonObject 1100var args = new JsonObject 1117var args = new JsonObject 1134var args = new JsonObject 1160var args = new JsonObject 1179var args = new JsonObject 1197var args = new JsonObject(); 1219var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } }; 1237var args = new JsonObject 1257var args = new JsonObject 1278var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } }; 1295var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } }; 1310var args = new JsonObject { ["context"] = new JsonObject { ["$handle"] = handleId } };
HandleRegistryTests.cs (8)
170var json = registry.Marshal(obj, "aspire/TestObject"); 246var json = new JsonObject { ["$handle"] = "42" }; 275var json = new JsonObject { ["name"] = "test", ["value"] = 42 }; 285var json = new JsonObject { ["$handle"] = 42 }; 294var json = new JsonObject 310var json = new JsonObject { ["$handle"] = "1" }; 332var json = new JsonObject { ["name"] = "test" }; 341var json = new JsonObject { ["$handle"] = 42 };
ReferenceExpressionRefTests.cs (7)
18var json = new JsonObject 39var json = new JsonObject 66var json = new JsonObject 92var json = new JsonObject 105var json = new JsonObject { ["format"] = "test" }; 237var json = new JsonObject 252((JsonObject)json["$expr"]!)["valueProviders"] = providersArray;
Aspire.Hosting.Tests (23)
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)
1574private readonly JsonObject _unflattenedState = []; 1575private JsonObject? _flattenedState; 1578public JsonObject State => _flattenedState ?? []; 1584var sectionData = _unflattenedState.TryGetPropertyValue(sectionName, out var sectionNode) && sectionNode is JsonObject obj
Publishing\DeploymentStateManagerTests.cs (1)
208var state = new JsonObject
Utils\MockUserSecretsManager.cs (1)
23public 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();
aspire-server (35)
Ats\AtsCallbackProxyFactory.cs (16)
128var jsonObjectType = typeof(JsonObject); 187argsExpr ?? Expression.Constant(null, typeof(JsonObject)), 201argsExpr ?? Expression.Constant(null, typeof(JsonObject)), 215argsExpr ?? Expression.Constant(null, typeof(JsonObject)), 229argsExpr ?? Expression.Constant(null, typeof(JsonObject)), 233private void InvokeSyncVoid(string callbackId, JsonObject? args, CancellationToken cancellationToken) 239private void InvokeSyncVoidWithDtoWriteback(string callbackId, JsonObject? args, object?[] originalArgs, Type[] argTypes, CancellationToken cancellationToken) 246private T? InvokeSyncResult<T>(string callbackId, JsonObject? args, CancellationToken cancellationToken) 253private async Task InvokeAsyncVoid(string callbackId, JsonObject? args, CancellationToken cancellationToken) 259private async Task InvokeAsyncVoidWithDtoWriteback(string callbackId, JsonObject? args, object?[] originalArgs, Type[] argTypes, CancellationToken cancellationToken) 266private async Task<T?> InvokeAsyncResult<T>(string callbackId, JsonObject? args, CancellationToken cancellationToken) 289private void AddCancellationTokenToArgs(ref JsonObject? args, CancellationToken cancellationToken) 318argsExpr ?? Expression.Constant(null, typeof(JsonObject)), 336argsExpr ?? Expression.Constant(null, typeof(JsonObject)), 366if (result is not JsonObject returnedArgs) 394if (returnedArgs[key] is JsonObject modifiedDto)
Ats\AtsMarshaller.cs (2)
408if (node is JsonObject jsonObj) 573public void ApplyDtoProperties(JsonObject source, object target, Type targetType)
Ats\CapabilityDispatcher.cs (10)
21JsonObject? args, 475public async Task<JsonNode?> InvokeAsync(string capabilityId, JsonObject? args) 517public JsonNode? Invoke(string capabilityId, JsonObject? args) 579public static string GetRequiredString(this JsonObject args, string name, string capabilityId) 593public static string? GetOptionalString(this JsonObject args, string name) 605public static int? GetOptionalInt(this JsonObject args, string name) 618this JsonObject args, 648public static T? GetDto<T>(this JsonObject args, string name) where T : class 650if (args.TryGetPropertyValue(name, out var node) && node is JsonObject obj) 660public 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\ReferenceExpressionRef.cs (3)
57if (node is not JsonObject obj || !obj.TryGetPropertyValue("$expr", out var exprNode)) 62if (exprNode is not JsonObject exprObj) 101return node is JsonObject obj && obj.ContainsKey("$expr");
RemoteAppHostService.cs (1)
71public async Task<JsonNode?> InvokeCapabilityAsync(string capabilityId, JsonObject? args)
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)
Helpers\JwtAuthenticationSchemeSettings.cs (9)
19var config = JsonSerializer.Deserialize<JsonObject>(reader, JwtSerializerOptions.Default); 22var settingsObject = new JsonObject 28if (config[AuthenticationKey] is JsonObject authentication) 30if (authentication[SchemesKey] is JsonObject schemes) 67var config = JsonSerializer.Deserialize<JsonObject>(reader, JwtSerializerOptions.Default); 70if (config[AuthenticationKey] is JsonObject authentication && 71authentication[SchemesKey] is JsonObject schemes)
Helpers\SigningKeysHandler.cs (2)
65JsonObject secrets = null; 71secrets = JsonSerializer.Deserialize<JsonObject>(secretsFileStream, JwtSerializerOptions.Default);
IdentitySample.PasskeyConformance (1)
Data\ServerPublicKeyCredentialOptionsResponse.cs (1)
22var optionsObject = JsonNode.Parse(value.OptionsJson)?.AsObject()
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (18)
UserJwtsTests.cs (18)
112var appSettings = JsonSerializer.Deserialize<JsonObject>(File.ReadAllText(appsettings)); 115appSettings = JsonSerializer.Deserialize<JsonObject>(File.ReadAllText(appsettings)); 129var appSettings = JsonSerializer.Deserialize<JsonObject>(File.ReadAllText(appsettings)); 132appSettings = JsonSerializer.Deserialize<JsonObject>(File.ReadAllText(appsettings)); 300var secretsJson = await JsonSerializer.DeserializeAsync<JsonObject>(openStream); 519var secretsJson = await JsonSerializer.DeserializeAsync<JsonObject>(openStream); 547var secretsJson = await JsonSerializer.DeserializeAsync<JsonObject>(openStream); 586var secretsJson = await JsonSerializer.DeserializeAsync<JsonObject>(openStream); 608var secretsJson = await JsonSerializer.DeserializeAsync<JsonObject>(openStream); 630var secretsJson = await JsonSerializer.DeserializeAsync<JsonObject>(openStream);
Microsoft.AspNetCore.Identity.Test (10)
Passkeys\PasskeyHandlerAssertionTest.cs (3)
207var response = credentialJson["response"]!.AsObject(); 257var response = credentialJson["response"]!.AsObject(); 324var response = credentialJson["response"]!.AsObject();
Passkeys\PasskeyHandlerAttestationTest.cs (5)
173var user = attestationStateJson["userEntity"]!.AsObject(); 208var user = attestationStateJson["userEntity"]!.AsObject(); 243var user = attestationStateJson["userEntity"]!.AsObject(); 328var response = credentialJson["response"]!.AsObject(); 378var response = credentialJson["response"]!.AsObject();
Passkeys\PasskeyScenarioTest.cs (2)
104public void TransformAsJsonObject(Action<JsonObject> transform) 115var jsonObject = JsonNode.Parse(value)?.AsObject()
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.JsonPatch.SystemTextJson.Tests (5)
IntegrationTests\AnonymousObjectIntegrationTest.cs (1)
171var doc = new JsonObject
IntegrationTests\HeterogenousCollectionTests.cs (1)
25var circleJObject = JsonObject.Parse(@"{
JsonPatchDocumentJObjectTest.cs (2)
18var model = new ObjectWithJObject { CustomData = (JsonObject)JsonSerializer.SerializeToNode(new { Emails = new[] { "foo@bar.com" } }) }; 34var model = new ObjectWithJObject { CustomData = (JsonObject)JsonSerializer.SerializeToNode(new { Email = "foo@bar.com", Name = "Bar" }) };
TestObjectModels\ObjectWithJObject.cs (1)
10public JsonObject CustomData { get; set; } = new JsonObject();
Microsoft.AspNetCore.OpenApi (9)
Extensions\JsonNodeSchemaExtensions.cs (1)
398var mappings = new JsonObject();
Schemas\OpenApiJsonSchema.Helpers.cs (1)
154var obj = new JsonObject();
Services\Schemas\OpenApiSchemaService.cs (7)
139private static JsonObject CreateSchemaForJsonPatch() 141var addReplaceTest = new JsonObject() 161var moveCopy = new JsonObject() 184var remove = new JsonObject() 463if (node is JsonObject jsonObject) 491var newObject = new JsonObject(); 552if (current is JsonObject currentObject)
Microsoft.AspNetCore.OpenApi.Tests (3)
Extensions\JsonNodeSchemaExtensionsTests.cs (2)
101var schema = new JsonObject(); 139var schema = new JsonObject();
Services\OpenApiSchemaService\OpenApiSchemaService.ParameterSchemas.cs (1)
860Assert.IsType<JsonObject>(param.Schema.Default);
Microsoft.Build.BuildCheck.UnitTests (3)
EndToEndTests.cs (3)
154private readonly record struct EmbedResourceTestOutput(String LogOutput, JsonObject DepsJsonResources); 181JsonNode? depsJson = JsonObject.Parse(File.ReadAllText(depsFiles[0])); 185var resources = depsJson!["targets"]?.AsObject().First().Value?[$"{referencedProjectName}/1.0.0"]?["resources"]?.AsObject();
Microsoft.DotNet.Internal.SymbolHelper (4)
SymbolPromotionHelper.cs (4)
103JsonObject registrationPayload = new() 123JsonObject visibilityPayload = new() 138async Task<bool> SendPostRequestWithRetries(string url, JsonObject payload) 252JsonObject extensionPayload = new()
Microsoft.Extensions.AI (2)
ChatCompletion\ChatClientStructuredOutputExtensions.cs (2)
169}, AIJsonUtilities.DefaultOptions.GetTypeInfo(typeof(JsonObject))); 225JsonValueKind.Object => JsonObject.Create(element),
Microsoft.Extensions.AI.Abstractions (29)
Utilities\AIJsonUtilities.cs (1)
174case JsonObject obj:
Utilities\AIJsonUtilities.Defaults.cs (1)
87[JsonSerializable(typeof(JsonObject))]
Utilities\AIJsonUtilities.Schema.Create.cs (23)
89JsonObject parameterSchemas = new(); 233JsonObject? schemaObj = null; 278if (schema is JsonObject objSchema) 315JsonObject obj = ConvertSchemaToObject(ref schema); 395static JsonObject ConvertSchemaToObject(ref JsonNode schema) 397JsonObject obj; 402return (JsonObject)schema; 445JsonObject obj = ConvertSchemaToObject(ref schema); 458JsonObject obj = ConvertSchemaToObject(ref schema); 472JsonObject obj = ConvertSchemaToObject(ref schema); 486JsonObject obj = ConvertSchemaToObject(ref schema); 555schema is JsonObject requiredSchemaObj && 598JsonObject obj = ConvertSchemaToObject(ref schema); 622JsonObject obj = ConvertSchemaToObject(ref schema); 635JsonObject obj = ConvertSchemaToObject(ref schema); 638if (notNode is null or JsonObject) 640JsonObject notObj = 641notNode as JsonObject ?? 642(JsonObject)(obj[NotPropertyName] = new JsonObject()); 657JsonObject obj = ConvertSchemaToObject(ref schema); 702static bool TryGetSchemaType(JsonObject schema, [NotNullWhen(true)] out string? schemaType, out bool isNullable) 768private static bool TypeIsIntegerWithStringNumberHandling(AIJsonSchemaCreateContext ctx, JsonObject schema, [NotNullWhen(true)] out string? numericType, out bool isNullable) 812private 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)
1585var schemaObj = Assert.IsType<JsonObject>(schema); 1600var schemaObj = Assert.IsType<JsonObject>(schema); 1606Assert.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 (1)
OpenAIClientExtensions.cs (1)
57if (node is JsonObject schemaObj)
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; }
MSBuild (7)
JsonOutputFormatter.cs (6)
61JsonObject jsonItem = new(); 91JsonObject itemsNode = new(); 97JsonObject jsonItem = new(); 132JsonObject targetResultsNode = new(); 136JsonObject targetResults = new(); 141JsonObject jsonItem = new();
XMake.cs (1)
4237var jsonNode = new JsonObject();
Roslyn.VisualStudio.Next.UnitTests (2)
UnifiedSettings\UnifiedSettingsTests.cs (2)
132var categories = jsonDocument!.Root["categories"]!.AsObject(); 232var categories = jsonDocument!.Root["categories"]!.AsObject();
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 (82)
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"/>. 226case JsonObject jsonObject: 340private readonly JsonObject _node; 342public DebugView(JsonObject node) 393if (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> 75/// Adds the specified property to the <see cref="JsonObject"/>. 78/// The KeyValuePair structure representing the property name and value to add to the <see cref="JsonObject"/>. 81/// An element with the same property name already exists in the <see cref="JsonObject"/>. 89/// Removes all elements from the <see cref="JsonObject"/>. 110/// Determines whether the <see cref="JsonObject"/> contains an element with the specified property name. 112/// <param name="propertyName">The property name to locate in the <see cref="JsonObject"/>.</param> 114/// <see langword="true"/> if the <see cref="JsonObject"/> contains an element with the specified property name; otherwise, <see langword="false"/>. 127/// Gets the number of elements contained in <see cref="JsonObject"/>. 132/// Removes the element with the specified property name from the <see cref="JsonObject"/>. 155/// Determines whether the <see cref="JsonObject"/> contains a specific property name and <see cref="JsonNode"/> reference. 157/// <param name="item">The element to locate in the <see cref="JsonObject"/>.</param> 159/// <see langword="true"/> if the <see cref="JsonObject"/> contains an element with the property name; otherwise, <see langword="false"/>. 165/// Copies the elements of the <see cref="JsonObject"/> to an array of type KeyValuePair starting at the specified array index. 168/// The one-dimensional Array that is the destination of the elements copied from <see cref="JsonObject"/>. 185/// Returns an enumerator that iterates through the <see cref="JsonObject"/>. 188/// An enumerator that iterates through the <see cref="JsonObject"/>. 193/// Removes a key and value from the <see cref="JsonObject"/>. 196/// The KeyValuePair structure representing the property name and value to remove from the <see cref="JsonObject"/>. 204/// Gets a collection containing the property names in the <see cref="JsonObject"/>. 209/// Gets a collection containing the property values in the <see cref="JsonObject"/>. 222/// <see langword="true"/> if the <see cref="JsonObject"/> contains an element with the specified property name; otherwise, <see langword="false"/>. 240/// Returns an enumerator that iterates through the <see cref="JsonObject"/>. 243/// 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)
158var objSchema = new JsonObject(); 192var 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)
422if (jsonNode is JsonObject jsonObject)
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Converters.cs (3)
150/// Returns a <see cref="JsonConverter{T}"/> instance that converts <see cref="JsonObject"/> values. 153public static JsonConverter<JsonObject?> JsonObjectConverter => s_jsonObjectConverter ??= new JsonObjectConverter(); 154private static JsonConverter<JsonObject?>? s_jsonObjectConverter;
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (1)
875Debug.Assert(propValue is Nodes.JsonObject);
System.Windows.Forms.Analyzers.Tests (2)
CurrentReferences.cs (2)
142JsonObject? jsonObject = JsonNode.Parse(globalJsonString)?.AsObject(); 155JsonObject? jsonObject = JsonNode.Parse(configJsonString)?.AsObject();
TestProject.AppHost (3)
TestProgram.cs (3)
172var root = new JsonObject(); 175var projectJson = new JsonObject(); 189var endpointJsonObject = new JsonObject