59 instantiations of JsonArray
aspire (12)
Agents\ClaudeCode\ClaudeCodeAgentEnvironmentScanner.cs (2)
279
["args"] = new
JsonArray
("mcp", "start")
320
["args"] = new
JsonArray
("-y", "@playwright/mcp@latest")
Agents\CopilotCli\CopilotCliAgentEnvironmentScanner.cs (4)
242
["args"] = new
JsonArray
("mcp", "start"),
247
["tools"] = new
JsonArray
("*")
297
["args"] = new
JsonArray
("-y", "@playwright/mcp@latest"),
298
["tools"] = new
JsonArray
("*")
Agents\OpenCode\OpenCodeAgentEnvironmentScanner.cs (2)
227
["command"] = new
JsonArray
("aspire", "mcp", "start"),
275
["command"] = new
JsonArray
("npx", "-y", "@playwright/mcp@latest"),
Agents\VsCode\VsCodeAgentEnvironmentScanner.cs (2)
313
["args"] = new
JsonArray
("mcp", "start")
361
["args"] = new
JsonArray
("-y", "@playwright/mcp@latest")
Projects\FallbackProjectParser.cs (2)
127
var packageRefArray = new
JsonArray
();
138
var projectRefArray = new
JsonArray
();
Aspire.Cli.Tests (4)
Projects\ProjectUpdaterTests.cs (4)
2569
items.Add("ProjectReference", new
JsonArray
());
2570
items.Add("PackageReference", new
JsonArray
());
2579
items.Add("ProjectReference", new
JsonArray
());
2583
items.Add("PackageReference", new
JsonArray
());
Aspire.Dashboard (1)
Otlp\Model\OtlpHelpers.cs (1)
140
var a = new
JsonArray
();
Aspire.Hosting.Azure (1)
Provisioning\BicepUtilities.cs (1)
50
IEnumerable<string> s => new
JsonArray
(s.Select(s => JsonValue.Create(s)).ToArray()),
Aspire.Hosting.Tests (6)
JsonFlattenerTests.cs (6)
140
["SimpleArray"] = new
JsonArray
("value1", "value2", "value3"),
141
["NumberArray"] = new
JsonArray
(1, 2, 3),
142
["MixedArray"] = new
JsonArray
("text", 42, true, null)
169
["ObjectArray"] = new
JsonArray
(
175
["Items"] = new
JsonArray
(
204
["EmptyArray"] = new
JsonArray
(),
ConfigurationSchemaGenerator (3)
ConfigSchemaEmitter.cs (3)
596
var enumNode = new
JsonArray
();
620
propertyNode["type"] = new
JsonArray
{ "number", "string" };
630
propertyNode["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 (3)
Schemas\OpenApiJsonSchema.Helpers.cs (1)
140
var array = new
JsonArray
();
Services\Schemas\OpenApiSchemaService.cs (2)
218
var array = new
JsonArray
();
508
var newArray = new
JsonArray
();
Microsoft.Extensions.AI (1)
ChatCompletion\ChatClientStructuredOutputExtensions.cs (1)
168
{ "required", new
JsonArray
("data") },
Microsoft.Extensions.AI.Abstractions (4)
Utilities\AIJsonUtilities.Schema.Create.cs (4)
310
obj[TypePropertyName] = new
JsonArray
{ (JsonNode)numericType, (JsonNode)"null" };
331
objSchema[TypePropertyName] = new
JsonArray
{ (JsonNode)typeValue, (JsonNode)"null" };
338
objSchema.InsertAtStart(TypePropertyName, new
JsonArray
{ (JsonNode)"string", (JsonNode)"null" });
587
JsonArray enumArray =
new
();
Microsoft.Extensions.AI.Evaluation.Quality (3)
AIToolExtensions.cs (1)
20
var toolDefinitionsJsonArray = new
JsonArray
();
ChatMessageExtensions.cs (1)
17
var messagesJsonArray = new
JsonArray
();
ChatResponseExtensions.cs (1)
27
var toolCallsAndResultsJsonArray = new
JsonArray
();
Microsoft.Extensions.AI.Evaluation.Safety (10)
ContentSafetyServicePayloadUtilities.cs (10)
151
["UserTextList"] = new
JsonArray
([.. userTextListStrings]),
157
payload["MetricList"] = new
JsonArray
([.. metricNames]);
233
["UserTextList"] = new
JsonArray
([.. userTextListStrings]),
239
payload["MetricList"] = new
JsonArray
([.. metricNames]);
285
["content"] = new
JsonArray
([.. contents])
300
["content"] = new
JsonArray
([.. contents]),
309
["content"] = new
JsonArray
([.. contents]),
361
new
JsonArray
(
364
["messages"] = new
JsonArray
([.. turns.SelectMany(GetMessages)]),
371
payload["MetricList"] = new
JsonArray
([.. metricNames]);
System.Text.Json (9)
System\Text\Json\Nodes\JsonArray.cs (4)
81
? new
JsonArray
(jsonElement.Value.Clone(), Options)
82
: new
JsonArray
(Options);
85
var jsonArray = new
JsonArray
(Options)
198
JsonValueKind.Array => new
JsonArray
(element, options),
System\Text\Json\Schema\JsonSchema.cs (2)
203
var requiredArray = new
JsonArray
();
324
var array = new
JsonArray
();
System\Text\Json\Serialization\Converters\Node\JsonArrayConverter.cs (2)
41
return new
JsonArray
(jElement, options);
48
JsonArray jArray = new
JsonArray
(options);
System\Text\Json\Serialization\Converters\Node\JsonNodeConverter.cs (1)
92
node = new
JsonArray
(element, options);
TestProject.AppHost (1)
TestProgram.cs (1)
178
var endpointsJsonArray = new
JsonArray
();
148 references to JsonArray
aspire (2)
Projects\FallbackProjectParser.cs (2)
127
var
packageRefArray = new JsonArray();
138
var
projectRefArray = new JsonArray();
Aspire.Cli.Tests (6)
Agents\CopilotCliAgentEnvironmentScannerTests.cs (2)
70
var
args = aspireServer["args"]?.AsArray();
83
var
tools = aspireServer["tools"]?.AsArray();
Agents\VsCodeAgentEnvironmentScannerTests.cs (1)
156
var
args = aspireServer["args"]?.AsArray();
Projects\ProjectUpdaterTests.cs (3)
2594
var
packageReferences = items["PackageReference"]!.AsArray();
2610
var
packageReferences = items["PackageReference"]!.AsArray();
2626
var
projectReferences = items["ProjectReference"]!.AsArray();
Aspire.Dashboard (6)
Model\GenAI\GenAIItemPartViewModel.cs (1)
70
JsonArray
arr when arr.Count == 0 => string.Empty,
Model\GenAI\GenAIVisualizerDialogViewModel.cs (3)
86
if (jsonNode is
JsonArray
array)
566
if (schemaObj["required"] is
JsonArray
requiredArray)
579
if (schemaObj["enum"] is
JsonArray
enumArray)
Otlp\Model\OtlpHelpers.cs (2)
138
static
JsonArray
ConvertArray(ArrayValue value)
140
var
a = new JsonArray();
Aspire.Dashboard.Tests (8)
Integration\McpConfigurationTests.cs (2)
53
var
inputsArray = parsed!["inputs"]?.AsArray();
118
var
inputsArray = parsed["inputs"]?.AsArray();
Integration\McpServiceTests.cs (5)
45
var
tools = jsonResponse["result"]!["tools"]!.AsArray();
119
var
tools = jsonResponse["result"]!["tools"]!.AsArray();
143
var
tools = jsonResponse["result"]!["tools"]!.AsArray();
179
var
tools = jsonResponse["result"]!["tools"]!.AsArray();
239
var
tools = jsonResponse["result"]!["tools"]!.AsArray();
Integration\StartupTests.cs (1)
427
var
tools = jsonResponse["result"]!["tools"]!.AsArray();
Aspire.Hosting (1)
Pipelines\Internal\JsonFlattener.cs (1)
76
else if (kvp.Value is
JsonArray
array)
Aspire.Hosting.Azure (3)
AzureBicepResource.cs (3)
394
if (errorObj["details"] is
JsonArray
detailsArray && detailsArray.Count > 0)
426
private static string ExtractDeepestErrorMessage(
JsonArray
detailsArray)
435
if (detailObj["details"] is
JsonArray
nestedDetailsArray && nestedDetailsArray.Count > 0)
ConfigurationSchemaGenerator (2)
ConfigSchemaEmitter.cs (2)
596
var
enumNode = new JsonArray();
759
case
JsonArray
array:
dotnet-user-jwts (1)
Helpers\SigningKeysHandler.cs (1)
82
var
signingKeys = secrets[signkingKeysPropertyName].AsArray();
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (1)
UserJwtsTests.cs (1)
610
var
signingKeys = secretsJson[SigningKeysHandler.GetSigningKeyPropertyName("test-scheme")].AsArray();
Microsoft.AspNetCore.JsonPatch.SystemTextJson (7)
Adapters\AdapterFactory.cs (1)
34
JsonArray
=> new ListAdapter(),
Helpers\GenericListOrJsonArrayUtilities.cs (6)
19
if (list is
JsonArray
array)
33
else if (list is
JsonArray
array)
50
if (list is
JsonArray
jsonArray)
64
else if (list is
JsonArray
array)
80
else if (list is
JsonArray
array)
96
else if (list is
JsonArray
array)
Microsoft.AspNetCore.OpenApi (7)
Extensions\JsonNodeSchemaExtensions.cs (2)
511
schema[OpenApiSchemaKeywords.TypeKeyword] is
JsonArray
typeArray)
529
if (jsonNode is not
JsonArray
jsonArray)
Schemas\OpenApiJsonSchema.Helpers.cs (1)
140
var
array = new JsonArray();
Services\Schemas\OpenApiSchemaService.cs (4)
216
static
JsonArray
JsonArray(ReadOnlySpan<JsonNode> values)
218
var
array = new JsonArray();
506
else if (node is
JsonArray
jsonArray)
508
var
newArray = new JsonArray();
Microsoft.AspNetCore.OpenApi.Tests (1)
Services\OpenApiSchemaService\OpenApiSchemaService.ParameterSchemas.cs (1)
833
Assert.IsType<
JsonArray
>(param.Schema.Default);
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Handler\Configuration\DidChangeConfigurationNotificationHandler.cs (2)
124
var
options = await _clientLanguageServerManager.SendRequestAsync<ConfigurationParams,
JsonArray
>(
Microsoft.Extensions.AI (1)
ChatCompletion\ChatClientStructuredOutputExtensions.cs (1)
224
JsonValueKind.Array =>
JsonArray
.Create(element),
Microsoft.Extensions.AI.Abstractions (10)
Utilities\AIJsonUtilities.cs (1)
166
case
JsonArray
array:
Utilities\AIJsonUtilities.Defaults.cs (1)
87
[JsonSerializable(typeof(
JsonArray
))]
Utilities\AIJsonUtilities.Schema.Create.cs (5)
87
JsonArray
? requiredProperties = null;
585
static
JsonArray
CreateJsonArray(object?[] values, JsonSerializerOptions serializerOptions)
587
JsonArray
enumArray = new();
650
foreach (JsonNode? entry in (
JsonArray
)typeNode)
703
if (ctx.TypeInfo.NumberHandling is not JsonNumberHandling.Strict && schema["type"] is
JsonArray
typeArray)
Utilities\AIJsonUtilities.Schema.Transform.cs (3)
108
if (schemaObj.TryGetPropertyValue(combinatorKeyword, out JsonNode? combinatorSchema) && combinatorSchema is
JsonArray
combinatorArray)
135
JsonArray
requiredProps = [];
146
typeSchema is
JsonArray
typeArray)
Microsoft.Extensions.AI.Abstractions.Tests (4)
test\Shared\JsonSchemaExporter\TestTypes.cs (2)
106
yield return new TestData<
JsonArray
>([(JsonNode)1, (JsonNode)2, (JsonNode)3], """{"type":["array","null"]}""");
1250
[JsonSerializable(typeof(
JsonArray
))]
Utilities\AIJsonUtilitiesTests.cs (2)
1490
Assert.Equal(((
JsonArray
)schemaObj["required"]!).Count, ((JsonObject)props!).Count);
1493
if (schemaObj.TryGetPropertyValue("type", out JsonNode? type) && type is
JsonArray
typeArray)
Microsoft.Extensions.AI.Evaluation.Quality (3)
AIToolExtensions.cs (1)
20
var
toolDefinitionsJsonArray = new JsonArray();
ChatMessageExtensions.cs (1)
17
var
messagesJsonArray = new JsonArray();
ChatResponseExtensions.cs (1)
27
var
toolCallsAndResultsJsonArray = new JsonArray();
Microsoft.Extensions.Validation.GeneratorTests (1)
ValidationsGeneratorTestBase.cs (1)
54
MetadataReference.CreateFromFile(typeof(System.Text.Json.Nodes.
JsonArray
).Assembly.Location),
Microsoft.ML.AutoML.SourceGenerator (1)
SearchSpaceGenerator.cs (1)
40
var
searchSpaceJArray = jNode["search_space"].AsArray();
Shared.Tests (2)
JsonSchemaExporter\TestTypes.cs (2)
106
yield return new TestData<
JsonArray
>([(JsonNode)1, (JsonNode)2, (JsonNode)3], """{"type":["array","null"]}""");
1250
[JsonSerializable(typeof(
JsonArray
))]
System.Text.Json (78)
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>
85
var
jsonArray = new JsonArray(Options)
107
case
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"/>.
193
public 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
"/>.
346
private readonly
JsonArray
_node;
348
public DebugView(
JsonArray
node)
398
JsonArray
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
"/>.
63
public
JsonArray
AsArray()
65
JsonArray
? jArray = this as
JsonArray
;
69
ThrowHelper.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"/>.
220
ThrowHelper.ThrowInvalidOperationException_NodeWrongType(nameof(
JsonArray
), nameof(JsonObject));
225
ThrowHelper.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
"/>.
291
JsonArray
? parentArray = _parent as
JsonArray
;
295
ThrowHelper.ThrowInvalidOperationException_NodeParentWrongType(nameof(
JsonArray
));
339
case
JsonArray
jsonArray:
System\Text\Json\Nodes\JsonObject.cs (3)
200
case
JsonArray
:
377
JsonArray
jsonArray = (
JsonArray
)Value;
System\Text\Json\Schema\JsonSchema.cs (5)
77
public
JsonArray
? Enum { get => _enum; set { VerifyMutable(); _enum = value; } }
78
private
JsonArray
? _enum;
203
var
requiredArray = new JsonArray();
234
JsonArray
anyOfArray = [];
324
var
array = new JsonArray();
System\Text\Json\Serialization\Converters\Node\JsonArrayConverter.cs (6)
10
internal sealed class JsonArrayConverter : JsonConverter<
JsonArray
?>
12
public override void Write(Utf8JsonWriter writer,
JsonArray
? value, JsonSerializerOptions options)
23
public override
JsonArray
? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
38
internal static
JsonArray
ReadAsJsonElement(ref Utf8JsonReader reader, JsonNodeOptions options)
44
internal static
JsonArray
ReadAsJsonNode(ref Utf8JsonReader reader, JsonNodeOptions options)
48
JsonArray
jArray = new JsonArray(options);
System\Text\Json\Serialization\Converters\Node\JsonNodeConverterFactory.cs (1)
28
if (typeof(
JsonArray
) == typeToConvert)
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (1)
502
JsonArray
enumValues = [];
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Converters.cs (4)
129
/// Returns a <see cref="JsonConverter{T}"/> instance that converts <see cref="
JsonArray
"/> values.
132
public static JsonConverter<
JsonArray
?> JsonArrayConverter => s_jsonArrayConverter ??= new JsonArrayConverter();
133
private static JsonConverter<
JsonArray
?>? s_jsonArrayConverter;
157
/// Returns a <see cref="JsonConverter{T}"/> instance that converts <see cref="
JsonArray
"/> values.
TestProject.AppHost (1)
TestProgram.cs (1)
178
var
endpointsJsonArray = new JsonArray();