140 instantiations of JsonArray
aspire (23)
Agents\ClaudeCode\ClaudeCodeAgentEnvironmentScanner.cs (1)
218["args"] = new JsonArray("agent", "mcp")
Agents\Copilot\CopilotAgentEnvironmentScanner.cs (2)
189["args"] = new JsonArray("agent", "mcp"), 194["tools"] = new JsonArray("*")
Agents\DeprecatedMcpCommandScanner.cs (2)
227aspire["args"] = new JsonArray("agent", "mcp"); 241aspire["command"] = new JsonArray("aspire", "agent", "mcp");
Agents\Hooks\TelemetryHookConfigurator.cs (5)
143["postToolUse"] = new JsonArray( 148["args"] = new JsonArray(args.Select(arg => (JsonNode?)JsonValue.Create(arg)).ToArray()), 246postToolUse = new JsonArray(); 260["hooks"] = new JsonArray( 265["args"] = new JsonArray(args.Select(arg => (JsonNode?)JsonValue.Create(arg)).ToArray()),
Agents\OpenCode\OpenCodeAgentEnvironmentScanner.cs (1)
209["command"] = new JsonArray("aspire", "agent", "mcp"),
Agents\VsCode\VsCodeAgentEnvironmentScanner.cs (1)
264["args"] = new JsonArray("agent", "mcp")
Migrations\TypeScriptAppHostMigration.cs (1)
253var rewritten = new JsonArray();
Projects\FallbackProjectParser.cs (2)
127var packageRefArray = new JsonArray(); 138var projectRefArray = new JsonArray();
src\Shared\ConsoleLogs\SharedAIHelpers.cs (7)
74var jsonArray = new JsonArray(trimmedItems.ToArray()); 123var jsonArray = new JsonArray(trimmedItems.ToArray()); 160var jsonArray = new JsonArray(spans.Select(s => GetSpanDto(s, context, getResourceName, dashboardBaseUrl)).ToArray<JsonNode>()); 174var jsonArray = new JsonArray(logRecords.Select(l => GetLogEntryDto(l, context, getResourceName, dashboardBaseUrl)).ToArray<JsonNode>()); 188var jsonArray = new JsonArray(traces.Select(t => GetTraceDto(t, context, getResourceName, dashboardBaseUrl)).ToArray<JsonNode>()); 238linksArray = new JsonArray(linkObjects); 392var spanArray = new JsonArray(spanObjects.ToArray());
Utils\EnvironmentChecker\DevCertsCheck.cs (1)
527var certificatesArray = new JsonArray();
Aspire.Cli.Tests (12)
Agents\TelemetryHookConfiguratorTests.cs (5)
130["PostToolUse"] = new JsonArray( 134["hooks"] = new JsonArray( 214["args"] = new JsonArray(Path.Combine(workspace.Path, assemblyName), "agent", "telemetry", "--hook") 220["PostToolUse"] = new JsonArray(new JsonObject 223["hooks"] = new JsonArray(existingHook)
Backchannel\ResourceSnapshotMapperTests.cs (1)
344["custom.list"] = new JsonArray((JsonNode?)JsonValue.Create("one"), (JsonNode?)JsonValue.Create("two"))
Projects\ProjectUpdaterTests.cs (6)
2762["PackageReference"] = new JsonArray 2851["PackageReference"] = new JsonArray 4116items.Add("ProjectReference", new JsonArray()); 4117items.Add("PackageReference", new JsonArray()); 4126items.Add("ProjectReference", new JsonArray()); 4130items.Add("PackageReference", new JsonArray());
Aspire.Dashboard (2)
Model\TelemetryExportService.cs (1)
818var array = new JsonArray();
Otlp\Model\OtlpHelpers.cs (1)
187var a = new JsonArray();
Aspire.Dashboard.Tests (1)
Model\DashboardDataSourceTests.cs (1)
802["Values"] = new JsonArray("one", "two")
Aspire.Hosting (2)
Backchannel\AuxiliaryBackchannelRpcTarget.cs (1)
1483var array = new JsonArray();
Dcp\JsonPatch.cs (1)
19var operations = new JsonArray();
Aspire.Hosting.Azure (6)
AzureDeploymentOperationDetails.cs (1)
183var array = new JsonArray();
AzureProvisioningController.cs (2)
2451var deletedResourceIds = new JsonArray(); 2728["diagnostics"] = new JsonArray
AzureProvisioningFailureDetails.cs (2)
374var array = new JsonArray(); 489var supportedLocations = new JsonArray();
Provisioning\BicepUtilities.cs (1)
61IEnumerable<string> s => new JsonArray(s.Select(s => JsonValue.Create(s)).ToArray()),
Aspire.Hosting.Azure.Sandboxes (5)
AzureSandboxContainerDeployment.cs (5)
358var portStates = new JsonArray(); 1957stateSection.Data["PendingOwnerCleanupIds"] = new JsonArray( 2018["Endpoints"] = new JsonArray( 2030["IdentitySettings"] = new JsonArray( 2044["HostRules"] = new JsonArray(
Aspire.Hosting.Azure.Tests (6)
AzureSandboxesTests.cs (6)
876["PendingOwnerCleanupIds"] = new JsonArray("older-owner", "current-owner") 1097["Ports"] = new JsonArray(new JsonObject { ["Port"] = 8080 }) 1135["Ports"] = new JsonArray(new JsonObject { ["Port"] = 8080 }) 2806state.Data["Ports"] = new JsonArray(new JsonObject 2939state.Data["Ports"] = new JsonArray 3225state.Data["Ports"] = new JsonArray(new JsonObject
Aspire.Hosting.CodeGeneration.TypeScript (6)
TypeScriptApiExportWriter.cs (6)
25var modules = new JsonArray(); 31var declarations = new JsonArray(); 74var items = new JsonArray(); 109var members = new JsonArray(); 147var parameters = new JsonArray(); 196var array = new JsonArray();
Aspire.Hosting.RemoteHost (2)
Ats\AtsMarshaller.cs (2)
423var jsonArray = new JsonArray(); 505var jsonArray = new JsonArray();
Aspire.Hosting.RemoteHost.Tests (11)
AtsMarshallerTests.cs (6)
464var json = new JsonArray { 1, 2, 3 }; 477var json = new JsonArray { "a", "b", "c" }; 742var json = new JsonArray { 1, 2, 3 }; 755var json = new JsonArray { "x", "y" }; 811["addressPrefixes"] = new JsonArray("203.0.113.0/24", "198.51.100.0/24"), 812["addressPrefixReferences"] = new JsonArray
CapabilityDispatcherTests.cs (3)
940["values"] = new JsonArray { 1, 2, 3, 4, 5 } 972["values"] = new JsonArray { 10, 20, 30 } 1095["value"] = new JsonArray { 1, 2, 3 }
ReferenceExpressionRefTests.cs (2)
43["valueProviders"] = new JsonArray 246var providersArray = new JsonArray();
Aspire.Hosting.Tests (6)
JsonFlattenerTests.cs (6)
141["SimpleArray"] = new JsonArray("value1", "value2", "value3"), 142["NumberArray"] = new JsonArray(1, 2, 3), 143["MixedArray"] = new JsonArray("text", 42, true, null) 170["ObjectArray"] = new JsonArray( 176["Items"] = new JsonArray( 205["EmptyArray"] = new JsonArray(),
ConfigurationSchemaGenerator (3)
ConfigSchemaEmitter.cs (3)
596var enumNode = new JsonArray(); 620propertyNode["type"] = new JsonArray { "number", "string" }; 630propertyNode["oneOf"] = new JsonArray
dotnet-user-jwts (1)
Helpers\JwtAuthenticationSchemeSettings.cs (1)
24[nameof(TokenValidationParameters.ValidAudiences)] = new JsonArray(Audiences.Select(aud => JsonValue.Create(aud)).ToArray()),
Microsoft.AspNetCore.OpenApi (4)
Extensions\JsonNodeSchemaExtensions.cs (1)
364var enumArray = new JsonArray();
Schemas\OpenApiJsonSchema.Helpers.cs (1)
143var array = new JsonArray();
Services\Schemas\OpenApiSchemaService.cs (2)
238var array = new JsonArray(); 634var newArray = new JsonArray();
Microsoft.Extensions.AI (1)
ChatCompletion\ChatClientStructuredOutputExtensions.cs (1)
168{ "required", new JsonArray("data") },
Microsoft.Extensions.AI.Abstractions (6)
Utilities\AIJsonUtilities.Schema.Create.cs (6)
328obj[TypePropertyName] = new JsonArray { (JsonNode)numericType, (JsonNode)"null" }; 349objSchema[TypePropertyName] = new JsonArray { (JsonNode)typeValue, (JsonNode)"null" }; 356objSchema.InsertAtStart(TypePropertyName, new JsonArray { (JsonNode)"string", (JsonNode)"null" }); 370objSchema[TypePropertyName] = new JsonArray { (JsonNode)typeValue, (JsonNode)"null" }; 576requiredArray ??= (JsonArray)(requiredSchemaObj[RequiredPropertyName] = new JsonArray()); 698JsonArray enumArray = new();
Microsoft.Extensions.AI.Evaluation.Quality (3)
AIToolExtensions.cs (1)
20var toolDefinitionsJsonArray = new JsonArray();
ChatMessageExtensions.cs (1)
17var messagesJsonArray = new JsonArray();
ChatResponseExtensions.cs (1)
27var toolCallsAndResultsJsonArray = new JsonArray();
Microsoft.Extensions.AI.Evaluation.Safety (10)
ContentSafetyServicePayloadUtilities.cs (10)
151["UserTextList"] = new JsonArray([.. userTextListStrings]), 157payload["MetricList"] = new JsonArray([.. metricNames]); 233["UserTextList"] = new JsonArray([.. userTextListStrings]), 239payload["MetricList"] = new JsonArray([.. metricNames]); 285["content"] = new JsonArray([.. contents]) 300["content"] = new JsonArray([.. contents]), 309["content"] = new JsonArray([.. contents]), 361new JsonArray( 364["messages"] = new JsonArray([.. turns.SelectMany(GetMessages)]), 371payload["MetricList"] = new JsonArray([.. metricNames]);
Microsoft.NET.Build.Containers (9)
ImageConfig.cs (3)
163["history"] = new JsonArray(_history.Select(CreateHistory).ToArray<JsonNode>()) 168static JsonArray ToJsonArray(IEnumerable<string> items) => new(items.Where(s => !string.IsNullOrEmpty(s)).Select(s => JsonValue.Create(s)).ToArray<JsonNode?>()); 315JsonArray envVarJson = new();
LocalDaemons\ContainerArchive.cs (3)
63JsonArray layerTarballPaths = new(); 159JsonArray tagsNode = new(); 165JsonNode manifestNode = new JsonArray(
LocalDaemons\DockerCli.cs (3)
315JsonArray layerTarballPaths = new(); 385JsonArray tagsNode = new(); 391JsonNode manifestNode = new JsonArray(new JsonObject
Microsoft.NET.Build.Tasks (2)
GenerateRuntimeConfigurationFiles.cs (2)
467JsonArray probingPaths = new(); 491JsonArray array = new();
Microsoft.NETCore.Platforms (1)
UpdateRuntimeIdentifierGraph.cs (1)
42runtimes.Add(rid.ItemSpec, new JsonObject { ["#import"] = new JsonArray([.. importedRids]) });
Microsoft.TemplateEngine.Cli (1)
Alias\AliasRegistry.cs (1)
153JsonArray arr = new();
Microsoft.TemplateEngine.Edge (1)
BuiltInManagedProvider\GlobalSettings.cs (1)
86foreach (var package in jObject.Get<JsonArray>(nameof(GlobalSettingsData.Packages)) ?? new JsonArray())
MSBuild (2)
JsonOutputFormatter.cs (2)
57JsonArray itemArray = new(); 96JsonArray outputArray = new();
SelectTests (4)
Program.cs (4)
662var array = new JsonArray(); 675var array = new JsonArray(); 678var causeArray = new JsonArray(); 686path = new JsonArray();
System.Text.Json (9)
System\Text\Json\Nodes\JsonArray.cs (4)
81? new JsonArray(jsonElement.Value.Clone(), Options) 82: new JsonArray(Options); 85var jsonArray = new JsonArray(Options) 198JsonValueKind.Array => new JsonArray(element, options),
System\Text\Json\Schema\JsonSchema.cs (2)
194var requiredArray = new JsonArray(); 325var array = new JsonArray();
System\Text\Json\Serialization\Converters\Node\JsonArrayConverter.cs (2)
41return new JsonArray(jElement, options); 48JsonArray jArray = new JsonArray(options);
System\Text\Json\Serialization\Converters\Node\JsonNodeConverter.cs (1)
92node = new JsonArray(element, options);
TestProject.AppHost (1)
TestProgram.cs (1)
180var endpointsJsonArray = new JsonArray();
400 references to JsonArray
aspire (27)
Agents\AspireSkills\GitHubArtifactAttestationVerifier.cs (1)
162if (document?["attestations"] is not JsonArray attestations)
Agents\DeprecatedMcpCommandScanner.cs (2)
130if (!aspire.TryGetPropertyValue("args", out var argsNode) || argsNode is not JsonArray args) 162if (!aspire.TryGetPropertyValue("command", out var commandNode) || commandNode is not JsonArray command)
Agents\Hooks\TelemetryHookConfigurator.cs (5)
234JsonArray postToolUse; 237if (postToolUseNode is not JsonArray postToolUseArray) 291private static void RemoveExistingAspireEntries(JsonArray postToolUse) 300|| innerNode is not JsonArray innerHooks) 336if (hook.TryGetPropertyValue("args", out var argsNode) && argsNode is JsonArray args)
Migrations\TypeScriptAppHostMigration.cs (2)
248root["include"] is not JsonArray include) 253var rewritten = new JsonArray();
Npm\SigstoreNpmProvenanceChecker.cs (1)
198if (attestationsNode is not JsonArray { Count: > 0 } attestations)
Projects\FallbackProjectParser.cs (2)
127var packageRefArray = new JsonArray(); 138var projectRefArray = new JsonArray();
Scaffolding\ScaffoldingService.cs (2)
672if (existingValue is not JsonArray existingArray || scaffoldValue is not JsonArray scaffoldArray)
src\Shared\ConsoleLogs\SharedAIHelpers.cs (7)
74var jsonArray = new JsonArray(trimmedItems.ToArray()); 123var jsonArray = new JsonArray(trimmedItems.ToArray()); 160var jsonArray = new JsonArray(spans.Select(s => GetSpanDto(s, context, getResourceName, dashboardBaseUrl)).ToArray<JsonNode>()); 174var jsonArray = new JsonArray(logRecords.Select(l => GetLogEntryDto(l, context, getResourceName, dashboardBaseUrl)).ToArray<JsonNode>()); 188var jsonArray = new JsonArray(traces.Select(t => GetTraceDto(t, context, getResourceName, dashboardBaseUrl)).ToArray<JsonNode>()); 230JsonArray? linksArray = null; 392var spanArray = new JsonArray(spanObjects.ToArray());
src\Shared\Json\JsonFlattener.cs (1)
70else if (kvp.Value is JsonArray array)
Telemetry\InternalMicrosoftDetector.cs (1)
755if (kerberosStatusNode is not JsonArray kerberosStatuses)
Utils\EnvironmentChecker\DeprecatedAgentConfigCheck.cs (2)
117if (!aspire.TryGetPropertyValue("args", out var argsNode) || argsNode is not JsonArray args) 149if (!aspire.TryGetPropertyValue("command", out var commandNode) || commandNode is not JsonArray command)
Utils\EnvironmentChecker\DevCertsCheck.cs (1)
527var certificatesArray = new JsonArray();
Aspire.Cli.EndToEnd.Tests (1)
CSharpInitTests.cs (1)
143Assert.Empty(Assert.IsType<JsonArray>(description["resources"]));
Aspire.Cli.Tests (32)
Agents\CopilotAgentEnvironmentScannerTests.cs (2)
76var args = aspireServer["args"]?.AsArray(); 89var tools = aspireServer["tools"]?.AsArray();
Agents\TelemetryHookConfiguratorTests.cs (12)
89var postToolUse = await ReadClaudePostToolUseAsync(home).DefaultTimeout(); 113var postToolUse = await ReadClaudePostToolUseAsync(home).DefaultTimeout(); 151var postToolUse = root["hooks"]!["PostToolUse"]!.AsArray(); 169var groups = await ReadClaudePostToolUseAsync(home); 233var groups = await ReadClaudePostToolUseAsync(home); 298private static async Task<JsonArray> ReadClaudePostToolUseAsync(DirectoryInfo home) 305private static int CountAspireGroups(JsonArray postToolUse) 310&& obj["hooks"] is JsonArray hooks 318|| (ho["args"] is JsonArray args && args.Any(JsonValueHasTelemetryScript))); 325&& obj["hooks"] is JsonArray hooks 330private static JsonObject FindAspireHook(JsonArray postToolUse) 334if (group is JsonObject obj && obj["hooks"] is JsonArray hooks)
Agents\VsCodeAgentEnvironmentScannerTests.cs (1)
160var args = aspireServer["args"]?.AsArray();
Backchannel\ResourceSnapshotMapperTests.cs (2)
351var listProperty = Assert.IsType<JsonArray>(result.Properties["custom.list"]);
Commands\ResourceCommandTests.cs (2)
1764var argumentInputs = Assert.IsType<JsonArray>(json);
Commands\TelemetryTracesCommandTests.cs (2)
137var items = JsonNode.Parse(jsonLine)!.AsArray(); 225var items = JsonNode.Parse(jsonLine)!.AsArray();
Mcp\ListStructuredLogsToolTests.cs (1)
191var logsArray = JsonNode.Parse(jsonText)?.AsArray();
Mcp\ListTracesToolTests.cs (3)
163var tracesArray = JsonNode.Parse(jsonText)?.AsArray(); 175var spans = firstTrace["spans"]?.AsArray(); 202var secondTraceSpans = secondTrace["spans"]?.AsArray();
Projects\ProjectUpdaterTests.cs (3)
4141var packageReferences = items["PackageReference"]!.AsArray(); 4157var packageReferences = items["PackageReference"]!.AsArray(); 4173var projectReferences = items["ProjectReference"]!.AsArray();
Scaffolding\PackageJsonMergerTests.cs (3)
1250var keywords = doc["keywords"]!.AsArray(); 1255var files = doc["files"]!.AsArray(); 1309Assert.IsAssignableFrom<JsonArray>(doc["keywords"]);
Utils\DevCertsCheckTests.cs (1)
305var certificates = devCertsResult.Metadata["certificates"]!.AsArray();
Aspire.Dashboard (9)
Model\GenAI\GenAIItemPartViewModel.cs (2)
78JsonArray arr when arr.Count == 0 => string.Empty, 117JsonArray arr when arr.Count == 0 => string.Empty,
Model\GenAI\GenAISchemaHelpers.cs (3)
46if (schemaObj["required"] is JsonArray requiredArray) 59if (schemaObj["enum"] is JsonArray enumArray) 85if (typeNode is JsonArray typeArray)
Model\GenAI\GenAIVisualizerDialogViewModel.cs (1)
92if (jsonNode is JsonArray array)
Model\TelemetryExportService.cs (1)
818var array = new JsonArray();
Otlp\Model\OtlpHelpers.cs (2)
185static JsonArray ConvertArray(ArrayValue value) 187var a = new JsonArray();
Aspire.Dashboard.Tests (10)
Model\GenAISchemaHelpersTests.cs (6)
122var typeArrayWithObjects = JsonNode.Parse("""["string", {"invalid": "object"}, "number"]""") as JsonArray; 136var typeArrayWithOnlyObjects = JsonNode.Parse("""[{"invalid": "object"}, {"another": "object"}]""") as JsonArray; 159var typeArray = JsonNode.Parse("""["string", "null"]""") as JsonArray;
Model\TelemetryExportServiceTests.cs (4)
1432var waitingForProperty = Assert.IsType<JsonArray>(deserialized.Properties[KnownProperties.Resource.WaitingFor]); 1566var portsArray = Assert.IsType<JsonArray>(deserialized.Properties["container.ports"]);
Aspire.Hosting (20)
Backchannel\AuxiliaryBackchannelRpcTarget.cs (3)
396private static string?[] ConvertOrderedArgumentValues(JsonArray arguments) 1481private static JsonArray ConvertEnumerablePropertyValueToJsonArray(System.Collections.IEnumerable enumerable) 1483var array = new JsonArray();
Dcp\DcpExecutor.cs (1)
1150var jsonPatch = JsonPatch.Create(current, changed);
Dcp\JsonPatch.cs (9)
17internal static JsonArray Create(JsonNode? current, JsonNode? changed) 19var operations = new JsonArray(); 25internal static JsonNode? Apply(JsonNode? current, JsonArray patch) 48private static void AddOperations(JsonNode? current, JsonNode? changed, string path, JsonArray operations) 81if (current is JsonArray currentArray && changed is JsonArray changedArray) 208case JsonArray jsonArray: 228JsonArray jsonArray => jsonArray[ParseArrayIndex(segment, jsonArray.Count, allowEnd: false)] 260private static void ApplyToArray(JsonArray target, string operation, string indexText, JsonNode? value)
Pipelines\Internal\JsonFlattener.cs (1)
76else if (kvp.Value is JsonArray array)
Publishing\ContainerImageArchiveRewriter.cs (3)
224if (ParseJson(contents, entryName) is not JsonArray manifests) 241if (repoTagsNode is not JsonArray repoTags) 342if (index["manifests"] is not JsonArray manifests)
Publishing\ContainerRuntimeBase.cs (3)
212if (node is not JsonArray array) 247if (root is JsonArray verboseManifests) 265if (manifestObject["manifests"] is JsonArray manifests)
Aspire.Hosting.Azure (7)
AzureDeploymentOperationDetails.cs (2)
181private static JsonArray ToJsonArray(IEnumerable<AzureDeploymentOperationDetails> operations) 183var array = new JsonArray();
AzureProvisioningController.cs (1)
2451var deletedResourceIds = new JsonArray();
AzureProvisioningFailureDetails.cs (4)
372internal static JsonArray CreateRecommendedActionsJsonArray(IEnumerable<AzureProvisioningRecommendedAction> recommendedActions) 374var array = new JsonArray(); 489var supportedLocations = new JsonArray(); 622if (errorObj["details"] is JsonArray detailsArray)
Aspire.Hosting.Azure.Sandboxes (5)
AzureSandboxContainerDeployment.cs (4)
358var portStates = new JsonArray(); 1933var ownerIds = stateSection.Data["PendingOwnerCleanupIds"] is JsonArray pendingOwnerIds 2155if (stateSection.Data["Ports"] is not JsonArray ports) 2203if (stateSection.Data["Ports"] is JsonArray ports)
AzureSandboxEndpointPropertyValueProvider.cs (1)
129if (stateSection.Data["Ports"] is not JsonArray ports)
Aspire.Hosting.Azure.Tests (16)
AzureEnvironmentResourceExtensionsTests.cs (16)
369var recommendedActions = Assert.IsType<JsonArray>(resultData["recommendedActions"]); 932var recommendedActions = Assert.IsType<JsonArray>(live["recommendedActions"]); 1206var recommendedActions = Assert.IsType<JsonArray>(live["recommendedActions"]); 1812var resultResourceIds = Assert.IsType<JsonArray>(resultData["deletedResourceIds"]); 4027var diagnostics = Assert.IsType<JsonArray>(data["diagnostics"]); 4036var recommendedActions = Assert.IsType<JsonArray>(diagnostic["recommendedActions"]); 4235var diagnostics = Assert.IsType<JsonArray>(data["diagnostics"]); 4243var resultRecommendedActions = Assert.IsType<JsonArray>(diagnostic["recommendedActions"]);
Aspire.Hosting.CodeGeneration.Go (1)
AtsGoCodeGenerator.cs (1)
697AtsTypeCategory.Array or AtsTypeCategory.List when value is JsonArray arr
Aspire.Hosting.CodeGeneration.Java (2)
AtsJavaCodeGenerator.cs (2)
882AtsTypeCategory.Array when value is JsonArray arr 884AtsTypeCategory.List when value is JsonArray arr
Aspire.Hosting.CodeGeneration.Python (1)
AtsPythonCodeGenerator.cs (1)
1001AtsTypeCategory.Array or AtsTypeCategory.List when value is JsonArray arr
Aspire.Hosting.CodeGeneration.TypeScript (7)
TypeScriptApiExportWriter.cs (6)
25var modules = new JsonArray(); 31var declarations = new JsonArray(); 74var items = new JsonArray(); 109var members = new JsonArray(); 147var parameters = new JsonArray(); 196var array = new JsonArray();
TypeScriptApiProjector.cs (1)
775AtsTypeCategory.Array or AtsTypeCategory.List when value is JsonArray arr
Aspire.Hosting.Java.Tests (2)
AddJavaAppTests.cs (2)
1333var args = manifest?["args"]?.AsArray(); 1349var args = manifest?["args"]?.AsArray();
Aspire.Hosting.RemoteHost (6)
Ats\AtsMarshaller.cs (4)
423var jsonArray = new JsonArray(); 505var jsonArray = new JsonArray(); 641if (node is JsonArray array) 766JsonArray => "array",
Ats\CapabilityDispatcher.cs (1)
956JsonArray => "array",
Ats\ReferenceExpressionRef.cs (1)
115providersNode is JsonArray providersArray)
Aspire.Hosting.RemoteHost.Tests (14)
AtsMarshallerTests.cs (7)
261Assert.IsType<JsonArray>(result); 262var jsonArray = (JsonArray)result; 464var json = new JsonArray { 1, 2, 3 }; 477var json = new JsonArray { "a", "b", "c" }; 742var json = new JsonArray { 1, 2, 3 }; 755var json = new JsonArray { "x", "y" };
CapabilityDispatcherTests.cs (6)
958var resultArray = result as JsonArray; 1444var keysArray = result as JsonArray; 1469var keysArray = Assert.IsType<JsonArray>(result);
ReferenceExpressionRefTests.cs (1)
246var providersArray = new JsonArray();
Aspire.Hosting.Tests (8)
Backchannel\AuxiliaryBackchannelRpcTargetTests.cs (2)
1327var list = Assert.IsAssignableFrom<JsonArray>(snapshot.Properties["list"]);
Dcp\JsonPatchTests.cs (4)
19var patch = JsonPatch.Create(current, changed); 33var patch = JsonPatch.Create(current, changed); 59var patch = JsonPatch.Create(current, changed); 71var patch = JsonPatch.Create(current, changed);
Dcp\TestKubernetesService.cs (2)
387var jsonPatch = (JsonArray)patch.Content;
ConfigurationSchemaGenerator (2)
ConfigSchemaEmitter.cs (2)
596var enumNode = new JsonArray(); 754case JsonArray array:
dotnet-aot (1)
parent\dotnet\Telemetry\TelemetryDiskLogger.cs (1)
56var activitiesArray = root["activities"]!.AsArray();
dotnet-user-jwts (1)
Helpers\SigningKeysHandler.cs (1)
82var signingKeys = secrets[signkingKeysPropertyName].AsArray();
Microsoft.AspNetCore.JsonPatch.SystemTextJson (7)
Adapters\AdapterFactory.cs (1)
34JsonArray => new ListAdapter(),
Helpers\GenericListOrJsonArrayUtilities.cs (6)
19if (list is JsonArray array) 33else if (list is JsonArray array) 50if (list is JsonArray jsonArray) 64else if (list is JsonArray array) 80else if (list is JsonArray array) 96else if (list is JsonArray array)
Microsoft.AspNetCore.OpenApi (12)
Extensions\JsonNodeSchemaExtensions.cs (5)
361if (enumType.IsEnum && schema[OpenApiSchemaKeywords.EnumKeyword] is JsonArray) 364var enumArray = new JsonArray(); 593if (schema[OpenApiSchemaKeywords.TypeKeyword] is JsonArray typeArray) 607if (schema[OpenApiSchemaKeywords.EnumKeyword] is JsonArray enumArray) 616if (jsonNode is not JsonArray jsonArray)
Schemas\OpenApiJsonSchema.Helpers.cs (1)
143var array = new JsonArray();
Services\Schemas\OpenApiSchemaService.cs (6)
236static JsonArray JsonArray(ReadOnlySpan<JsonNode> values) 238var array = new JsonArray(); 277if (rawNode[OpenApiSchemaKeywords.EnumKeyword] is JsonArray rawEnum && rawEnum.Count > 0) 632else if (node is JsonArray jsonArray) 634var newArray = new JsonArray(); 750if (currentNode is JsonArray currentArray)
Microsoft.Extensions.AI (1)
ChatCompletion\ChatClientStructuredOutputExtensions.cs (1)
224JsonValueKind.Array => JsonArray.Create(element),
Microsoft.Extensions.AI.Abstractions (13)
Utilities\AIJsonUtilities.cs (1)
166case JsonArray array:
Utilities\AIJsonUtilities.Defaults.cs (1)
75[JsonSerializable(typeof(JsonArray))]
Utilities\AIJsonUtilities.Schema.Create.cs (8)
91JsonArray? requiredProperties = null; 567JsonArray? requiredArray = requiredSchemaObj.TryGetPropertyValue(RequiredPropertyName, out JsonNode? existing) ? 568existing as JsonArray : 576requiredArray ??= (JsonArray)(requiredSchemaObj[RequiredPropertyName] = new JsonArray()); 696static JsonArray CreateJsonArray(object?[] values, JsonSerializerOptions serializerOptions) 698JsonArray enumArray = new(); 729foreach (JsonNode? entry in (JsonArray)typeNode) 782if (ctx.TypeInfo.NumberHandling is not JsonNumberHandling.Strict && schema["type"] is JsonArray typeArray)
Utilities\AIJsonUtilities.Schema.Transform.cs (3)
108if (schemaObj.TryGetPropertyValue(combinatorKeyword, out JsonNode? combinatorSchema) && combinatorSchema is JsonArray combinatorArray) 135JsonArray requiredProps = []; 146typeSchema is JsonArray typeArray)
Microsoft.Extensions.AI.Abstractions.Tests (4)
test\Shared\JsonSchemaExporter\TestTypes.cs (2)
106yield return new TestData<JsonArray>([(JsonNode)1, (JsonNode)2, (JsonNode)3], """{"type":["array","null"]}"""); 1250[JsonSerializable(typeof(JsonArray))]
Utilities\AIJsonUtilitiesTests.cs (2)
1850Assert.Equal(((JsonArray)schemaObj["required"]!).Count, ((JsonObject)props!).Count); 1853if (schemaObj.TryGetPropertyValue("type", out JsonNode? type) && type is JsonArray typeArray)
Microsoft.Extensions.AI.Evaluation.Quality (3)
AIToolExtensions.cs (1)
20var toolDefinitionsJsonArray = new JsonArray();
ChatMessageExtensions.cs (1)
17var messagesJsonArray = new JsonArray();
ChatResponseExtensions.cs (1)
27var toolCallsAndResultsJsonArray = new JsonArray();
Microsoft.ML.AutoML.SourceGenerator (1)
SearchSpaceGenerator.cs (1)
40var searchSpaceJArray = jNode["search_space"].AsArray();
Microsoft.NET.Build.Containers (13)
ImageConfig.cs (5)
168static JsonArray ToJsonArray(IEnumerable<string> items) => new(items.Where(s => !string.IsNullOrEmpty(s)).Select(s => JsonValue.Create(s)).ToArray<JsonNode?>()); 282if (_config["config"]?["Env"] is JsonArray envVarJson) 312private JsonArray CreateEnvironmentVariablesMapping() 315JsonArray envVarJson = new(); 337if (rootfs["type"]?.GetValue<string>() == "layers" && rootfs["diff_ids"] is JsonArray layers)
LocalDaemons\ContainerArchive.cs (4)
63JsonArray layerTarballPaths = new(); 115JsonArray? layerTarballPaths = null) 156JsonArray layerTarballPaths, 159JsonArray tagsNode = new();
LocalDaemons\DockerCli.cs (4)
315JsonArray layerTarballPaths = new(); 334JsonArray? layerTarballPaths = null) 382JsonArray layerTarballPaths, 385JsonArray tagsNode = new();
Microsoft.NET.Build.Tasks (3)
GenerateRuntimeConfigurationFiles.cs (3)
467JsonArray probingPaths = new(); 489private static JsonArray SerializeFrameworks(List<RuntimeConfigFramework> frameworks) 491JsonArray array = new();
Microsoft.TemplateEngine.Cli (7)
Alias\AliasRegistry.cs (2)
153JsonArray arr = new(); 205else if (property.Value is JsonArray arr)
HostSpecificTemplateData.cs (1)
29if (usagesNode is JsonArray usagesArray)
JExtensions.cs (2)
196token = token.Get<JsonArray>(propertyName); 199if (token is not JsonArray arr)
PostActionProcessors\ChmodPostActionProcessor.cs (1)
25JsonArray valueArray = JsonNode.Parse(entry.Value)!.AsArray();
PostActionProcessors\PostActionProcessorBase.cs (1)
138if (config is not JsonArray arr)
Microsoft.TemplateEngine.Edge (24)
BuiltInManagedProvider\GlobalSettings.cs (1)
86foreach (var package in jObject.Get<JsonArray>(nameof(GlobalSettingsData.Packages)) ?? new JsonArray())
Constraints\ConstraintsExtensions.cs (4)
27JsonArray array = token.ToConstraintsJsonArray(args, true); 55JsonArray array = token.ToConstraintsJsonArray(args, false); 133private static JsonArray ToConstraintsJsonArray(this JsonNode token, string? args, bool isStringTypeAllowed) 135if (token is not JsonArray array)
parent\Shared\JExtensions.cs (8)
368token = token.Get<JsonArray>(propertyName); 371if (token is not JsonArray arr) 393token = token.Get<JsonArray>(propertyName); 396if (token is not JsonArray arr) 422token = token.Get<JsonArray>(propertyName); 425if (token is not JsonArray arr) 636else if (property.Value is JsonArray sourceArr 638&& targetNode is JsonArray targetArr)
Settings\SettingsStore.cs (2)
37if (probingPathsToken is JsonArray probingPathsArray) 55if (entry.Value is JsonArray values)
Settings\TemplateCache.cs (1)
112if (contentJObject.TryGetValueCaseInsensitive(nameof(TemplateInfo), out JsonNode? templateInfoToken) && templateInfoToken is JsonArray arr)
Settings\TemplateInfoReader.cs (8)
31JsonArray? classificationsArray = entry.Get<JsonArray>(nameof(Classifications)); 76JsonArray? parametersArray = entry.Get<JsonArray>(nameof(Parameters)); 106JsonArray? postActionsArray = entry.Get<JsonArray>(nameof(info.PostActions)); 121JsonArray? constraintsArray = entry.Get<JsonArray>(nameof(info.Constraints));
Microsoft.TemplateEngine.Orchestrator.RunnableProjects (25)
ConfigModel\CustomFileGlobModel.cs (1)
46foreach (JsonNode? operationConfig in (JsonArray)operationData!)
ConfigModel\PostActionModel.cs (3)
79internal static IReadOnlyList<PostActionModel> LoadListFromJArray(JsonArray? jArray, List<IValidationEntry> validationEntries) 144IReadOnlyList<ManualInstructionModel> manualInstructions = LoadManualInstructionsFromJArray(action.Get<JsonArray>("ManualInstructions"), validationEntries); 180private static IReadOnlyList<ManualInstructionModel> LoadManualInstructionsFromJArray(JsonArray? jArray, List<IValidationEntry> validationEntries)
ConfigModel\PrimaryOutputModel.cs (1)
30internal static IReadOnlyList<PrimaryOutputModel> ListFromJArray(JsonArray? jsonData)
ConfigModel\ReplacementContext.cs (2)
33JsonArray? onlyIf = jObject.Get<JsonArray>("onlyIf");
ConfigModel\TemplateConfigModel.cs (2)
154_postActions = PostActionModel.LoadListFromJArray(source.Get<JsonArray>("PostActions"), _validationEntries); 155PrimaryOutputs = PrimaryOutputModel.ListFromJArray(source.Get<JsonArray>(nameof(PrimaryOutputs)));
Macros\BaseMacroConfig.cs (3)
135protected static JsonArray ConvertJTokenToJArray(string token, IGeneratedSymbolConfig config, string parameterName) 144return (JsonArray)jToken; 189protected JsonArray GetMandatoryParameterArray(IGeneratedSymbolConfig config, string parameterName)
Macros\JoinMacroConfig.cs (1)
32JsonArray jArray = GetMandatoryParameterArray(generatedSymbolConfig, SymbolsPropertyName);
Macros\RegexMacroConfig.cs (1)
34JsonArray jArray = GetMandatoryParameterArray(generatedSymbolConfig, StepsPropertyName);
Macros\SwitchMacroConfig.cs (1)
33JsonArray jArray = GetMandatoryParameterArray(generatedSymbolConfig, CasesPropertyName);
OperationConfig\ReplacementConfig.cs (2)
29JsonArray? onlyIf = rawConfiguration.Get<JsonArray>("onlyIf");
parent\Shared\JExtensions.cs (8)
368token = token.Get<JsonArray>(propertyName); 371if (token is not JsonArray arr) 393token = token.Get<JsonArray>(propertyName); 396if (token is not JsonArray arr) 422token = token.Get<JsonArray>(propertyName); 425if (token is not JsonArray arr) 636else if (property.Value is JsonArray sourceArr 638&& targetNode is JsonArray targetArr)
Microsoft.TemplateEngine.Utils (8)
parent\Shared\JExtensions.cs (8)
368token = token.Get<JsonArray>(propertyName); 371if (token is not JsonArray arr) 393token = token.Get<JsonArray>(propertyName); 396if (token is not JsonArray arr) 422token = token.Get<JsonArray>(propertyName); 425if (token is not JsonArray arr) 636else if (property.Value is JsonArray sourceArr 638&& targetNode is JsonArray targetArr)
Microsoft.TemplateSearch.Common (20)
parent\Shared\JExtensions.cs (8)
368token = token.Get<JsonArray>(propertyName); 371if (token is not JsonArray arr) 393token = token.Get<JsonArray>(propertyName); 396if (token is not JsonArray arr) 422token = token.Get<JsonArray>(propertyName); 425if (token is not JsonArray arr) 636else if (property.Value is JsonArray sourceArr 638&& targetNode is JsonArray targetArr)
TemplateDiscoveryMetadata\BlobStorageTemplateInfo.cs (6)
163JsonArray? classificationsArray = entry.Get<JsonArray>(nameof(Classifications)); 194JsonArray? postActionsArray = entry.Get<JsonArray>(nameof(info.PostActions)); 211JsonArray? parametersArray = entry.Get<JsonArray>(nameof(Parameters));
TemplateDiscoveryMetadata\LegacySearchCacheReader.cs (2)
108if (templateInfoToken is JsonArray arr) 168&& identificationNode is JsonArray identificationArray)
TemplateSearchCache\TemplatePackageSearchData.Json.cs (2)
39JsonArray? templatesData = jObject.Get<JsonArray>(nameof(Templates))
TemplateSearchCache\TemplateSearchCache.Json.cs (2)
52JsonArray? data = cacheObject.Get<JsonArray>(nameof(TemplatePackages))
MSBuild (2)
JsonOutputFormatter.cs (2)
57JsonArray itemArray = new(); 96JsonArray outputArray = new();
SelectTests (6)
Program.cs (6)
660static JsonArray ToJsonArray(IEnumerable<string> values) 662var array = new JsonArray(); 673static JsonArray ItemsWithCauses(IReadOnlySet<string> items, IReadOnlyDictionary<string, IReadOnlyList<Cause>> causes) 675var array = new JsonArray(); 678var causeArray = new JsonArray(); 683JsonArray? path = null;
Shared.Tests (2)
JsonSchemaExporter\TestTypes.cs (2)
106yield return new TestData<JsonArray>([(JsonNode)1, (JsonNode)2, (JsonNode)3], """{"type":["array","null"]}"""); 1250[JsonSerializable(typeof(JsonArray))]
System.Text.Json (76)
System\Text\Json\Nodes\JsonArray.cs (21)
16/// It is safe to perform multiple concurrent read operations on a <see cref="JsonArray"/>, 29/// Initializes a new instance of the <see cref="JsonArray"/> class that is empty. 35/// Initializes a new instance of the <see cref="JsonArray"/> class that contains items from the specified params array. 38/// <param name="items">The items to add to the new <see cref="JsonArray"/>.</param> 45/// Initializes a new instance of the <see cref="JsonArray"/> class that contains items from the specified params span. 48/// <param name="items">The items to add to the new <see cref="JsonArray"/>.</param> 55/// Initializes a new instance of the <see cref="JsonArray"/> class that contains items from the specified array. 57/// <param name="items">The items to add to the new <see cref="JsonArray"/>.</param> 64/// Initializes a new instance of the <see cref="JsonArray"/> class that contains items from the specified span. 66/// <param name="items">The items to add to the new <see cref="JsonArray"/>.</param> 85var jsonArray = new JsonArray(Options) 107case JsonArray array: 183/// Initializes a new instance of the <see cref="JsonArray"/> class that contains items from the specified <see cref="JsonElement"/>. 186/// The new instance of the <see cref="JsonArray"/> class that contains items from the specified <see cref="JsonElement"/>. 193public static JsonArray? Create(JsonElement element, JsonNodeOptions? options = null) 210/// Adds an object to the end of the <see cref="JsonArray"/>. 214/// The object to be added to the end of the <see cref="JsonArray"/>. 346private readonly JsonArray _node; 348public DebugView(JsonArray node) 398JsonArray jsonArray = (JsonArray)Value;
System\Text\Json\Nodes\JsonArray.IList.cs (20)
12/// Gets the number of elements contained in the <see cref="JsonArray"/>. 17/// Adds a <see cref="JsonNode"/> to the end of the <see cref="JsonArray"/>. 20/// The <see cref="JsonNode"/> to be added to the end of the <see cref="JsonArray"/>. 30/// Removes all elements from the <see cref="JsonArray"/>. 52/// Determines whether an element is in the <see cref="JsonArray"/>. 54/// <param name="item">The object to locate in the <see cref="JsonArray"/>.</param> 56/// <see langword="true"/> if <paramref name="item"/> is found in the <see cref="JsonArray"/>; otherwise, <see langword="false"/>. 61/// The object to locate in the <see cref="JsonArray"/>. 63/// <param name="item">The <see cref="JsonNode"/> to locate in the <see cref="JsonArray"/>.</param> 70/// Inserts an element into the <see cref="JsonArray"/> at the specified index. 84/// Removes the first occurrence of a specific <see cref="JsonNode"/> from the <see cref="JsonArray"/>. 87/// The <see cref="JsonNode"/> to remove from the <see cref="JsonArray"/>. 104/// Removes the element at the specified index of the <see cref="JsonArray"/>. 121/// <returns>The number of elements removed from the <see cref="JsonArray"/>.</returns> 144/// Removes a range of elements from the <see cref="JsonArray"/>. 152/// <paramref name="index"/> and <paramref name="count"/> do not denote a valid range of elements in the <see cref="JsonArray"/>. 194/// from <see cref="JsonArray"/>. The Array must have zero-based indexing.</param> 211/// Returns an enumerator that iterates through the <see cref="JsonArray"/>. 217/// Returns an enumerator that iterates through the <see cref="JsonArray"/>. 220/// A <see cref="IEnumerator"/> for the <see cref="JsonArray"/>.
System\Text\Json\Nodes\JsonNode.cs (17)
55/// Casts to the derived <see cref="JsonArray"/> type. 58/// A <see cref="JsonArray"/>. 61/// The node is not a <see cref="JsonArray"/>. 63public JsonArray AsArray() 65JsonArray? jArray = this as JsonArray; 69ThrowHelper.ThrowInvalidOperationException_NodeWrongType(nameof(JsonArray)); 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)); 284/// Returns index of the current node from the parent <see cref="JsonArray" />. 287/// The current parent is not a <see cref="JsonArray"/>. 291JsonArray? parentArray = _parent as JsonArray; 295ThrowHelper.ThrowInvalidOperationException_NodeParentWrongType(nameof(JsonArray)); 339case JsonArray jsonArray:
System\Text\Json\Nodes\JsonObject.cs (3)
209case JsonArray: 377JsonArray jsonArray = (JsonArray)Value;
System\Text\Json\Schema\JsonSchema.cs (4)
69public JsonArray? Enum { get; set { VerifyMutable(); field = value; } } 194var requiredArray = new JsonArray(); 225JsonArray anyOfArray = []; 325var array = new JsonArray();
System\Text\Json\Serialization\Converters\Node\JsonArrayConverter.cs (6)
10internal sealed class JsonArrayConverter : JsonConverter<JsonArray?> 12public override void Write(Utf8JsonWriter writer, JsonArray? value, JsonSerializerOptions options) 23public override JsonArray? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 38internal static JsonArray ReadAsJsonElement(ref Utf8JsonReader reader, JsonNodeOptions options) 44internal static JsonArray ReadAsJsonNode(ref Utf8JsonReader reader, JsonNodeOptions options) 48JsonArray jArray = new JsonArray(options);
System\Text\Json\Serialization\Converters\Node\JsonNodeConverterFactory.cs (1)
28if (typeof(JsonArray) == typeToConvert)
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (1)
502JsonArray enumValues = [];
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Converters.cs (3)
117/// Returns a <see cref="JsonConverter{T}"/> instance that converts <see cref="JsonArray"/> values. 120public static JsonConverter<JsonArray?> JsonArrayConverter => field ??= new JsonArrayConverter(); 141/// Returns a <see cref="JsonConverter{T}"/> instance that converts <see cref="JsonArray"/> values.
TestProject.AppHost (1)
TestProgram.cs (1)
180var endpointsJsonArray = new JsonArray();