239 writes to
aspire (35)
Agents\ClaudeCode\ClaudeCodeAgentEnvironmentScanner.cs (2)
221
config
[
"mcpServers"] = new JsonObject();
227
servers
[
AspireServerName] = new JsonObject
Agents\CopilotCli\CopilotCliAgentEnvironmentScanner.cs (2)
217
config
[
"mcpServers"] = new JsonObject();
223
servers
[
AspireServerName] = new JsonObject
Agents\DeprecatedMcpCommandScanner.cs (2)
227
aspire
[
"args"] = new JsonArray("agent", "mcp");
241
aspire
[
"command"] = new JsonArray("aspire", "agent", "mcp");
Agents\OpenCode\OpenCodeAgentEnvironmentScanner.cs (3)
205
config
[
"$schema"] = "https://opencode.ai/config.json";
211
config
[
"mcp"] = new JsonObject();
217
mcp
[
AspireServerName] = new JsonObject
Agents\VsCode\VsCodeAgentEnvironmentScanner.cs (2)
261
config
[
"servers"] = new JsonObject();
267
servers
[
AspireServerName] = new JsonObject
Commands\SecretListCommand.cs (1)
63
obj
[
key] = value;
Configuration\ConfigurationService.cs (2)
206
currentObject
[
part] = new JsonObject();
214
currentObject
[
finalKey] = value;
Projects\FallbackProjectParser.cs (10)
131
packageObj
[
"Identity"] = JsonValue.Create(pkg.Identity);
132
packageObj
[
"Version"] = JsonValue.Create(pkg.Version);
135
itemsObject
[
"PackageReference"] = packageRefArray;
142
projectObj
[
"Identity"] = JsonValue.Create(proj.Identity);
143
projectObj
[
"FullPath"] = JsonValue.Create(proj.FullPath);
146
itemsObject
[
"ProjectReference"] = projectRefArray;
148
rootObject
[
"Items"] = itemsObject;
152
propertiesObject
[
"AspireHostingSDKVersion"] = JsonValue.Create(aspireHostingSdkVersion);
153
rootObject
[
"Properties"] = propertiesObject;
156
rootObject
[
"Fallback"] = JsonValue.Create(true);
src\Shared\ConsoleLogs\SharedAIHelpers.cs (4)
224
attributesObj
[
attr.Key!] = context.AddValue(attrValue, id => $@"Duplicate of attribute ""{id.Key}"" for span {OtlpHelpers.ToShortenedId(id.SpanId)}", (SpanId: spanId, attr.Key));
286
traceData
[
"dashboard_link"] = GetDashboardLinkObject(dashboardBaseUrl, DashboardUrls.TraceDetailUrl(traceId), traceId);
588
attributesObject
[
attr.Key!] = context.AddValue(attrValue, id => $@"Duplicate of attribute ""{id.Key}"" for log entry {id.LogId}", (LogId: logId, attr.Key));
607
log
[
"dashboard_link"] = GetDashboardLinkObject(dashboardBaseUrl, DashboardUrls.StructuredLogsUrl(logEntryId: logId), $"log_id: {logId}");
src\Shared\Json\JsonFlattener.cs (4)
41
current
[
key] = newObject;
50
current
[
keys[^1]] = kvp.Value?.DeepClone();
81
result
[
arrayKey] = array[i]?.DeepClone();
87
result
[
key] = kvp.Value?.DeepClone();
src\Shared\UserSecrets\SecretsStore.cs (1)
90
obj
[
key] = value;
Utils\ConfigurationHelper.cs (2)
189
currentObject
[
part] = new JsonObject();
220
currentObject
[
finalKey] = value;
Aspire.Cli.EndToEnd.Tests (2)
ProjectReferenceTests.cs (2)
122
packages
[
"MyIntegration"] = "./MyIntegration/MyIntegration.csproj";
123
config
[
"packages"] = packages;
Aspire.Dashboard (9)
Model\Assistant\AIHelpers.cs (3)
72
urlObj
[
"display_name"] = u.DisplayProperties.DisplayName;
119
resourceObj
[
"dashboard_link"] = SharedAIHelpers.GetDashboardLinkObject(dashboardBaseUrl, DashboardUrls.ResourcesUrl(resource: resource.Name), resourceName);
129
resourceObj
[
"environment_variables"] = envVarsArray;
Model\GenAI\GenAIItemPartViewModel.cs (1)
144
jsonObject
[
kvp.Key] = JsonNode.Parse(kvp.Value.GetRawText());
Otlp\Model\OtlpHelpers.cs (1)
149
o
[
item.Key] = ConvertAnyValue(item.Value);
src\Shared\ConsoleLogs\SharedAIHelpers.cs (4)
224
attributesObj
[
attr.Key!] = context.AddValue(attrValue, id => $@"Duplicate of attribute ""{id.Key}"" for span {OtlpHelpers.ToShortenedId(id.SpanId)}", (SpanId: spanId, attr.Key));
286
traceData
[
"dashboard_link"] = GetDashboardLinkObject(dashboardBaseUrl, DashboardUrls.TraceDetailUrl(traceId), traceId);
588
attributesObject
[
attr.Key!] = context.AddValue(attrValue, id => $@"Duplicate of attribute ""{id.Key}"" for log entry {id.LogId}", (LogId: logId, attr.Key));
607
log
[
"dashboard_link"] = GetDashboardLinkObject(dashboardBaseUrl, DashboardUrls.StructuredLogsUrl(logEntryId: logId), $"log_id: {logId}");
Aspire.Hosting (13)
Dashboard\DashboardEventHandlers.cs (2)
262
frameworkObj
[
"version"] = netCoreVersion;
265
frameworkObj
[
"version"] = aspNetCoreVersion;
Devcontainers\DevcontainerSettingsWriter.cs (3)
177
portAttributes
[
"label"] = label;
178
portAttributes
[
"protocol"] = protocol;
179
portAttributes
[
"onAutoForward"] = openBrowser ? "openBrowser" : "silent";
Pipelines\DeploymentStateSection.cs (1)
56
Data
[
RootValueKey] = JsonValue.Create(value);
Pipelines\Internal\DeploymentStateManagerBase.cs (2)
296
current
[
segment] = nextObj;
307
current
[
segments[^1]] = value;
Pipelines\Internal\JsonFlattener.cs (4)
47
current
[
key] = newObject;
56
current
[
keys[^1]] = kvp.Value?.DeepClone();
87
result
[
arrayKey] = array[i]?.DeepClone();
93
result
[
key] = kvp.Value?.DeepClone();
UserSecrets\UserSecretsManagerFactory.cs (1)
183
contents
[
secret.Key] = secret.Value;
Aspire.Hosting.Azure (13)
Provisioning\BicepUtilities.cs (2)
45
parameters
[
parameter.Key] = new JsonObject()
72
scope
[
"resourceGroup"] = targetScope switch
Provisioning\Internal\BaseProvisioningContextProvider.cs (6)
115
azureStateSection.Data
[
"ResourceGroup"] = resourceGroupName;
174
azureSection
[
"Location"] = _options.Location;
175
azureSection
[
"SubscriptionId"] = _options.SubscriptionId;
176
azureSection
[
"ResourceGroup"] = resourceGroupName;
179
azureSection
[
"TenantId"] = _options.TenantId;
183
azureSection
[
"AllowResourceGroupCreation"] = _options.AllowResourceGroupCreation.Value;
Provisioning\Provisioners\BicepProvisioner.cs (5)
245
stateSection.Data
[
"Id"] = deployment.Id.ToString();
248
stateSection.Data
[
"Parameters"] = parameters.ToJsonString();
253
stateSection.Data
[
"Outputs"] = outputObj.ToJsonString();
259
stateSection.Data
[
"Scope"] = scope.ToJsonString();
263
stateSection.Data
[
"CheckSum"] = BicepUtilities.GetChecksum(resource, parameters, scope);
Aspire.Hosting.Azure.Tests (4)
AzureEventHubsExtensionsTests.cs (1)
402
document
[
"Custom"] = JsonValue.Create(42);
AzureServiceBusExtensionsTests.cs (1)
514
document
[
"Custom"] = JsonValue.Create(42);
ProvisioningContextTests.cs (1)
203
azureSection.Data
[
"SubscriptionId"] = "test-id";
ProvisioningTestHelpers.cs (1)
629
_state
[
section.SectionName] = section.Data;
Aspire.Hosting.RemoteHost (7)
Ats\AtsCallbackProxyFactory.cs (2)
301
args
[
$"p{ctParamIndex}"] = tokenId;
303
args
[
"$cancellationToken"] = tokenId;
Ats\AtsError.cs (5)
53
obj
[
"capability"] = Capability;
58
obj
[
"details"] = Details.ToJsonObject();
100
obj
[
"parameter"] = Parameter;
105
obj
[
"expected"] = Expected;
110
obj
[
"actual"] = Actual;
Aspire.Hosting.Tests (19)
Orchestrator\ParameterProcessorTests.cs (1)
1597
_unflattenedState
[
section.SectionName] = section.Data.DeepClone().AsObject();
Publishing\DeploymentStateManagerTests.cs (18)
42
section1.Data
[
"key1"] = "value1";
61
section1.Data
[
"key1"] = "value1";
71
section2.Data
[
"key2"] = "value2";
90
parametersSection.Data
[
"param1"] = "value1";
91
azureSection.Data
[
"resource1"] = "azure-value1";
119
section.Data
[
$"key{sectionIndex}"] = $"value{sectionIndex}";
142
section1.Data
[
"key1"] = "value1";
163
section1.Data
[
"key1"] = "value1";
176
section2.Data
[
"key2"] = "value2";
228
section.Data
[
"key1"] = "value1";
245
section.Data
[
"nestedKey"] = "nestedValue";
263
section1.Data
[
"key1"] = "value1";
264
section2.Data
[
"key2"] = "value2";
299
section1.Data
[
"key1"] = "value1";
308
section2.Data
[
"key2"] = "value2";
340
topLevel.Data
[
"topKey"] = "topValue";
341
nested.Data
[
"nestedKey"] = "nestedValue";
360
section.Data
[
"key"] = "value";
Aspire.Hosting.Yarp (5)
YarpJsonConfigGeneratorBuilder.cs (5)
84
var jsonProxyConfig = jsonObject
[
"ReverseProxy"] = new JsonObject();
85
jsonProxyConfig
[
"Clusters"] = AddClusters();
86
jsonProxyConfig
[
"Routes"] = AddRoutes();
102
routesNode
[
route.RouteId] = node;
116
routesNode
[
cluster.ClusterId] = node;
ConfigurationSchemaGenerator (21)
ConfigSchemaEmitter.cs (21)
63
categoryNode
[
"$ref"] = "#/definitions/logLevelThreshold";
67
parent
[
"definitions"] = new JsonObject
120
currentNode
[
"type"] = "object";
126
currentNode
[
propertiesName] = propertiesNode;
241
currentNode
[
"type"] = "object";
247
currentNode
[
"properties"] = propertiesNode;
318
currentNode
[
"type"] = typeName;
320
currentNode
[
containerName] = containerNode;
445
propertyNode
[
"description"] = description;
459
propertyNode
[
"default"] = true;
463
propertyNode
[
"default"] = false;
591
propertyNode
[
"type"] = "string";
592
propertyNode
[
"pattern"] = TimeSpanRegex;
608
propertyNode
[
"enum"] = enumNode;
612
propertyNode
[
"type"] = "string";
613
propertyNode
[
"format"] = "uri";
620
propertyNode
[
"type"] = new JsonArray { "number", "string" };
624
propertyNode
[
"type"] = "string";
625
propertyNode
[
"format"] = "uuid";
630
propertyNode
[
"oneOf"] = new JsonArray
649
propertyNode
[
"type"] = GetParsableTypeName(parsable);
dotnet (2)
Telemetry\TelemetryDiskLogger.cs (1)
61
root
[
"activities"] = activitiesArray;
ToolPackage\ToolPackageDownloaderBase.cs (1)
393
runtimeOptions
[
"rollForward"] = "Major";
dotnet-user-jwts (2)
Helpers\JwtAuthenticationSchemeSettings.cs (2)
34
schemes
[
SchemeName] = settingsObject;
46
config
[
AuthenticationKey] = new JsonObject
Microsoft.Extensions.AI.Abstractions (46)
Utilities\AIJsonUtilities.Schema.Create.cs (37)
145
schema
[
SchemaPropertyName] = SchemaKeywordUri;
150
schema
[
TitlePropertyName] = title;
155
schema
[
DescriptionPropertyName] = description;
158
schema
[
TypePropertyName] = "object"; // Method schemas always hardcode the type as "object".
159
schema
[
PropertiesPropertyName] = parameterSchemas;
163
schema
[
RequiredPropertyName] = requiredProperties;
292
objSchema
[
RefPropertyName] = (JsonNode)refUri;
319
obj
[
TypePropertyName] = new JsonArray { (JsonNode)numericType, (JsonNode)"null" };
323
obj
[
TypePropertyName] = (JsonNode)numericType;
340
objSchema
[
TypePropertyName] = new JsonArray { (JsonNode)typeValue, (JsonNode)"null" };
361
objSchema
[
TypePropertyName] = new JsonArray { (JsonNode)typeValue, (JsonNode)"null" };
449
obj
[
MinLengthStringPropertyName] ??= stringLengthAttribute.MinimumLength;
452
obj
[
MaxLengthStringPropertyName] ??= stringLengthAttribute.MaximumLength;
461
obj
[
MinLengthStringPropertyName] ??= minLengthAttribute.Length;
465
obj
[
MinLengthCollectionPropertyName] ??= minLengthAttribute.Length;
475
obj
[
MaxLengthStringPropertyName] ??= maxLengthAttribute.Length;
479
obj
[
MaxLengthCollectionPropertyName] ??= maxLengthAttribute.Length;
529
obj
[
MinExclusiveRangePropertyName] ??= minNode;
534
obj
[
MinRangePropertyName] ??= minNode;
543
obj
[
MaxExclusiveRangePropertyName] ??= maxNode;
548
obj
[
MaxRangePropertyName] ??= maxNode;
567
requiredArray ??= (JsonArray)(requiredSchemaObj
[
RequiredPropertyName] = new JsonArray());
604
obj
[
MinLengthStringPropertyName] ??= lengthAttribute.MinimumLength;
607
obj
[
MaxLengthStringPropertyName] ??= lengthAttribute.MaximumLength;
613
obj
[
MinLengthCollectionPropertyName] ??= lengthAttribute.MinimumLength;
616
obj
[
MaxLengthCollectionPropertyName] ??= lengthAttribute.MaximumLength;
627
obj
[
EnumPropertyName] = enumArray;
642
(JsonObject)(obj
[
NotPropertyName] = new JsonObject());
648
notObj
[
EnumPropertyName] = enumArray;
661
obj
[
FormatPropertyName] ??= "date-time";
665
obj
[
FormatPropertyName] ??= "date";
669
obj
[
FormatPropertyName] ??= "time";
673
obj
[
FormatPropertyName] ??= "email";
677
obj
[
FormatPropertyName] ??= "uri";
681
obj
[
FormatPropertyName] ??= "uri";
682
obj
[
ContentMediaTypePropertyName] ??= "image/*";
824
jsonObject
[
entry.Key] = entry.Value;
Utilities\AIJsonUtilities.Schema.Transform.cs (9)
75
properties
[
prop.Key] = TransformSchemaCore(prop.Value, transformOptions, path);
85
schemaObj
[
ItemsPropertyName] = TransformSchemaCore(itemsSchema, transformOptions, path);
93
schemaObj
[
AdditionalPropertiesPropertyName] = TransformSchemaCore(additionalProps, transformOptions, path);
100
schemaObj
[
NotPropertyName] = TransformSchemaCore(notSchema, transformOptions, path);
130
schemaObj
[
AdditionalPropertiesPropertyName] = (JsonNode)false;
141
schemaObj
[
RequiredPropertyName] = requiredProps;
172
schemaObj
[
"type"] = (JsonNode)foundType;
173
schemaObj
[
"nullable"] = (JsonNode)true;
185
schemaObj
[
DescriptionPropertyName] = description;
Microsoft.Extensions.AI.Evaluation.Quality (1)
AIToolExtensions.cs (1)
34
functionJsonNode
[
"functionReturnValueSchema"] =
Microsoft.Extensions.AI.Evaluation.Safety (6)
ContentSafetyServicePayloadUtilities.cs (6)
157
payload
[
"MetricList"] = new JsonArray([.. metricNames]);
204
item
[
questionPropertyName] = question.Text;
209
item
[
answerPropertyName] = answer.Text;
214
item
[
contextPropertyName] = normalizedPerTurnContext[index];
239
payload
[
"MetricList"] = new JsonArray([.. metricNames]);
371
payload
[
"MetricList"] = new JsonArray([.. metricNames]);
Microsoft.Extensions.AI.OpenAI (1)
OpenAIClientExtensions.cs (1)
89
schemaObj
[
"description"] = schemaObj["description"] is { } descriptionNode && descriptionNode.GetValueKind() == JsonValueKind.String ?
Microsoft.ML.AutoML (9)
SweepableEstimator\Converter\MultiModelPipelineConverter.cs (2)
27
jsonObject
[
"schema"] = value.Schema.ToString();
28
jsonObject
[
"estimators"] = JsonValue.Create(value.Estimators);
SweepableEstimator\Converter\SweepableEstimatorConverter.cs (2)
30
jObject
[
"estimatorType"] = JsonValue.Create(value.EstimatorType);
31
jObject
[
"parameter"] = JsonValue.Create(value.Parameter);
SweepableEstimator\Converter\SweepableEstimatorPipelineConverter.cs (2)
30
jNode
[
"parameter"] = JsonValue.Create(parameter);
31
jNode
[
"estimators"] = JsonValue.Create(estimators);
SweepableEstimator\Converter\SweepablePipelineConverter.cs (3)
28
jsonObject
[
"schema"] = value.Schema.ToString();
29
jsonObject
[
"currentSchema"] = value.CurrentParameter["_SCHEMA_"].AsType<string>();
30
jsonObject
[
"estimators"] = JsonValue.Create(value.Estimators);
Microsoft.NET.Build.Containers (13)
ImageConfig.cs (13)
82
newConfig
[
"ExposedPorts"] = CreatePortMap();
86
newConfig
[
"Labels"] = CreateLabelMap();
90
newConfig
[
"Env"] = CreateEnvironmentVariablesMapping();
95
newConfig
[
"WorkingDir"] = _newWorkingDirectory;
100
newConfig
[
"Entrypoint"] = ToJsonArray(_newEntrypoint);
105
newConfig
[
"Cmd"] = ToJsonArray(_newCmd);
110
newConfig
[
"User"] = _user;
122
newConfig
[
propertyName] = JsonNode.Parse(propertyValue.ToJsonString());
165
history
[
"author"] = h.author;
169
history
[
"comment"] = h.comment;
173
history
[
"created"] = RFC3339Format(date);
177
history
[
"created_by"] = h.created_by;
181
history
[
"empty_layer"] = h.empty_layer;
Microsoft.TemplateEngine.Cli (5)
Alias\AliasRegistry.cs (2)
158
commandAliases
[
kvp.Key] = arr;
160
root
[
"CommandAliases"] = commandAliases;
PostActionProcessors\AddJsonPropertyPostActionProcessor.cs (3)
200
parentProperty
[
newJsonPropertyName] = JsonNode.Parse(newJsonPropertyValue);
204
parentProperty
[
newJsonPropertyName] = newJsonPropertyValue;
231
node
[
property] = childNode = new JsonObject();
Microsoft.TemplateEngine.Edge (1)
src\sdk\src\TemplateEngine\Shared\JExtensions.cs (1)
643
target
[
property.Key] = property.Value != null
Microsoft.TemplateEngine.Utils (1)
src\sdk\src\TemplateEngine\Shared\JExtensions.cs (1)
643
target
[
property.Key] = property.Value != null
Microsoft.TemplateSearch.Common (1)
src\sdk\src\TemplateEngine\Shared\JExtensions.cs (1)
643
target
[
property.Key] = property.Value != null
MSBuild (18)
JsonOutputFormatter.cs (17)
40
propertiesNode
[
property] = getProperty(property);
43
_topLevelNode
[
"Properties"] = propertiesNode;
62
jsonItem
[
"Identity"] = item.GetMetadataValue("Identity");
70
jsonItem
[
metadatumName] = TryGetMetadataValue(item, metadatumName);
76
itemsNode
[
itemName] = itemArray;
79
_topLevelNode
[
"Items"] = itemsNode;
98
jsonItem
[
"Identity"] = item.GetMetadataValue("Identity");
101
jsonItem
[
metadatum.Name] = metadatum.EvaluatedValue;
111
jsonItem
[
metadatumName] = TryGetMetadataValue(item, metadatumName);
117
itemsNode
[
itemName] = itemArray;
120
_topLevelNode
[
"Items"] = itemsNode;
137
targetResults
[
"Result"] = targetResult.ResultCode.ToString();
142
jsonItem
[
"Identity"] = item.GetMetadata("Identity");
150
jsonItem
[
metadatumName] = TryGetMetadata(item, metadatumName);
156
targetResults
[
"Items"] = outputArray;
157
targetResultsNode
[
targetName] = targetResults;
160
_topLevelNode
[
"TargetResults"] = targetResultsNode;
XMake.cs (1)
4275
jsonNode
[
featureName] = Features.CheckFeatureAvailability(featureName).ToString();
sdk-tasks (2)
UpdateRuntimeConfig.cs (2)
61
framework
[
"version"] = MicrosoftNetCoreAppVersion;
65
framework
[
"version"] = MicrosoftAspNetCoreAppVersion;
System.Text.Json (1)
System\Text\Json\Serialization\Converters\Node\JsonObjectConverter.cs (1)
36
jObject
[
propertyName] = jNodeValue;
TestProject.AppHost (2)
TestProgram.cs (2)
179
root
[
project.Name] = projectJson;
182
projectJson
[
"Endpoints"] = endpointsJsonArray;
402 references to
aspire (20)
Agents\ClaudeCode\ClaudeCodeAgentEnvironmentScanner.cs (2)
219
if (!config.ContainsKey("mcpServers") || config
[
"mcpServers"] is not JsonObject)
224
var servers = config
[
"mcpServers"]!.AsObject();
Agents\CopilotCli\CopilotCliAgentEnvironmentScanner.cs (2)
215
if (!config.ContainsKey("mcpServers") || config
[
"mcpServers"] is not JsonObject)
220
var servers = config
[
"mcpServers"]!.AsObject();
Agents\OpenCode\OpenCodeAgentEnvironmentScanner.cs (2)
209
if (!config.ContainsKey("mcp") || config
[
"mcp"] is not JsonObject)
214
var mcp = config
[
"mcp"]!.AsObject();
Agents\VsCode\VsCodeAgentEnvironmentScanner.cs (2)
259
if (!config.ContainsKey("servers") || config
[
"servers"] is not JsonObject)
264
var servers = config
[
"servers"]!.AsObject();
Configuration\ConfigurationService.cs (5)
204
if (!currentObject.ContainsKey(part) || currentObject
[
part] is not JsonObject)
209
currentObject = currentObject
[
part]!.AsObject();
234
if (settings.ContainsKey(partialKey) && settings
[
partialKey] is not JsonObject)
266
if (!currentObject.ContainsKey(part) || currentObject
[
part] is not JsonObject)
271
currentObject = currentObject
[
part]!.AsObject();
Npm\SigstoreNpmProvenanceChecker.cs (2)
148
var predicateTypeNode = attestationObj
[
"predicateType"];
169
var bundleNode = attestationObj
[
"bundle"];
Utils\ConfigurationHelper.cs (5)
187
if (!currentObject.ContainsKey(part) || currentObject
[
part] is null)
191
else if (currentObject
[
part] is JsonObject)
193
currentObject = currentObject
[
part]!.AsObject();
204
currentObject = currentObject
[
part]!.AsObject();
215
if (currentObject.ContainsKey(finalKey) && currentObject
[
finalKey] is not null)
Aspire.Cli.EndToEnd.Tests (1)
ProjectReferenceTests.cs (1)
121
var packages = config
[
"packages"] as JsonObject ?? new JsonObject();
Aspire.Cli.Tests (94)
Agents\CopilotCliAgentEnvironmentScannerTests.cs (9)
65
var servers = config
[
"mcpServers"]?.AsObject();
69
var aspireServer = servers
[
"aspire"]?.AsObject();
71
Assert.Equal("local", aspireServer
[
"type"]?.GetValue<string>());
72
Assert.Equal("aspire", aspireServer
[
"command"]?.GetValue<string>());
74
var args = aspireServer
[
"args"]?.AsArray();
81
var env = aspireServer
[
"env"]?.AsObject();
84
Assert.Equal("${DOTNET_ROOT}", env
[
"DOTNET_ROOT"]?.GetValue<string>());
87
var tools = aspireServer
[
"tools"]?.AsArray();
125
var servers = config
[
"mcpServers"]?.AsObject();
Agents\VsCodeAgentEnvironmentScannerTests.cs (8)
151
var servers = config
[
"servers"]?.AsObject();
155
var aspireServer = servers
[
"aspire"]?.AsObject();
157
Assert.Equal("stdio", aspireServer
[
"type"]?.GetValue<string>());
158
Assert.Equal("aspire", aspireServer
[
"command"]?.GetValue<string>());
160
var args = aspireServer
[
"args"]?.AsArray();
203
var servers = config
[
"servers"]?.AsObject();
250
Assert.Equal("stdio", aspireServer
[
"type"]?.GetValue<string>());
251
Assert.Equal("aspire", aspireServer
[
"command"]?.GetValue<string>());
Commands\ConfigCommandTests.cs (26)
77
Assert.Equal("bar", settings
[
"foo"]?.ToString());
100
Assert.True(settings
[
"foo"] is JsonObject);
101
var fooObject = settings
[
"foo"]!.AsObject();
102
Assert.Equal("baz", fooObject
[
"bar"]?.ToString());
126
Assert.True(settings
[
"foo"] is JsonObject);
127
var fooObject = settings
[
"foo"]!.AsObject();
128
Assert.True(fooObject
[
"bar"] is JsonObject);
129
var barObject = fooObject
[
"bar"]!.AsObject();
130
Assert.Equal("hello", barObject
[
"baz"]?.ToString());
158
Assert.True(settings
[
"foo"] is JsonObject);
159
var fooObject = settings
[
"foo"]!.AsObject();
160
Assert.Equal("nested", fooObject
[
"bar"]?.ToString());
496
Assert.True(settings
[
"features"] is JsonObject);
497
var featuresObject = settings
[
"features"]!.AsObject();
498
Assert.Equal("true", featuresObject
[
"polyglotSupportEnabled"]?.ToString());
527
Assert.True(settings
[
"features"] is JsonObject);
528
var featuresObject = settings
[
"features"]!.AsObject();
529
Assert.Equal("false", featuresObject
[
"polyglotSupportEnabled"]?.ToString());
558
Assert.True(settings
[
"features"] is JsonObject);
559
var featuresObject = settings
[
"features"]!.AsObject();
560
Assert.Equal("false", featuresObject
[
"polyglotSupportEnabled"]?.ToString());
618
Assert.True(settings
[
"features"] is JsonObject);
619
var featuresObject = settings
[
"features"]!.AsObject();
620
Assert.Equal("false", featuresObject
[
"polyglotSupportEnabled"]?.ToString());
651
var featuresObject = settings
[
"features"]!.AsObject();
652
Assert.Equal("nested-value", featuresObject
[
"polyglotSupportEnabled"]?.ToString());
Mcp\ListStructuredLogsToolTests.cs (17)
199
Assert.Equal("api-service-instance-1", firstLog
[
"resource_name"]?.GetValue<string>());
200
Assert.Equal(42, firstLog
[
"log_id"]?.GetValue<long>());
201
var firstLogAttributes = firstLog
[
"attributes"]?.AsObject();
207
var firstDashboardLink = firstLog
[
"dashboard_link"]?.AsObject();
209
Assert.Equal("http://localhost:18888/structuredlogs?logEntryId=42", firstDashboardLink
[
"url"]?.GetValue<string>());
210
Assert.Equal("log_id: 42", firstDashboardLink
[
"text"]?.GetValue<string>());
215
Assert.Equal("api-service-instance-2", secondLog
[
"resource_name"]?.GetValue<string>());
216
Assert.Equal(43, secondLog
[
"log_id"]?.GetValue<long>());
217
var secondLogAttributes = secondLog
[
"attributes"]?.AsObject();
221
var secondDashboardLink = secondLog
[
"dashboard_link"]?.AsObject();
223
Assert.Equal("http://localhost:18888/structuredlogs?logEntryId=43", secondDashboardLink
[
"url"]?.GetValue<string>());
224
Assert.Equal("log_id: 43", secondDashboardLink
[
"text"]?.GetValue<string>());
229
Assert.Equal("worker-service", thirdLog
[
"resource_name"]?.GetValue<string>());
230
Assert.Equal(44, thirdLog
[
"log_id"]?.GetValue<long>());
232
var thirdDashboardLink = thirdLog
[
"dashboard_link"]?.AsObject();
234
Assert.Equal("http://localhost:18888/structuredlogs?logEntryId=44", thirdDashboardLink
[
"url"]?.GetValue<string>());
235
Assert.Equal("log_id: 44", thirdDashboardLink
[
"text"]?.GetValue<string>());
Mcp\ListTracesToolTests.cs (17)
172
Assert.Equal("abc123d", firstTrace
[
"trace_id"]?.GetValue<string>());
175
var spans = firstTrace
[
"spans"]?.AsArray();
180
var firstDashboardLink = firstTrace
[
"dashboard_link"]?.AsObject();
182
Assert.Equal("http://localhost:18888/traces/detail/abc123d", firstDashboardLink
[
"url"]?.GetValue<string>());
183
Assert.Equal("abc123d", firstDashboardLink
[
"text"]?.GetValue<string>());
188
Assert.Equal("api-service-instance-1", serverSpan
[
"source"]?.GetValue<string>());
189
Assert.Null(serverSpan
[
"destination"]);
194
Assert.Equal("api-service-instance-2", clientSpan
[
"source"]?.GetValue<string>());
195
Assert.Equal("catalog-service", clientSpan
[
"destination"]?.GetValue<string>());
200
Assert.Equal("xyz789a", secondTrace
[
"trace_id"]?.GetValue<string>());
202
var secondDashboardLink = secondTrace
[
"dashboard_link"]?.AsObject();
204
Assert.Equal("http://localhost:18888/traces/detail/xyz789a", secondDashboardLink
[
"url"]?.GetValue<string>());
205
Assert.Equal("xyz789a", secondDashboardLink
[
"text"]?.GetValue<string>());
208
var secondTraceSpans = secondTrace
[
"spans"]?.AsArray();
215
Assert.Equal("Internal", internalSpan
[
"kind"]?.GetValue<string>());
216
Assert.Equal("worker-service", internalSpan
[
"source"]?.GetValue<string>());
217
Assert.Null(internalSpan
[
"destination"]);
Projects\ProjectUpdaterTests.cs (11)
477
itemsAndProperties
[
"Items"]!["PackageReference"]!.AsArray().Clear(); // Then clear it
484
itemsAndProperties
[
"Items"]!["PackageReference"]!.AsArray().Clear(); // Then clear it
2618
properties = root
[
"Properties"]!.AsObject();
2633
items = root
[
"Items"]!.AsObject();
2652
var items = root
[
"Items"]!.AsObject();
2653
var packageReferences = items
[
"PackageReference"]!.AsArray();
2668
var items = root
[
"Items"]!.AsObject();
2669
var packageReferences = items
[
"PackageReference"]!.AsArray();
2684
var items = root
[
"Items"]!.AsObject();
2685
var projectReferences = items
[
"ProjectReference"]!.AsArray();
2701
properties = root
[
"Properties"]!.AsObject();
Utils\DevCertsCheckTests.cs (6)
215
var certificates = devCertsResult.Metadata
[
"certificates"]!.AsArray();
219
Assert.Equal("AAAA1111BBBB2222", certNode
[
"thumbprint"]!.GetValue<string>());
220
Assert.Equal(MinVersion, certNode
[
"version"]!.GetValue<int>());
221
Assert.Equal("full", certNode
[
"trustLevel"]!.GetValue<string>());
222
Assert.NotNull(certNode
[
"notBefore"]);
223
Assert.NotNull(certNode
[
"notAfter"]);
Aspire.Dashboard (10)
Model\GenAI\GenAISchemaHelpers.cs (6)
23
Type = ParseTypeValue(schemaObj
[
"type"]),
24
Description = schemaObj
[
"description"]?.GetValue<string>()
28
if (schemaObj
[
"properties"] is JsonObject propsObj)
45
if (schemaObj
[
"items"] is JsonObject itemsObj)
51
if (schemaObj
[
"required"] is JsonArray requiredArray)
64
if (schemaObj
[
"enum"] is JsonArray enumArray)
Model\GenAI\GenAIVisualizerDialogViewModel.cs (4)
102
Type = obj
[
"type"]?.GetValue<string>() ?? "function",
103
Name = obj
[
"name"]?.GetValue<string>(),
104
Description = obj
[
"description"]?.GetValue<string>()
108
if (obj
[
"parameters"] is JsonObject paramsObj)
Aspire.Dashboard.Tests (24)
Integration\McpConfigurationTests.cs (14)
60
Assert.Equal("promptString", input
[
"type"]?.GetValue<string>());
61
Assert.Equal("Enter x-mcp-api-key", input
[
"description"]?.GetValue<string>());
62
Assert.True(input
[
"password"]?.GetValue<bool>());
65
var servers = parsed
[
"servers"];
71
Assert.Equal("http://localhost:23052/mcp", dashboard
[
"url"]?.GetValue<string>());
74
var headers = dashboard
[
"headers"];
118
var inputsArray = parsed
[
"inputs"]?.AsArray();
125
Assert.Equal("promptString", input
[
"type"]?.GetValue<string>());
126
Assert.Equal("Enter x-mcp-api-key", input
[
"description"]?.GetValue<string>());
127
Assert.True(input
[
"password"]?.GetValue<bool>());
130
var headers = parsed
[
"headers"];
165
var servers = parsed
[
"servers"];
171
Assert.Equal("http://localhost:23052/mcp", dashboard
[
"url"]?.GetValue<string>());
174
Assert.Null(dashboard
[
"headers"]);
Integration\McpServiceTests.cs (5)
46
var tools = jsonResponse
[
"result"]!["tools"]!.AsArray();
123
var tools = jsonResponse
[
"result"]!["tools"]!.AsArray();
148
var tools = jsonResponse
[
"result"]!["tools"]!.AsArray();
185
var tools = jsonResponse
[
"result"]!["tools"]!.AsArray();
246
var tools = jsonResponse
[
"result"]!["tools"]!.AsArray();
Integration\StartupTests.cs (1)
428
var tools = jsonResponse
[
"result"]!["tools"]!.AsArray();
Model\GenAIMessageParsingHelperTests.cs (4)
138
Assert.Equal("Seattle", toolCallPart.Arguments
[
"location"]!.GetValue<string>());
153
Assert.Equal("Seattle", toolCallPart.Arguments
[
"location"]!.GetValue<string>());
246
Assert.Equal("latest news", serverToolCallPart.ServerToolCall
[
"query"]!.GetValue<string>());
261
Assert.Equal("web_search", serverToolCallResponsePart.ServerToolCallResponse
[
"type"]!.GetValue<string>());
Aspire.Hosting (8)
Dashboard\DashboardEventHandlers.cs (7)
158
if (configJson
[
"runtimeOptions"]?.AsObject() is { } runtimeOptions &&
159
runtimeOptions
[
"frameworks"]?.AsArray() is { } frameworks)
164
frameworkObj
[
"name"]?.GetValue<string>() is { } name &&
165
frameworkObj
[
"version"]?.GetValue<string>() is { } version)
251
if (configJson
[
"runtimeOptions"]?.AsObject() is { } runtimeOptions &&
252
runtimeOptions
[
"frameworks"]?.AsArray() is { } frameworks)
257
frameworkObj
[
"name"]?.GetValue<string>() is { } name)
Devcontainers\DevcontainerSettingsWriter.cs (1)
148
let l = attrs
[
"label"]?.ToString()
Aspire.Hosting.Azure (12)
AzureBicepResource.cs (10)
388
if (responseObj
[
"error"] is JsonObject errorObj)
390
var code = errorObj
[
"code"]?.ToString();
391
var message = errorObj
[
"message"]?.ToString();
395
if (errorObj
[
"details"] is JsonArray detailsArray && detailsArray.Count > 0)
408
if (responseObj
[
"properties"]?["error"] is JsonObject deploymentErrorObj)
410
var code = deploymentErrorObj
[
"code"]?.ToString();
411
var message = deploymentErrorObj
[
"message"]?.ToString();
433
var detailCode = detailObj
[
"code"]?.ToString();
434
var detailMessage = detailObj
[
"message"]?.ToString();
436
if (detailObj
[
"details"] is JsonArray nestedDetailsArray && nestedDetailsArray.Count > 0)
Provisioning\JsonExtensions.cs (2)
15
var node = jsonObj
[
key];
26
node = jsonObj
[
key];
Aspire.Hosting.Azure.Tests (23)
AzureEventHubsExtensionsTests.cs (1)
398
document
[
"UserConfig"]!["LoggingConfig"] = new JsonObject { ["Type"] = "Console" };
AzureInfrastructureExtensionsTests.cs (2)
28
Assert.Equal("azure.bicep.v0", manifest
[
"type"]?.ToString());
29
Assert.Equal("infrastructure1.module.bicep", manifest
[
"path"]?.ToString());
AzureServiceBusExtensionsTests.cs (1)
510
document
[
"UserConfig"]!["Logging"] = new JsonObject { ["Type"] = "Console" };
BicepUtilitiesTests.cs (11)
26
Assert.Equal("david", parameters
[
"name"]?["value"]?.ToString());
62
Assert.Equal("john", parameters
[
"name"]?["value"]?.ToString());
63
Assert.Equal(20, parameters
[
"age"]?["value"]?.GetValue<int>());
64
Assert.Equal(["a", "b", "c"], parameters
[
"values"]?["value"]?.AsArray()?.Select(v => v?.ToString()) ?? []);
65
Assert.Equal("connection string", parameters
[
"conn"]?["value"]?.ToString());
66
Assert.Equal("value", parameters
[
"jsonObj"]?["value"]?["key"]?.ToString());
67
Assert.Equal("paramValue", parameters
[
"param"]?["value"]?.ToString());
68
Assert.Equal("paramValue/1", parameters
[
"expr"]?["value"]?.ToString());
69
Assert.Equal("http://localhost:1023", parameters
[
"endpoint"]?["value"]?.ToString());
346
Assert.Equal("test-rg", scope
[
"resourceGroup"]?.ToString());
364
Assert.Null(scope
[
"resourceGroup"]?.AsValue().GetValue<object>());
JsonExtensionsTests.cs (7)
23
Assert.Equal("TestValue", retrievedNode
[
"TestProperty"]!.GetValue<string>());
37
Assert.Same(rootJson
[
"NewProperty"], newNode);
53
Assert.NotNull(rootJson
[
"Level1"]);
54
Assert.NotNull(rootJson
[
"Level1"]!["Level2"]);
55
Assert.NotNull(rootJson
[
"Level1"]!["Level2"]!["Level3"]);
56
Assert.NotNull(rootJson
[
"Level1"]!["Level2"]!["Level3"]!["Level4"]);
57
Assert.Same(deeply, rootJson
[
"Level1"]!["Level2"]!["Level3"]!["Level4"]);
ProvisioningContextTests.cs (1)
210
Assert.Equal("test-id", loadedSection.Data
[
"SubscriptionId"]?.ToString());
Aspire.Hosting.JavaScript.Tests (1)
AddViteAppTests.cs (1)
225
Assert.Equal("container.v1", manifest
[
"type"]?.ToString());
Aspire.Hosting.Redis.Tests (40)
AddRedisTests.cs (35)
151
var resources = fullManifest
[
"resources"]!;
152
var manifest = resources
[
"redis"]!;
154
Assert.Equal("container.v0", manifest
[
"type"]!.GetValue<string>());
155
var connectionString = manifest
[
"connectionString"]!.GetValue<string>();
160
Assert.Equal($"{RedisContainerImageTags.Registry}/{RedisContainerImageTags.Image}:{RedisContainerImageTags.Tag}", manifest
[
"image"]!.GetValue<string>());
161
Assert.Equal("/bin/sh", manifest
[
"entrypoint"]!.GetValue<string>());
162
Assert.Equal("{redis-password.value}", manifest
[
"env"]!["REDIS_PASSWORD"]!.GetValue<string>());
163
Assert.Equal("redis", manifest
[
"bindings"]!["tcp"]!["scheme"]!.GetValue<string>());
164
Assert.Equal(6379, manifest
[
"bindings"]!["tcp"]!["targetPort"]!.GetValue<int>());
176
var resources = fullManifest
[
"resources"]!;
177
var manifest = resources
[
"redis"]!;
179
Assert.Equal("container.v0", manifest
[
"type"]!.GetValue<string>());
180
var connectionString = manifest
[
"connectionString"]!.GetValue<string>();
185
Assert.Equal($"{RedisContainerImageTags.Registry}/{RedisContainerImageTags.Image}:{RedisContainerImageTags.Tag}", manifest
[
"image"]!.GetValue<string>());
186
Assert.Equal("/bin/sh", manifest
[
"entrypoint"]!.GetValue<string>());
187
Assert.Equal("redis", manifest
[
"bindings"]!["tcp"]!["scheme"]!.GetValue<string>());
188
Assert.Equal(6379, manifest
[
"bindings"]!["tcp"]!["targetPort"]!.GetValue<int>());
205
var resources = fullManifest
[
"resources"]!;
206
var manifest = resources
[
"redis"]!;
208
Assert.Equal("container.v0", manifest
[
"type"]!.GetValue<string>());
209
var connectionString = manifest
[
"connectionString"]!.GetValue<string>();
214
Assert.Equal($"{RedisContainerImageTags.Registry}/{RedisContainerImageTags.Image}:{RedisContainerImageTags.Tag}", manifest
[
"image"]!.GetValue<string>());
215
Assert.Equal("{pass.value}", manifest
[
"env"]!["REDIS_PASSWORD"]!.GetValue<string>());
216
Assert.Equal("redis", manifest
[
"bindings"]!["tcp"]!["scheme"]!.GetValue<string>());
217
Assert.Equal(6379, manifest
[
"bindings"]!["tcp"]!["targetPort"]!.GetValue<int>());
231
var resources = fullManifest
[
"resources"]!;
232
var manifest = resources
[
"redis"]!;
234
Assert.Equal("container.v0", manifest
[
"type"]!.GetValue<string>());
235
var connectionString = manifest
[
"connectionString"]!.GetValue<string>();
240
Assert.Equal($"{RedisContainerImageTags.Registry}/{RedisContainerImageTags.Image}:{RedisContainerImageTags.Tag}", manifest
[
"image"]!.GetValue<string>());
241
Assert.Equal("{pass.value}", manifest
[
"env"]!["REDIS_PASSWORD"]!.GetValue<string>());
242
Assert.Equal("redis", manifest
[
"bindings"]!["tcp"]!["scheme"]!.GetValue<string>());
243
Assert.Equal(6379, manifest
[
"bindings"]!["tcp"]!["targetPort"]!.GetValue<int>());
928
var creEntry = resources
[
creName];
930
Assert.Equal("value.v0", creEntry
[
"type"]!.GetValue<string>());
RedisFunctionalTests.cs (5)
574
var agreements = jo
[
"agreements"];
577
Assert.False(agreements
[
"analytics"]!.GetValue<bool>());
578
Assert.False(agreements
[
"notifications"]!.GetValue<bool>());
579
Assert.False(agreements
[
"encryption"]!.GetValue<bool>());
580
Assert.True(agreements
[
"eula"]!.GetValue<bool>());
Aspire.Hosting.RemoteHost (1)
Ats\AtsCallbackProxyFactory.cs (1)
404
if (returnedArgs
[
key] is JsonObject modifiedDto)
Aspire.Hosting.RemoteHost.Tests (45)
AtsMarshallerTests.cs (29)
450
Assert.NotNull(jsonObj
[
"$handle"]);
451
Assert.NotNull(jsonObj
[
"$type"]);
453
var typeId = jsonObj
[
"$type"]!.GetValue<string>();
469
Assert.NotNull(jsonObj
[
"$handle"]);
470
Assert.NotNull(jsonObj
[
"$type"]);
472
var typeId = jsonObj
[
"$type"]!.GetValue<string>();
488
Assert.NotNull(jsonObj
[
"$handle"]);
489
Assert.NotNull(jsonObj
[
"$type"]);
619
Assert.Equal("test", jsonObj
[
"name"]?.GetValue<string>());
620
Assert.Equal(10, jsonObj
[
"count"]?.GetValue<int>());
700
Assert.Equal("root", obj
[
"name"]!.GetValue<string>());
701
Assert.True(obj
[
"self"] is null || obj
[
"self"]!.GetValueKind() == System.Text.Json.JsonValueKind.Null);
716
Assert.Equal("parent", obj
[
"label"]!.GetValue<string>());
717
var childObj = Assert.IsType<JsonObject>(obj
[
"child"]);
718
Assert.Equal("child", childObj
[
"label"]!.GetValue<string>());
720
Assert.True(childObj
[
"parent"] is null || childObj
[
"parent"]!.GetValueKind() == System.Text.Json.JsonValueKind.Null);
736
Assert.Equal("typed", obj
[
"name"]!.GetValue<string>());
737
Assert.True(obj
[
"self"] is null || obj
[
"self"]!.GetValueKind() == System.Text.Json.JsonValueKind.Null);
752
Assert.Equal("parent", obj
[
"label"]!.GetValue<string>());
753
var childObj = Assert.IsType<JsonObject>(obj
[
"child"]);
754
Assert.Equal("child", childObj
[
"label"]!.GetValue<string>());
755
Assert.True(childObj
[
"parent"] is null || childObj
[
"parent"]!.GetValueKind() == System.Text.Json.JsonValueKind.Null);
989
Assert.NotNull(jsonObj
[
"$handle"]);
990
Assert.NotNull(jsonObj
[
"$type"]);
1006
var handleId = json
[
"$handle"]!.GetValue<string>();
CallbackProxyTests.cs (8)
128
Assert.Equal("hello-world", args
[
"p0"]?.GetValue<string>());
145
Assert.Equal("test-name", args
[
"p0"]?.GetValue<string>());
146
Assert.Equal(42, args
[
"p1"]?.GetValue<int>());
176
Assert.Equal("test", args
[
"p0"]?.GetValue<string>());
177
var tokenId = args
[
"p1"]?.GetValue<string>();
180
Assert.Equal(tokenId, args
[
"$cancellationToken"]?.GetValue<string>());
197
var tokenId = args
[
"p0"]?.GetValue<string>();
199
Assert.Equal(tokenId, args
[
"$cancellationToken"]?.GetValue<string>());
CapabilityDispatcherTests.cs (3)
360
var nestedHandleId = handleRef
[
"$handle"]!.GetValue<string>();
361
var nestedTypeId = handleRef
[
"$type"]!.GetValue<string>();
689
Assert.Equal("hello from C#", callbackArgs
[
"p0"]?.GetValue<string>());
HandleRegistryTests.cs (4)
174
Assert.NotNull(json
[
"$handle"]);
175
Assert.NotNull(json
[
"$type"]);
176
Assert.Equal("aspire/TestObject", json
[
"$type"]!.GetValue<string>());
178
var handleId = json
[
"$handle"]!.GetValue<string>();
ReferenceExpressionRefTests.cs (1)
251
((JsonObject)json
[
"$expr"]!)["valueProviders"] = providersArray;
Aspire.Hosting.Tests (50)
JsonFlattenerTests.cs (31)
37
Assert.Equal("existing-flat-value", result
[
"Azure:SubscriptionId"]!.ToString());
38
Assert.Equal("microsoft.onmicrosoft.com", result
[
"Azure:Tenant"]!.ToString());
39
Assert.Equal("/subscriptions/123/deployments/MyStorage", result
[
"Azure:Deployments:MyStorage:Id"]!.ToString());
40
Assert.Equal("{ \"param\": \"value\" }", result
[
"Azure:Deployments:MyStorage:Parameters"]!.ToString());
62
Assert.Equal("07268dd7-4c50-434b-b1ff-67b8164edb41", result
[
"Azure:SubscriptionId"]!.ToString());
63
Assert.Equal("microsoft.onmicrosoft.com", result
[
"Azure:Tenant"]!.ToString());
64
Assert.Equal("eastus2", result
[
"Azure:Location"]!.ToString());
103
Assert.Equal("nested-value", result
[
"Level1:Level2:Level3:DeepValue"]!.ToString());
127
Assert.Equal("text", result
[
"StringValue"]!.ToString());
128
Assert.Equal("42", result
[
"NumberValue"]!.ToString());
129
Assert.Equal("true", result
[
"BoolValue"]!.ToString());
130
Assert.Null(result
[
"NullValue"]);
131
Assert.Equal("inner-text", result
[
"Nested:InnerString"]!.ToString());
132
Assert.Null(result
[
"Nested:InnerNull"]);
150
Assert.Equal("value1", result
[
"SimpleArray:0"]!.ToString());
151
Assert.Equal("value2", result
[
"SimpleArray:1"]!.ToString());
152
Assert.Equal("value3", result
[
"SimpleArray:2"]!.ToString());
154
Assert.Equal("1", result
[
"NumberArray:0"]!.ToString());
155
Assert.Equal("2", result
[
"NumberArray:1"]!.ToString());
156
Assert.Equal("3", result
[
"NumberArray:2"]!.ToString());
158
Assert.Equal("text", result
[
"MixedArray:0"]!.ToString());
159
Assert.Equal("42", result
[
"MixedArray:1"]!.ToString());
160
Assert.Equal("true", result
[
"MixedArray:2"]!.ToString());
161
Assert.Null(result
[
"MixedArray:3"]);
190
Assert.Equal("Item1", result
[
"ObjectArray:0:Name"]!.ToString());
191
Assert.Equal("Value1", result
[
"ObjectArray:0:Value"]!.ToString());
192
Assert.Equal("Item2", result
[
"ObjectArray:1:Name"]!.ToString());
193
Assert.Equal("Value2", result
[
"ObjectArray:1:Value"]!.ToString());
195
Assert.Equal("1", result
[
"NestedConfig:Items:0:Id"]!.ToString());
196
Assert.Equal("true", result
[
"NestedConfig:Items:0:Settings:Enabled"]!.ToString());
214
Assert.Equal("test", result
[
"OtherValue"]!.ToString());
KestrelConfigTests.cs (1)
299
Assert.Equal(expectedEnv, manifest
[
"env"]!.ToString());
Publishing\DeploymentStateManagerTests.cs (15)
49
Assert.Equal("value1", section2.Data
[
"key1"]?.GetValue<string>());
102
Assert.Equal("value1", parametersCheck.Data
[
"param1"]?.GetValue<string>());
103
Assert.Equal("azure-value1", azureCheck.Data
[
"resource1"]?.GetValue<string>());
131
Assert.Equal($"value{i}", section.Data
[
$"key{i}"]?.GetValue<string>());
150
Assert.Equal("value1", section2.Data
[
"key1"]?.GetValue<string>());
171
Assert.Equal("value1", section2.Data
[
"key1"]?.GetValue<string>());
184
Assert.Equal("value1", section3.Data
[
"key1"]?.GetValue<string>());
185
Assert.Equal("value2", section3.Data
[
"key2"]?.GetValue<string>());
235
Assert.Equal("value1", retrievedSection.Data
[
"key1"]?.GetValue<string>());
252
Assert.Equal("nestedValue", verifySection.Data
[
"nestedKey"]?.GetValue<string>());
272
Assert.Equal("value1", verify1.Data
[
"key1"]?.GetValue<string>());
273
Assert.Equal("value2", verify2.Data
[
"key2"]?.GetValue<string>());
289
Assert.Equal("value1", verify.Data
[
""]?.GetValue<string>());
349
Assert.Equal("topValue", verifyTop.Data
[
"topKey"]?.GetValue<string>());
350
Assert.Equal("nestedValue", verifyNested.Data
[
"nestedKey"]?.GetValue<string>());
Utils\ManifestUtils.cs (2)
41
var resourceNode = obj
[
resource.Name];
88
var resourceNode = obj
[
r.Name];
WithEndpointTests.cs (1)
528
Assert.Equal(expectedEnv, manifest
[
"env"]!.ToString());
ConfigurationSchemaGenerator (11)
ConfigSchemaEmitter.cs (11)
119
var backupTypeNode = currentNode
[
"type"];
123
if (currentNode
[
propertiesName] is not JsonObject propertiesNode)
132
if (propertiesNode
[
pathSegment] is not JsonObject pathSegmentNode)
147
backupCasingOfPathSegmentName = propertiesNode
[
pathSegment].GetPropertyName();
174
var existingValue = propertiesNode
[
pathSegment];
240
var backupTypeNode = currentNode
[
"type"];
244
if (currentNode
[
"properties"] is not JsonObject propertiesNode)
284
var backupPropertyNode = currentNode
[
property.ConfigurationKeyName];
315
var backupTypeNode = currentNode
[
"type"];
316
var backupContainerNode = currentNode
[
containerName];
449
var propertyNodeType = propertyNode
[
"type"];
dotnet (2)
Telemetry\TelemetryDiskLogger.cs (1)
56
var activitiesArray = root
[
"activities"]!.AsArray();
ToolPackage\ToolPackageDownloaderBase.cs (1)
391
if (jsonObject
[
"runtimeOptions"] is JsonObject runtimeOptions)
dotnet-user-jwts (6)
Helpers\JwtAuthenticationSchemeSettings.cs (4)
28
if (config
[
AuthenticationKey] is JsonObject authentication)
30
if (authentication
[
SchemesKey] is JsonObject schemes)
76
if (config
[
AuthenticationKey] is JsonObject authentication &&
77
authentication
[
SchemesKey] is JsonObject schemes)
Helpers\SigningKeysHandler.cs (2)
82
var signingKeys = secrets
[
signkingKeysPropertyName].AsArray();
85
var toRemove = signingKeys.SingleOrDefault(key => key
[
"Issuer"].GetValue<string>() == issuer);
Microsoft.Extensions.AI.Abstractions (3)
Utilities\AIJsonUtilities.Schema.Create.cs (3)
637
JsonNode? notNode = obj
[
NotPropertyName];
644
if (notObj
[
EnumPropertyName] is null)
773
if (ctx.TypeInfo.NumberHandling is not JsonNumberHandling.Strict && schema
[
"type"] is JsonArray typeArray)
Microsoft.Extensions.AI.Abstractions.Tests (1)
Utilities\AIJsonUtilitiesTests.cs (1)
1606
Assert.Equal(((JsonArray)schemaObj
[
"required"]!).Count, ((JsonObject)props!).Count);
Microsoft.Extensions.AI.OpenAI (2)
OpenAIClientExtensions.cs (2)
80
if (schemaObj
[
propName] is { } propNode)
89
schemaObj["description"] = schemaObj
[
"description"] is { } descriptionNode && descriptionNode.GetValueKind() == JsonValueKind.String ?
Microsoft.ML.AutoML (9)
SweepableEstimator\Converter\MultiModelPipelineConverter.cs (2)
18
var schema = jValue
[
"schema"].GetValue<string>();
19
var estimators = jValue
[
"estimator"].GetValue<Dictionary<string, SweepableEstimator>>();
SweepableEstimator\Converter\SweepableEstimatorConverter.cs (2)
19
var estimatorType = jsonObject
[
"estimatorType"].GetValue<EstimatorType>();
20
var parameter = jsonObject
[
"parameter"].GetValue<Parameter>();
SweepableEstimator\Converter\SweepableEstimatorPipelineConverter.cs (2)
18
var parameter = jNode
[
"parameter"].GetValue<Parameter>();
19
var estimators = jNode
[
"estimators"].GetValue<SweepableEstimator[]>();
SweepableEstimator\Converter\SweepablePipelineConverter.cs (3)
18
var currentSchema = jValue
[
"currentSchema"].GetValue<string>();
19
var schema = jValue
[
"schema"].GetValue<string>();
20
var estimators = jValue
[
"estimator"].GetValue<Dictionary<string, SweepableEstimator>>();
Microsoft.ML.AutoML.SourceGenerator (10)
SearchSpaceGenerator.cs (10)
39
var className = Utils.ToTitleCase(jNode
[
"name"].GetValue<string>());
40
var searchSpaceJArray = jNode
[
"search_space"].AsArray();
43
var optionName = Utils.ToTitleCase(t
[
"name"].GetValue<string>());
44
string optionTypeName = t
[
"type"].GetValue<string>() switch
65
var defaultToken = t.AsObject().ContainsKey("default") ? t
[
"default"] : null;
86
var searchSpaceNode = t.AsObject().ContainsKey("search_space") ? t
[
"search_space"] : null;
96
var minToken = searchSpaceNode
[
"min"];
97
var minValue = searchSpaceNode
[
"min"].GetValue<double>();
98
var maxValue = searchSpaceNode
[
"max"].GetValue<double>();
99
var logBase = searchSpaceObject.ContainsKey("log_base") is false ? "false" : searchSpaceNode
[
"log_base"].GetValue<bool>() ? "true" : "false";
Microsoft.NET.Build.Containers (16)
ImageConfig.cs (14)
48
if (_config
[
"config"] is not JsonObject)
66
internal string? GetUser() => _config
[
"config"]?["User"]?.ToString();
67
internal string[]? GetEntrypoint() => _config
[
"config"]?["Entrypoint"]?.AsArray()?.Select(node => node!.GetValue<string>())?.ToArray();
68
private string[]? GetCmd() => _config
[
"config"]?["Entrypoint"]?.AsArray()?.Select(node => node!.GetValue<string>())?.ToArray();
69
private List<HistoryEntry> GetHistory() => _config
[
"history"]?.AsArray().Select(node => node.Deserialize<HistoryEntry>()!).ToList() ?? new List<HistoryEntry>();
70
private string GetOs() => _config
[
"os"]?.ToString() ?? throw new ArgumentException("Base image configuration should contain an 'os' property.");
71
private string GetArchitecture() => _config
[
"architecture"]?.ToString() ?? throw new ArgumentException("Base image configuration should contain an 'architecture' property.");
117
if (_config
[
"config"]?[propertyName] is JsonNode propertyValue)
234
if (_config
[
"config"]?["ExposedPorts"] is JsonObject portsJson)
253
if (_config
[
"config"]?["Labels"] is JsonObject labelsJson)
270
if (_config
[
"config"]?["Env"] is JsonArray envVarJson)
323
if (_config
[
"rootfs"] is { } rootfs)
325
if (rootfs
[
"type"]?.GetValue<string>() == "layers" && rootfs
[
"diff_ids"] is JsonArray layers)
Tasks\CreateImageIndex.cs (2)
151
var architecture = configJson
[
"architecture"]?.ToString();
157
var os = configJson
[
"os"]?.ToString();
Microsoft.TemplateEngine.Cli (1)
PostActionProcessors\AddJsonPropertyPostActionProcessor.cs (1)
228
JsonNode? childNode = node
[
property];
MSBuild (4)
JsonOutputFormatter.cs (4)
35
Assumed.Null(_topLevelNode
[
"Properties"], "Should not add multiple lists of properties to the json format.");
53
Assumed.Null(_topLevelNode
[
"Items"], "Should not add multiple lists of items to the json format.");
89
Assumed.Null(_topLevelNode
[
"Items"], "Should not add multiple lists of items to the json format.");
130
Assumed.Null(_topLevelNode
[
"TargetResults"], "Should not add multiple lists of target results to the json format.");
sdk-tasks (7)
GetRuntimePackRids.cs (1)
23
string [] runtimeIdentifiers = runtimeJsonRoot
[
"runtimes"]!.AsObject().Select(p => p.Key).ToArray();
PublishMutationUtilities.cs (2)
20
foreach (var target in deps
[
"targets"]!.AsObject())
38
var librariesObj = deps
[
"libraries"]!.AsObject();
RemoveAssetFromDepsPackages.cs (1)
37
foreach (var target in deps
[
"targets"]!.AsObject())
UpdateRuntimeConfig.cs (3)
38
var frameworks = config
[
"runtimeOptions"]?["frameworks"];
39
var framework = config
[
"runtimeOptions"]?["framework"];
58
var name = framework
[
"name"]!.GetValue<string>();
ServiceBus.AppHost (1)
Program.cs (1)
36
document
[
"UserConfig"]!["Logging"] = new JsonObject { ["Type"] = "Console" };