39 instantiations of JsonArray
Aspire.Dashboard (1)
Otlp\Model\OtlpHelpers.cs (1)
138var a = new JsonArray();
Aspire.Hosting.Azure (1)
Provisioning\Provisioners\BicepProvisioner.cs (1)
482IEnumerable<string> s => new JsonArray(s.Select(s => JsonValue.Create(s)).ToArray()),
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 (1)
Schemas\OpenApiJsonSchema.Helpers.cs (1)
142var array = new JsonArray();
Microsoft.Extensions.AI (1)
ChatCompletion\ChatClientStructuredOutputExtensions.cs (1)
184{ "required", new JsonArray("data") },
Microsoft.Extensions.AI.Abstractions (5)
src\Shared\JsonSchemaExporter\JsonSchemaExporter.cs (2)
669new JsonSchema { Enum = new() { (JsonNode)"NaN", (JsonNode)"Infinity", (JsonNode)"-Infinity" } }, 752JsonArray enumValues = new();
src\Shared\JsonSchemaExporter\JsonSchemaExporter.JsonSchema.cs (3)
394var requiredArray = new JsonArray(); 425JsonArray anyOfArray = new(); 507var array = new JsonArray();
Microsoft.Extensions.AI.Evaluation.Safety (9)
ContentSafetyServicePayloadUtilities.cs (9)
153["UserTextList"] = new JsonArray([.. userTextListStrings]), 237["UserTextList"] = new JsonArray([.. userTextListStrings]), 243payload["MetricList"] = new JsonArray([.. metricNames]); 289["content"] = new JsonArray([.. contents]) 304["content"] = new JsonArray([.. contents]), 313["content"] = new JsonArray([.. contents]), 365new JsonArray( 368["messages"] = new JsonArray([.. turns.SelectMany(GetMessages)]), 375payload["MetricList"] = new JsonArray([.. metricNames]);
MSBuild (3)
JsonOutputFormatter.cs (3)
58JsonArray itemArray = new(); 94JsonArray itemArray = new(); 138JsonArray outputArray = new();
Shared (5)
JsonSchemaExporter\JsonSchemaExporter.cs (2)
669new JsonSchema { Enum = new() { (JsonNode)"NaN", (JsonNode)"Infinity", (JsonNode)"-Infinity" } }, 752JsonArray enumValues = new();
JsonSchemaExporter\JsonSchemaExporter.JsonSchema.cs (3)
394var requiredArray = new JsonArray(); 425JsonArray anyOfArray = new(); 507var array = new JsonArray();
System.Text.Json (8)
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)
203var requiredArray = new JsonArray(); 324var array = new JsonArray();
System\Text\Json\Serialization\Converters\Node\JsonArrayConverter.cs (1)
40return new JsonArray(jElement, options);
System\Text\Json\Serialization\Converters\Node\JsonNodeConverter.cs (1)
73node = new JsonArray(element, options);
TestProject.AppHost (1)
TestProgram.cs (1)
166var endpointsJsonArray = new JsonArray();
128 references to JsonArray
Aspire.Dashboard (2)
Otlp\Model\OtlpHelpers.cs (2)
136static JsonArray ConvertArray(ArrayValue value) 138var a = new JsonArray();
ConfigurationSchemaGenerator (2)
ConfigSchemaEmitter.cs (2)
596var enumNode = new JsonArray(); 759case JsonArray array:
dotnet-user-jwts (1)
Helpers\SigningKeysHandler.cs (1)
82var signingKeys = secrets[signkingKeysPropertyName].AsArray();
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (1)
UserJwtsTests.cs (1)
610var signingKeys = secretsJson[SigningKeysHandler.GetSigningKeyPropertyName("test-scheme")].AsArray();
Microsoft.AspNetCore.Http.Extensions.Tests (1)
ValidationsGenerator\ValidationsGeneratorTestBase.cs (1)
51MetadataReference.CreateFromFile(typeof(System.Text.Json.Nodes.JsonArray).Assembly.Location),
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 (2)
Extensions\JsonNodeSchemaExtensions.cs (1)
472if (jsonNode is not JsonArray jsonArray)
Schemas\OpenApiJsonSchema.Helpers.cs (1)
142var array = new JsonArray();
Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests (1)
SnapshotTestHelper.cs (1)
50MetadataReference.CreateFromFile(typeof(System.Text.Json.Nodes.JsonArray).Assembly.Location),
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Handler\Configuration\DidChangeConfigurationNotificationHandler.cs (2)
123var options = await _clientLanguageServerManager.SendRequestAsync<ConfigurationParams, JsonArray>(
Microsoft.Extensions.AI (1)
ChatCompletion\ChatClientStructuredOutputExtensions.cs (1)
244JsonValueKind.Array => JsonArray.Create(element),
Microsoft.Extensions.AI.Abstractions (14)
src\Shared\JsonSchemaExporter\JsonSchemaExporter.cs (2)
633[typeof(JsonArray)] = _ => new JsonSchema { Type = JsonSchemaType.Array }, 752JsonArray enumValues = new();
src\Shared\JsonSchemaExporter\JsonSchemaExporter.JsonSchema.cs (5)
192public JsonArray? Enum 202private JsonArray? _enum; 394var requiredArray = new JsonArray(); 425JsonArray anyOfArray = new(); 507var array = new JsonArray();
Utilities\AIJsonUtilities.Defaults.cs (1)
90[JsonSerializable(typeof(JsonArray))]
Utilities\AIJsonUtilities.Schema.Create.cs (3)
75JsonArray? requiredProperties = null; 293if (required is not JsonArray { } requiredArray || requiredArray.Count != propertiesObj.Count) 393if (ctx.TypeInfo.NumberHandling is not JsonNumberHandling.Strict && schema["type"] is JsonArray { Count: 2 } typeArray)
Utilities\AIJsonUtilities.Schema.Transform.cs (3)
103if (schemaObj.TryGetPropertyValue(combinatorKeyword, out JsonNode? combinatorSchema) && combinatorSchema is JsonArray combinatorArray) 130JsonArray requiredProps = []; 141typeSchema is JsonArray typeArray)
Microsoft.Extensions.AI.Abstractions.Tests (4)
test\Shared\JsonSchemaExporter\TestTypes.cs (2)
109yield return new TestData<JsonArray>([(JsonNode)1, (JsonNode)2, (JsonNode)3], """{"type":["array","null"]}"""); 1238[JsonSerializable(typeof(JsonArray))]
Utilities\AIJsonUtilitiesTests.cs (2)
757Assert.Equal(((JsonArray)schemaObj["required"]!).Count, ((JsonObject)props!).Count); 760if (schemaObj.TryGetPropertyValue("type", out JsonNode? type) && type is JsonArray typeArray)
Microsoft.ML.AutoML.SourceGenerator (1)
SearchSpaceGenerator.cs (1)
40var searchSpaceJArray = jNode["search_space"].AsArray();
MSBuild (3)
JsonOutputFormatter.cs (3)
58JsonArray itemArray = new(); 94JsonArray itemArray = new(); 138JsonArray outputArray = new();
Shared (7)
JsonSchemaExporter\JsonSchemaExporter.cs (2)
633[typeof(JsonArray)] = _ => new JsonSchema { Type = JsonSchemaType.Array }, 752JsonArray enumValues = new();
JsonSchemaExporter\JsonSchemaExporter.JsonSchema.cs (5)
192public JsonArray? Enum 202private JsonArray? _enum; 394var requiredArray = new JsonArray(); 425JsonArray anyOfArray = new(); 507var array = new JsonArray();
Shared.Tests (2)
JsonSchemaExporter\TestTypes.cs (2)
109yield return new TestData<JsonArray>([(JsonNode)1, (JsonNode)2, (JsonNode)3], """{"type":["array","null"]}"""); 1238[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)
53/// Casts to the derived <see cref="JsonArray"/> type. 56/// A <see cref="JsonArray"/>. 59/// The node is not a <see cref="JsonArray"/>. 61public JsonArray AsArray() 63JsonArray? jArray = this as JsonArray; 67ThrowHelper.ThrowInvalidOperationException_NodeWrongType(nameof(JsonArray)); 118/// A parent can either be a <see cref="JsonObject"/> or a <see cref="JsonArray"/>. 208/// The current <see cref="JsonNode"/> is not a <see cref="JsonArray"/> or <see cref="JsonObject"/>. 218ThrowHelper.ThrowInvalidOperationException_NodeWrongType(nameof(JsonArray), nameof(JsonObject)); 223ThrowHelper.ThrowInvalidOperationException_NodeWrongType(nameof(JsonArray), nameof(JsonObject)); 282/// Returns index of the current node from the parent <see cref="JsonArray" />. 285/// The current parent is not a <see cref="JsonArray"/>. 289JsonArray? parentArray = _parent as JsonArray; 293ThrowHelper.ThrowInvalidOperationException_NodeParentWrongType(nameof(JsonArray)); 337case JsonArray jsonArray:
System\Text\Json\Nodes\JsonObject.cs (3)
168case JsonArray: 348JsonArray jsonArray = (JsonArray)Value;
System\Text\Json\Schema\JsonSchema.cs (5)
77public JsonArray? Enum { get => _enum; set { VerifyMutable(); _enum = value; } } 78private JsonArray? _enum; 203var requiredArray = new JsonArray(); 234JsonArray anyOfArray = []; 324var array = new JsonArray();
System\Text\Json\Serialization\Converters\Node\JsonArrayConverter.cs (4)
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) 37public static JsonArray ReadList(ref Utf8JsonReader reader, JsonNodeOptions? options = null)
System\Text\Json\Serialization\Converters\Node\JsonNodeConverterFactory.cs (1)
24if (typeof(JsonArray) == typeToConvert)
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (1)
502JsonArray enumValues = [];
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Converters.cs (4)
129/// Returns a <see cref="JsonConverter{T}"/> instance that converts <see cref="JsonArray"/> values. 132public static JsonConverter<JsonArray?> JsonArrayConverter => s_jsonArrayConverter ??= new JsonArrayConverter(); 133private 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)
166var endpointsJsonArray = new JsonArray();