7 types derived from JsonNode
System.Text.Json (7)
System\Text\Json\Nodes\JsonArray.cs (1)
21public sealed partial class JsonArray : JsonNode
System\Text\Json\Nodes\JsonArray.IList.cs (2)
9public sealed partial class JsonArray : JsonNode, IList<JsonNode?>
System\Text\Json\Nodes\JsonObject.cs (1)
19public sealed partial class JsonObject : JsonNode
System\Text\Json\Nodes\JsonObject.IDictionary.cs (1)
11public partial class JsonObject : IDictionary<string, JsonNode?>
System\Text\Json\Nodes\JsonObject.IList.cs (1)
9public partial class JsonObject : IList<KeyValuePair<string, JsonNode?>>
System\Text\Json\Nodes\JsonValue.cs (1)
14public abstract partial class JsonValue : JsonNode
1091 references to JsonNode
aspire (3)
Configuration\ConfigurationService.cs (3)
23settings = JsonNode.Parse(existingContent)?.AsObject() ?? new JsonObject(); 57var settings = JsonNode.Parse(existingContent)?.AsObject(); 131var settings = JsonNode.Parse(content)?.AsObject();
Aspire.Cli.Tests (5)
Commands\ConfigCommandTests.cs (5)
45var settings = JsonNode.Parse(json)?.AsObject(); 68var settings = JsonNode.Parse(json)?.AsObject(); 93var settings = JsonNode.Parse(json)?.AsObject(); 125var settings = JsonNode.Parse(json)?.AsObject(); 245var settings = JsonNode.Parse(json)?.AsObject();
Aspire.Components.Common.TestUtilities (4)
ConformanceTests.cs (4)
337var config = JsonNode.Parse(ValidJsonConfig); 351var config = JsonNode.Parse(json);
Aspire.Dashboard (1)
Otlp\Model\OtlpHelpers.cs (1)
121private static JsonNode? ConvertAnyValue(AnyValue value)
Aspire.Hosting (4)
Dcp\DcpExecutor.cs (2)
1701var current = JsonSerializer.SerializeToNode(obj); 1706var changed = JsonSerializer.SerializeToNode(copy);
Devcontainers\DevcontainerSettingsWriter.cs (2)
80if (!settings.TryGetPropertyValue(PortAttributesFieldName, out var portsAttributesNode)) 119if (!portsAttributes.TryGetPropertyValue(port, out var portAttributeNode))
Aspire.Hosting.Azure (14)
AzureBicepResource.cs (1)
185if (inputValue is JsonNode || inputValue is IEnumerable<string>)
AzureBicepResourceExtensions.cs (1)
179public static IResourceBuilder<T> WithParameter<T>(this IResourceBuilder<T> builder, string name, JsonNode value)
Provisioning\BicepUtilities.cs (3)
53JsonNode node => node, 114var parameters = JsonNode.Parse(jsonString)?.AsObject(); 116? JsonNode.Parse(scopeString)?.AsObject()
Provisioning\Internal\DefaultProvisioningContextProvider.cs (1)
136var azureSection = userSecrets.Prop("Azure");
Provisioning\Internal\DefaultUserSecretsManager.cs (1)
41? JsonNode.Parse(await File.ReadAllTextAsync(userSecretsPath, cancellationToken).ConfigureAwait(false),
Provisioning\JsonExtensions.cs (3)
10public static JsonNode Prop(this JsonNode obj, string key) 12var node = obj[key];
Provisioning\Provisioners\BicepProvisioner.cs (4)
41JsonNode? outputObj = null; 44outputObj = JsonNode.Parse(outputJson); 212var az = context.UserSecrets.Prop("Azure"); 215var resourceConfig = context.UserSecrets
Aspire.Hosting.Azure.EventHubs (5)
AzureEventHubsExtensions.cs (3)
290var tempConfig = JsonNode.Parse(CreateEmulatorConfigJson(builder.Resource)); 404public static IResourceBuilder<AzureEventHubsEmulatorResource> WithConfiguration(this IResourceBuilder<AzureEventHubsEmulatorResource> builder, Action<JsonNode> configJson)
ConfigJsonAnnotation.cs (2)
14public ConfigJsonAnnotation(Action<JsonNode> configure) 19public Action<JsonNode> Configure { get; }
Aspire.Hosting.Azure.ServiceBus (5)
AzureServiceBusExtensions.cs (3)
427var tempConfig = JsonNode.Parse(CreateEmulatorConfigJson(builder.Resource)); 502public static IResourceBuilder<AzureServiceBusEmulatorResource> WithConfiguration(this IResourceBuilder<AzureServiceBusEmulatorResource> builder, Action<JsonNode> configJson)
ConfigJsonAnnotation.cs (2)
14public ConfigJsonAnnotation(Action<JsonNode> configure) 19public Action<JsonNode> Configure { get; }
Aspire.Hosting.Azure.Tests (32)
AzureAppServiceTests.cs (1)
357private static Task<(JsonNode ManifestNode, string BicepText)> GetManifestWithBicep(IResource resource) =>
AzureBicepResourceTests.cs (1)
188var manifest = await ManifestUtils.GetManifest(bicepResource.Resource);
AzureContainerAppsTests.cs (1)
1457private static Task<(JsonNode ManifestNode, string BicepText)> GetManifestWithBicep(IResource resource) =>
AzureFunctionsTests.cs (1)
418private static Task<(JsonNode ManifestNode, string BicepText)> GetManifestWithBicep(IResource resource) =>
AzureInfrastructureExtensionsTests.cs (3)
27var manifest = await ManifestUtils.GetManifest(infrastructure1.Resource); 52var manifest = await ManifestUtils.GetManifest(infrastructure1.Resource); 91var manifest = await ManifestUtils.GetManifest(infrastructure1.Resource);
AzureManifestUtils.cs (5)
14public static Task<(JsonNode ManifestNode, string BicepText)> GetManifestWithBicep(IResource resource, bool skipPreparer = false) => 17public static Task<(JsonNode ManifestNode, string BicepText)> GetManifestWithBicep(DistributedApplicationModel appModel, IResource resource) => 20private static async Task<(JsonNode ManifestNode, string BicepText)> GetManifestWithBicep(DistributedApplicationModel appModel, IResource resource, bool skipPreparer) 30var manifestNode = await ManifestUtils.GetManifest(resource, manifestDir); 32if (!manifestNode.AsObject().TryGetPropertyValue("path", out var pathNode))
AzurePostgresExtensionsTests.cs (1)
434var manifest = await ManifestUtils.GetManifest(postgres.Resource);
AzureStorageExtensionsTests.cs (12)
488var blobManifest = await ManifestUtils.GetManifest(blob.Resource); 503var queueManifest = await ManifestUtils.GetManifest(queue.Resource); 518var tableManifest = await ManifestUtils.GetManifest(table.Resource); 573var blobManifest = await ManifestUtils.GetManifest(blob.Resource); 588var queueManifest = await ManifestUtils.GetManifest(queue.Resource); 603var tableManifest = await ManifestUtils.GetManifest(table.Resource); 711var blobManifest = await ManifestUtils.GetManifest(blob.Resource); 724var queueManifest = await ManifestUtils.GetManifest(queue.Resource); 737var tableManifest = await ManifestUtils.GetManifest(table.Resource); 793var blobManifest = await ManifestUtils.GetManifest(blob.Resource); 808var queueManifest = await ManifestUtils.GetManifest(queue.Resource); 823var tableManifest = await ManifestUtils.GetManifest(table.Resource);
ProvisioningContextTests.cs (2)
195var parsed = JsonNode.Parse(result);
PublicApiTests\EventHubsPublicApiTests.cs (2)
359Action<JsonNode> configJson = (_) => { }; 372Action<JsonNode> configJson = null!;
PublicApiTests\ServiceBusPublicApiTests.cs (2)
291Action<JsonNode> configJson = (_) => { }; 304Action<JsonNode> configJson = null!;
RoleAssignmentTests.cs (1)
226private static Task<(JsonNode ManifestNode, string BicepText)> GetManifestWithBicep(IResource resource) =>
Aspire.Hosting.Containers.Tests (9)
ContainerResourceTests.cs (5)
126var manifest = await ManifestUtils.GetManifest(c2.Resource); 156var manifest = await ManifestUtils.GetManifest(containerResource); 190var manifest = await ManifestUtils.GetManifest(containerResource); 237var manifest = await ManifestUtils.GetManifest(containerResource); 286var manifest = await ManifestUtils.GetManifest(containerResource, manifestDirectory: appHostPath);
WithDockerfileTests.cs (4)
251var manifest = await ManifestUtils.GetManifest(container.Resource, manifestDirectory: tempContextPath); 298var manifest = await ManifestUtils.GetManifest(container.Resource, manifestDirectory: tempContextPath); 344var manifest = await ManifestUtils.GetManifest(container.Resource, manifestDirectory: tempContextPath); 389var manifest = await ManifestUtils.GetManifest(container.Resource, manifestDirectory: tempContextPath);
Aspire.Hosting.Garnet.Tests (3)
AddGarnetTests.cs (3)
93var manifest = await ManifestUtils.GetManifest(garnet.Resource); 133var manifest = await ManifestUtils.GetManifest(garnet.Resource); 169var manifest = await ManifestUtils.GetManifest(garnet.Resource);
Aspire.Hosting.Kafka.Tests (1)
AddKafkaTests.cs (1)
80var manifest = await ManifestUtils.GetManifest(kafka.Resource);
Aspire.Hosting.Keycloak.Tests (1)
KeycloakResourceBuilderTests.cs (1)
114var manifest = await ManifestUtils.GetManifest(keycloak.Resource);
Aspire.Hosting.Milvus.Tests (2)
AddMilvusTests.cs (2)
132var serverManifest = await ManifestUtils.GetManifest(milvus.Resource); // using this method does not get any ExecutionContext.IsPublishMode changes 133var dbManifest = await ManifestUtils.GetManifest(db1.Resource);
Aspire.Hosting.MongoDB.Tests (2)
AddMongoDBTests.cs (2)
199var mongoManifest = await ManifestUtils.GetManifest(mongo.Resource); 200var dbManifest = await ManifestUtils.GetManifest(db.Resource);
Aspire.Hosting.MySql.Tests (3)
AddMySqlTests.cs (3)
159var mySqlManifest = await ManifestUtils.GetManifest(mysql.Resource); 160var dbManifest = await ManifestUtils.GetManifest(db.Resource); 198var serverManifest = await ManifestUtils.GetManifest(mysql.Resource);
Aspire.Hosting.Nats.Tests (2)
AddNatsTests.cs (2)
193var manifest = await ManifestUtils.GetManifest(nats.Resource); 230var manifest = await ManifestUtils.GetManifest(nats.Resource);
Aspire.Hosting.NodeJs.Tests (1)
AddNodeAppTests.cs (1)
18var manifest = await ManifestUtils.GetManifest(nodeApp.Resource);
Aspire.Hosting.Oracle.Tests (3)
AddOracleTests.cs (3)
199var serverManifest = await ManifestUtils.GetManifest(oracleServer.Resource); 200var dbManifest = await ManifestUtils.GetManifest(db.Resource); 238var serverManifest = await ManifestUtils.GetManifest(oracleServer.Resource);
Aspire.Hosting.PostgreSQL.Tests (3)
AddPostgresTests.cs (3)
250var serverManifest = await ManifestUtils.GetManifest(pgServer.Resource); 251var dbManifest = await ManifestUtils.GetManifest(db.Resource); 294var serverManifest = await ManifestUtils.GetManifest(pgServer.Resource);
Aspire.Hosting.Python.Tests (2)
AddPythonAppTests.cs (2)
34var manifest = await ManifestUtils.GetManifest(pyproj.Resource, manifestDirectory: projectDirectory); 66var manifest = await ManifestUtils.GetManifest(pyproj.Resource, manifestDirectory: projectDirectory);
Aspire.Hosting.Qdrant.Tests (2)
AddQdrantTests.cs (2)
206var serverManifest = await ManifestUtils.GetManifest(qdrant.Resource); // using this method does not get any ExecutionContext.IsPublishMode changes 244var serverManifest = await ManifestUtils.GetManifest(qdrant.Resource); // using this method does not get any ExecutionContext.IsPublishMode changes
Aspire.Hosting.RabbitMQ.Tests (2)
AddRabbitMQTests.cs (2)
207var manifest = await ManifestUtils.GetManifest(rabbit.Resource); 253var manifest = await ManifestUtils.GetManifest(rabbit.Resource);
Aspire.Hosting.Redis.Tests (7)
AddRedisTests.cs (4)
135var manifest = await ManifestUtils.GetManifest(redis.Resource); 169var manifest = await ManifestUtils.GetManifest(redis.Resource); 204var manifest = await ManifestUtils.GetManifest(redis.Resource); 239var manifest = await ManifestUtils.GetManifest(redis.Resource);
RedisFunctionalTests.cs (3)
560var jo = JsonNode.Parse(content); 562var agreements = jo["agreements"];
Aspire.Hosting.Seq.Tests (1)
AddSeqTests.cs (1)
92var manifest = await ManifestUtils.GetManifest(seq.Resource);
Aspire.Hosting.SqlServer.Tests (3)
AddSqlServerTests.cs (3)
129var serverManifest = await ManifestUtils.GetManifest(sqlServer.Resource); 130var dbManifest = await ManifestUtils.GetManifest(db.Resource); 170var serverManifest = await ManifestUtils.GetManifest(sqlServer.Resource);
Aspire.Hosting.Tests (58)
AddParameterTests.cs (6)
107var paramManifest = await ManifestUtils.GetManifest(appModel.Resources.OfType<ParameterResource>().Single(r => r.Name == "pass")).DefaultTimeout(); 159var paramManifest = await ManifestUtils.GetManifest(appModel.Resources.OfType<ParameterResource>().Single(r => r.Name == "pass")).DefaultTimeout(); 229var paramManifest = await ManifestUtils.GetManifest(appModel.Resources.OfType<ParameterResource>().Single(r => r.Name == "pass")).DefaultTimeout(); 286var paramManifest = await ManifestUtils.GetManifest(appModel.Resources.OfType<ParameterResource>().Single(r => r.Name == "val")).DefaultTimeout(); 314var connectionStringManifest = await ManifestUtils.GetManifest(connectionStringResource).DefaultTimeout(); 352var connectionStringManifest = await ManifestUtils.GetManifest(connectionStringResource).DefaultTimeout();
Dashboard\DashboardResourceTests.cs (1)
541var manifest = await ManifestUtils.GetManifestOrNull(dashboard).DefaultTimeout();
ExecutableResourceTests.cs (1)
60var manifest = await ManifestUtils.GetManifest(exe2.Resource).DefaultTimeout();
KestrelConfigTests.cs (4)
176var manifest = await ManifestUtils.GetManifest(resource).DefaultTimeout(); 220var manifest = await ManifestUtils.GetManifest(resource).DefaultTimeout(); 291var manifest = await ManifestUtils.GetManifest(resource).DefaultTimeout(); 313var manifest = await ManifestUtils.GetManifest(resource).DefaultTimeout();
ManifestGenerationTests.cs (2)
99var redisManifest = await ManifestUtils.GetManifest(redis.Resource).DefaultTimeout(); 523var manifest = await ManifestUtils.GetManifest(param.Resource).DefaultTimeout();
ProjectResourceTests.cs (2)
485var manifest = await ManifestUtils.GetManifest(resource).DefaultTimeout(); 535var manifest = await ManifestUtils.GetManifest(resource).DefaultTimeout();
PublishAsConnectionStringTests.cs (1)
20var manifest = await ManifestUtils.GetManifest(redis.Resource).DefaultTimeout();
PublishAsDockerfileTests.cs (5)
28var manifest = await ManifestUtils.GetManifest(frontend.Resource, manifestDirectory: path).DefaultTimeout(); 74var manifest = await ManifestUtils.GetManifest(frontend.Resource, manifestDirectory: path).DefaultTimeout(); 123var manifest = await ManifestUtils.GetManifest(frontend.Resource, manifestDirectory: path).DefaultTimeout(); 172var manifest = await ManifestUtils.GetManifest(frontend.Resource, manifestDirectory: path).DefaultTimeout(); 232var manifest = await ManifestUtils.GetManifest(project.Resource, manifestDirectory: path).DefaultTimeout();
Schema\SchemaTests.cs (16)
242var manifestJson = JsonNode.Parse(manifestText); 276var manifestJson = JsonNode.Parse(manifestText); 296var manifestJson = JsonNode.Parse(manifestText); 315var manifestJson = JsonNode.Parse(manifestText); 355var manifestJson = JsonNode.Parse(manifestText); 378var manifestJson = JsonNode.Parse(manifestText); 756var manifestJson = JsonNode.Parse(manifestText); 769var manifestJson = JsonNode.Parse(manifestText);
Utils\ManifestUtils.cs (11)
12public static async Task<JsonNode> GetManifest(IResource resource, string? manifestDirectory = null) 14var node = await GetManifestOrNull(resource, manifestDirectory); 19public static async Task<JsonNode?> GetManifestOrNull(IResource resource, string? manifestDirectory = null) 32var obj = JsonNode.Parse(ms); 34var resourceNode = obj[resource.Name]; 38public static async Task<JsonNode[]> GetManifests(IResource[] resources) 45var results = new List<JsonNode>(); 54var obj = JsonNode.Parse(ms); 56var resourceNode = obj[r.Name];
WithEndpointTests.cs (9)
271var manifest = await ManifestUtils.GetManifest(container.Resource).DefaultTimeout(); 299var manifest = await ManifestUtils.GetManifest(container.Resource).DefaultTimeout(); 326var manifest = await ManifestUtils.GetManifest(container.Resource).DefaultTimeout(); 353var manifest = await ManifestUtils.GetManifest(container.Resource).DefaultTimeout(); 380var manifest = await ManifestUtils.GetManifest(container.Resource).DefaultTimeout(); 407var manifest = await ManifestUtils.GetManifest(container.Resource).DefaultTimeout(); 434var manifest = await ManifestUtils.GetManifest(container.Resource).DefaultTimeout(); 465var manifest = await ManifestUtils.GetManifest(project.Resource).DefaultTimeout(); 535var manifest = await ManifestUtils.GetManifest(project.Resource).DefaultTimeout();
Aspire.Hosting.Valkey.Tests (2)
AddValkeyTests.cs (2)
127var manifest = await ManifestUtils.GetManifest(valkey.Resource); 165var manifest = await ManifestUtils.GetManifest(valkey.Resource);
Aspire.Hosting.Yarp (3)
YarpJsonConfigGeneratorBuilder.cs (3)
84var jsonProxyConfig = jsonObject["ReverseProxy"] = new JsonObject(); 100var node = JsonSerializer.SerializeToNode(route, _serializerOptions); 114var node = JsonSerializer.SerializeToNode(cluster, _serializerOptions);
ConfigurationSchemaGenerator (15)
ConfigSchemaEmitter.cs (15)
119var backupTypeNode = currentNode["type"]; 174var existingValue = propertiesNode[pathSegment]; 240var backupTypeNode = currentNode["type"]; 284var backupPropertyNode = currentNode[property.ConfigurationKeyName]; 315var backupTypeNode = currentNode["type"]; 316var backupContainerNode = currentNode[containerName]; 334private static void RestoreBackup(JsonNode? backupNode, string name, JsonObject parentNode) 449var propertyNodeType = propertyNode["type"]; 718private static void ReplaceNodeWithKeyCasingChange(JsonObject jsonObject, string key, JsonNode value) 734private sealed class SchemaOrderJsonNodeConverter : JsonConverter<JsonNode> 738public override bool CanConvert(Type typeToConvert) => typeof(JsonNode).IsAssignableFrom(typeToConvert) && typeToConvert != typeof(JsonValue); 740public override void Write(Utf8JsonWriter writer, JsonNode? value, JsonSerializerOptions options) 747IEnumerable<KeyValuePair<string, JsonNode>> properties = 761foreach (var item in array) 776public override JsonNode? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
ConfigurationSchemaGenerator.Tests (4)
GeneratorTests.cs (4)
1579var actualJson = JsonNode.Parse(actual)!; 1580var expectedJson = JsonNode.Parse(expected)!;
dotnet-user-jwts (1)
Helpers\SigningKeysHandler.cs (1)
85var toRemove = signingKeys.SingleOrDefault(key => key["Issuer"].GetValue<string>() == issuer);
IdentitySample.PasskeyConformance (1)
Data\ServerPublicKeyCredentialOptionsResponse.cs (1)
22var optionsObject = JsonNode.Parse(value.OptionsJson)?.AsObject()
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (8)
UserJwtsTests.cs (8)
303Assert.True(secretsJson.TryGetPropertyValue("Foo", out var fooField)); 521var signingKey = Assert.Single(secretsJson[SigningKeysHandler.GetSigningKeyPropertyName(DevJwtsDefaults.Scheme)].AsArray()); 524Assert.True(secretsJson.TryGetPropertyValue("Foo", out var fooField)); 549var signingKey = Assert.Single(secretsJson[SigningKeysHandler.GetSigningKeyPropertyName(DevJwtsDefaults.Scheme)].AsArray()); 552Assert.True(secretsJson.TryGetPropertyValue("Foo", out var fooField)); 588var signingKey = Assert.Single(secretsJson[SigningKeysHandler.GetSigningKeyPropertyName("test-scheme")].AsArray()); 631var signingKey1 = Assert.Single(secretsJson[SigningKeysHandler.GetSigningKeyPropertyName("test-scheme")].AsArray()); 635var signingKey2 = Assert.Single(secretsJson[SigningKeysHandler.GetSigningKeyPropertyName("test-scheme-2")].AsArray());
Microsoft.AspNetCore.Http.Abstractions.Tests (1)
ProblemDetailsJsonConverterTest.cs (1)
123Assert.IsAssignableFrom<JsonNode>(kvp.Value!);
Microsoft.AspNetCore.Http.Extensions.Tests (5)
RequestDelegateFactoryTests.cs (2)
1387var deserializedResponseBody = JsonNode.Parse(responseBodyStream.ToArray());
RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (3)
252internal static async Task VerifyResponseJsonNodeAsync(HttpContext httpContext, Action<JsonNode> check, int expectedStatusCode = 200, string expectedContentType = "application/json; charset=utf-8") 255var node = JsonNode.Parse(body);
Microsoft.AspNetCore.Http.Microbenchmarks (3)
src\Http\Http.Extensions\test\RequestDelegateGenerator\RequestDelegateCreationTestBase.cs (3)
252internal static async Task VerifyResponseJsonNodeAsync(HttpContext httpContext, Action<JsonNode> check, int expectedStatusCode = 200, string expectedContentType = "application/json; charset=utf-8") 255var node = JsonNode.Parse(body);
Microsoft.AspNetCore.Identity.Test (30)
Passkeys\PasskeyHandlerAssertionTest.cs (14)
58credentialJson["id"] = JsonNode.Parse(jsonValue); 109credentialJson["type"] = JsonNode.Parse(jsonValue); 158credentialJson["response"] = JsonNode.Parse(jsonValue); 192assertionStateJson["challenge"] = JsonNode.Parse(jsonValue); 227credentialJson["response"]!["clientDataJSON"] = JsonNode.Parse(jsonValue); 277credentialJson["response"]!["authenticatorData"] = JsonNode.Parse(jsonValue); 344credentialJson["response"]!["signature"] = JsonNode.Parse(jsonValue); 410credentialJson["response"]!["userHandle"] = JsonNode.Parse(jsonValue); 478clientDataJson["type"] = JsonNode.Parse(jsonValue); 530clientDataJson["challenge"] = JsonNode.Parse(jsonValue); 613clientDataJson["origin"] = JsonNode.Parse(jsonValue); 667clientDataJson["tokenBinding"] = JsonNode.Parse(jsonValue); 682clientDataJson["tokenBinding"] = JsonNode.Parse("{}"); 698clientDataJson["tokenBinding"] = JsonNode.Parse("""
Passkeys\PasskeyHandlerAttestationTest.cs (15)
58credentialJson["id"] = JsonNode.Parse(jsonValue); 109credentialJson["type"] = JsonNode.Parse(jsonValue); 158credentialJson["response"] = JsonNode.Parse(jsonValue); 193attestationStateJson["userEntity"]!["id"] = JsonNode.Parse(jsonValue); 228attestationStateJson["userEntity"]!["name"] = JsonNode.Parse(jsonValue); 263attestationStateJson["userEntity"]!["displayName"] = JsonNode.Parse(jsonValue); 313attestationStateJson["challenge"] = JsonNode.Parse(jsonValue); 348credentialJson["response"]!["clientDataJSON"] = JsonNode.Parse(jsonValue); 398credentialJson["response"]!["attestationObject"] = JsonNode.Parse(jsonValue); 447clientDataJson["type"] = JsonNode.Parse(jsonValue); 499clientDataJson["challenge"] = JsonNode.Parse(jsonValue); 582clientDataJson["origin"] = JsonNode.Parse(jsonValue); 636clientDataJson["tokenBinding"] = JsonNode.Parse(jsonValue); 651clientDataJson["tokenBinding"] = JsonNode.Parse("{}"); 667clientDataJson["tokenBinding"] = JsonNode.Parse("""
Passkeys\PasskeyScenarioTest.cs (1)
115var jsonObject = JsonNode.Parse(value)?.AsObject()
Microsoft.AspNetCore.JsonPatch.SystemTextJson (8)
Helpers\GenericListOrJsonArrayUtilities.cs (2)
35array[index] = (JsonNode)value; 82array.Insert(index, (JsonNode)value);
Helpers\JsonUtilities.cs (3)
24if (a is JsonNode nodeA && b is JsonNode nodeB) 26return JsonNode.DeepEquals(nodeA, nodeB);
Internal\JsonObjectAdapter.cs (3)
37if (!obj.TryGetPropertyValue(segment, out var valueAsToken)) 98if (!obj.TryGetPropertyValue(segment, out var currentValue)) 129if (!obj.TryGetPropertyValue(segment, out var nextTargetToken))
Microsoft.AspNetCore.JsonPatch.SystemTextJson.Tests (1)
IntegrationTests\HeterogenousCollectionTests.cs (1)
25var circleJObject = JsonObject.Parse(@"{
Microsoft.AspNetCore.OpenApi (28)
Extensions\JsonNodeSchemaExtensions.cs (22)
58/// Note that this method targets <see cref="JsonNode"/> and not <see cref="OpenApiSchema"/> because it is 80/// <param name="schema">The <see cref="JsonNode"/> produced by the underlying schema generator.</param> 82internal static void ApplyValidationAttributes(this JsonNode schema, IEnumerable<Attribute> validationAttributes) 170/// <param name="schema">The <see cref="JsonNode"/> produced by the underlying schema generator.</param> 173internal static void ApplyDefaultValue(this JsonNode schema, object? defaultValue, JsonTypeInfo? jsonTypeInfo) 203/// Note that this method targets <see cref="JsonNode"/> and not <see cref="OpenApiSchema"/> because 207/// <param name="schema">The <see cref="JsonNode"/> produced by the underlying schema generator.</param> 210internal static void ApplyPrimitiveTypesAndFormats(this JsonNode schema, JsonSchemaExporterContext context, Func<JsonTypeInfo, string?> createSchemaReferenceId) 229/// <param name="schema">The <see cref="JsonNode"/> produced by the underlying schema generator.</param> 231internal static void ApplyRouteConstraints(this JsonNode schema, IEnumerable<IRouteConstraint> constraints) 305/// <param name="schema">The <see cref="JsonNode"/> produced by the underlying schema generator.</param> 308internal static void ApplyParameterInfo(this JsonNode schema, ApiParameterDescription parameterDescription, JsonTypeInfo? jsonTypeInfo) 379/// <param name="schema">The <see cref="JsonNode"/> produced by the underlying schema generator.</param> 382internal static void MapPolymorphismOptionsToDiscriminator(this JsonNode schema, JsonSchemaExporterContext context, Func<JsonTypeInfo, string?> createSchemaReferenceId) 419/// <param name="schema">The <see cref="JsonNode"/> produced by the underlying schema generator.</param> 422internal static void ApplySchemaReferenceId(this JsonNode schema, JsonSchemaExporterContext context, Func<JsonTypeInfo, string?> createSchemaReferenceId) 451/// <param name="schema">The <see cref="JsonNode"/> produced by the underlying schema generator.</param> 453internal static void ApplyNullabilityContextInfo(this JsonNode schema, ParameterInfo parameterInfo) 473/// <param name="schema">The <see cref="JsonNode"/> produced by the underlying schema generator.</param> 475internal static void ApplyNullabilityContextInfo(this JsonNode schema, JsonPropertyInfo propertyInfo) 489private static JsonSchemaType? MapJsonNodeToSchemaType(JsonNode? jsonNode) 505foreach (var node in jsonArray)
Schemas\OpenApiJsonSchema.Helpers.cs (3)
87internal static JsonNode? ReadJsonNode(ref Utf8JsonReader reader) 90internal static JsonNode? ReadJsonNode(ref Utf8JsonReader reader, out JsonSchemaType? type) 211var enumValues = ReadList<JsonNode>(ref reader);
Schemas\OpenApiJsonSchemaContext.cs (1)
11[JsonSerializable(typeof(JsonNode))]
Services\Schemas\OpenApiSchemaService.cs (2)
125var schemaAsJsonObject = CreateSchema(key); 348private JsonNode CreateSchema(OpenApiSchemaKey key)
Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests (60)
AdditionalTextsTests.Schemas.cs (28)
223var booleanTypeExample = Assert.IsAssignableFrom<JsonNode>(typeWithExamples.Properties["booleanType"].Example); 226var integerTypeExample = Assert.IsAssignableFrom<JsonNode>(typeWithExamples.Properties["integerType"].Example); 229var longTypeExample = Assert.IsAssignableFrom<JsonNode>(typeWithExamples.Properties["longType"].Example); 232var doubleTypeExample = Assert.IsAssignableFrom<JsonNode>(typeWithExamples.Properties["doubleType"].Example); 235var floatTypeExample = Assert.IsAssignableFrom<JsonNode>(typeWithExamples.Properties["floatType"].Example); 238var dateTimeTypeExample = Assert.IsAssignableFrom<JsonNode>(typeWithExamples.Properties["dateTimeType"].Example); 241var dateOnlyTypeExample = Assert.IsAssignableFrom<JsonNode>(typeWithExamples.Properties["dateOnlyType"].Example); 244var stringTypeExample = Assert.IsAssignableFrom<JsonNode>(typeWithExamples.Properties["stringType"].Example); 247var guidTypeExample = Assert.IsAssignableFrom<JsonNode>(typeWithExamples.Properties["guidType"].Example); 250var byteTypeExample = Assert.IsAssignableFrom<JsonNode>(typeWithExamples.Properties["byteType"].Example); 253var timeOnlyTypeExample = Assert.IsAssignableFrom<JsonNode>(typeWithExamples.Properties["timeOnlyType"].Example); 256var timeSpanTypeExample = Assert.IsAssignableFrom<JsonNode>(typeWithExamples.Properties["timeSpanType"].Example); 259var decimalTypeExample = Assert.IsAssignableFrom<JsonNode>(typeWithExamples.Properties["decimalType"].Example); 262var uriTypeExample = Assert.IsAssignableFrom<JsonNode>(typeWithExamples.Properties["uriType"].Example);
OperationTests.MinimalApis.cs (4)
251var example = Assert.IsAssignableFrom<JsonNode>(path3.Parameters[0].Example); 268var userExample = Assert.IsAssignableFrom<JsonNode>(userParam.Example);
SchemaTests.cs (28)
215var booleanTypeExample = Assert.IsAssignableFrom<JsonNode>(typeWithExamples.Properties["booleanType"].Example); 218var integerTypeExample = Assert.IsAssignableFrom<JsonNode>(typeWithExamples.Properties["integerType"].Example); 221var longTypeExample = Assert.IsAssignableFrom<JsonNode>(typeWithExamples.Properties["longType"].Example); 224var doubleTypeExample = Assert.IsAssignableFrom<JsonNode>(typeWithExamples.Properties["doubleType"].Example); 227var floatTypeExample = Assert.IsAssignableFrom<JsonNode>(typeWithExamples.Properties["floatType"].Example); 230var dateTimeTypeExample = Assert.IsAssignableFrom<JsonNode>(typeWithExamples.Properties["dateTimeType"].Example); 233var dateOnlyTypeExample = Assert.IsAssignableFrom<JsonNode>(typeWithExamples.Properties["dateOnlyType"].Example); 236var stringTypeExample = Assert.IsAssignableFrom<JsonNode>(typeWithExamples.Properties["stringType"].Example); 239var guidTypeExample = Assert.IsAssignableFrom<JsonNode>(typeWithExamples.Properties["guidType"].Example); 242var byteTypeExample = Assert.IsAssignableFrom<JsonNode>(typeWithExamples.Properties["byteType"].Example); 245var timeOnlyTypeExample = Assert.IsAssignableFrom<JsonNode>(typeWithExamples.Properties["timeOnlyType"].Example); 248var timeSpanTypeExample = Assert.IsAssignableFrom<JsonNode>(typeWithExamples.Properties["timeSpanType"].Example); 251var decimalTypeExample = Assert.IsAssignableFrom<JsonNode>(typeWithExamples.Properties["decimalType"].Example); 254var uriTypeExample = Assert.IsAssignableFrom<JsonNode>(typeWithExamples.Properties["uriType"].Example);
Microsoft.AspNetCore.OpenApi.Tests (22)
Services\OpenApiSchemaService\OpenApiSchemaService.ParameterSchemas.cs (20)
159[(int id = 2) => { }, (JsonNode defaultValue) => Assert.Equal(2, defaultValue.GetValue<int>())], 160[(float id = 3f) => { }, (JsonNode defaultValue) => Assert.Equal(3, defaultValue.GetValue<int>())], 161[(string id = "test") => { }, (JsonNode defaultValue) => Assert.Equal("test", defaultValue.GetValue<string>())], 162[(bool id = true) => { }, (JsonNode defaultValue) => Assert.True(defaultValue.GetValue<bool>())], 163[(TaskStatus status = TaskStatus.Canceled) => { }, (JsonNode defaultValue) => Assert.Equal(6, defaultValue.GetValue<int>())], 165[(Status status = Status.Pending) => { }, (JsonNode defaultValue) => Assert.Equal("Pending", defaultValue.GetValue<string>())], 166[([DefaultValue(2)] int id) => { }, (JsonNode defaultValue) => Assert.Equal(2, defaultValue.GetValue<int>())], 167[([DefaultValue(3f)] float id) => { }, (JsonNode defaultValue) => Assert.Equal(3, defaultValue.GetValue<int>())], 168[([DefaultValue("test")] string id) => { }, (JsonNode defaultValue) => Assert.Equal("test", defaultValue.GetValue<string>())], 169[([DefaultValue(true)] bool id) => { }, (JsonNode defaultValue) => Assert.True(defaultValue.GetValue<bool>())], 170[([DefaultValue(TaskStatus.Canceled)] TaskStatus status) => { }, (JsonNode defaultValue) => Assert.Equal(6, defaultValue.GetValue<int>())], 171[([DefaultValue(Status.Pending)] Status status) => { }, (JsonNode defaultValue) => Assert.Equal("Pending", defaultValue.GetValue<string>())], 172[([DefaultValue(null)] int? id) => { }, (JsonNode defaultValue) => Assert.True(defaultValue is null)], 173[([DefaultValue(2)] int? id) => { }, (JsonNode defaultValue) => Assert.Equal(2, defaultValue.GetValue<int>())], 174[([DefaultValue(null)] string? id) => { }, (JsonNode defaultValue) => Assert.True(defaultValue is null)], 175[([DefaultValue("foo")] string? id) => { }, (JsonNode defaultValue) => Assert.Equal("foo", defaultValue.GetValue<string>())], 176[([DefaultValue(null)] TaskStatus? status) => { }, (JsonNode defaultValue) => Assert.True(defaultValue is null)], 177[([DefaultValue(TaskStatus.Canceled)] TaskStatus? status) => { }, (JsonNode defaultValue) => Assert.Equal(6, defaultValue.GetValue<int>())], 182public async Task GetOpenApiParameters_HandlesRouteParametersWithDefaultValue(Delegate requestHandler, Action<JsonNode> assert) 195var openApiDefault = parameter.Schema!.Default;
Services\OpenApiSchemaService\OpenApiSchemaService.ResponseSchemas.cs (2)
673var defaultValue = Assert.IsAssignableFrom<JsonNode>(property.Value.Default);
Microsoft.Extensions.AI (3)
ChatCompletion\ChatClientStructuredOutputExtensions.cs (1)
244private static JsonNode? JsonElementToJsonNode(JsonElement element)
ChatCompletion\OpenTelemetryChatClient.cs (2)
575public JsonNode? Content { get; set; } 595public JsonNode? Arguments { get; set; }
Microsoft.Extensions.AI.Abstractions (97)
Functions\AIFunctionFactory.cs (7)
93/// or <see cref="JsonNode"/>, it is deserialized into the parameter type, utilizing <see cref="AIFunctionFactoryOptions.SerializerOptions"/> if provided, 167/// or <see cref="JsonNode"/>, it is deserialized into the parameter type, utilizing <paramref name="serializerOptions"/> if provided, or else 256/// or <see cref="JsonNode"/>, it is deserialized into the parameter type, utilizing <see cref="AIFunctionFactoryOptions.SerializerOptions"/> if provided, 340/// or <see cref="JsonNode"/>, it is deserialized into the parameter type, utilizing <paramref name="serializerOptions"/> if provided, or else 395/// <see cref="JsonDocument"/>, or <see cref="JsonNode"/>, it is deserialized directly. If the argument is anything else unknown, 442/// or <see cref="JsonNode"/>, it is deserialized into the parameter type, utilizing <see cref="AIFunctionFactoryOptions.SerializerOptions"/> if provided, 821JsonNode node => JsonSerializer.Deserialize(node, typeInfo),
src\Shared\JsonSchemaExporter\JsonSchemaExporter.cs (15)
46/// <returns>A new <see cref="JsonNode"/> instance defining the JSON schema for <paramref name="type"/>.</returns> 50public static JsonNode GetJsonSchemaAsNode(this JsonSerializerOptions options, Type type, JsonSchemaExporterOptions? exporterOptions = null) 66/// <returns>A new <see cref="JsonNode"/> instance defining the JSON schema for <paramref name="typeInfo"/>.</returns> 70public static JsonNode GetJsonSchemaAsNode(this JsonTypeInfo typeInfo, JsonSchemaExporterOptions? exporterOptions = null) 80private static JsonNode MapRootTypeJsonSchema(JsonTypeInfo typeInfo, JsonSchemaExporterOptions exporterOptions) 153JsonNode discriminatorNode = discriminatorValue switch 155string stringId => (JsonNode)stringId, 156_ => (JsonNode)(int)discriminatorValue, 290JsonNode? defaultValue = null; 634[typeof(JsonNode)] = _ => JsonSchema.CreateTrueSchema(), 673new JsonSchema { Enum = new() { (JsonNode)"NaN", (JsonNode)"Infinity", (JsonNode)"-Infinity" } }, 708out JsonNode? defaultValue, 762enumValues.Add((JsonNode)effectiveName);
src\Shared\JsonSchemaExporter\JsonSchemaExporter.JsonSchema.cs (14)
132public JsonNode? Constant 142private JsonNode? _constant; 240public JsonNode? DefaultValue 250private JsonNode? _defaultValue; 327public JsonNode ToJsonNode(JsonSchemaExporterOptions options) 331return CompleteSchema((JsonNode)boolSchema); 361if (MapSchemaType(Type) is JsonNode type) 397requiredArray.Add((JsonNode)requiredProperty); 441objSchema.Add(JsonSchemaConstants.MinLengthPropertyName, (JsonNode)minLength); 446objSchema.Add(JsonSchemaConstants.MaxLengthPropertyName, (JsonNode)maxLength); 451JsonNode CompleteSchema(JsonNode schema) 495private static JsonNode? MapSchemaType(JsonSchemaType schemaType) 512array.Add((JsonNode)ToIdentifier(type)!);
src\Shared\JsonSchemaExporter\JsonSchemaExporterOptions.cs (2)
36public Func<JsonSchemaExporterContext, JsonNode, JsonNode>? TransformSchemaNode { get; init; }
Utilities\AIJsonSchemaCreateOptions.cs (2)
26public Func<AIJsonSchemaCreateContext, JsonNode, JsonNode>? TransformSchemaNode { get; init; }
Utilities\AIJsonSchemaTransformOptions.cs (2)
19public Func<AIJsonSchemaTransformContext, JsonNode, JsonNode>? TransformSchemaNode { get; init; }
Utilities\AIJsonUtilities.cs (3)
137JsonNode? jsonNode = JsonSerializer.SerializeToNode(value, jti); 165static void NormalizeJsonNode(JsonNode? node) 170foreach (JsonNode? item in array)
Utilities\AIJsonUtilities.Defaults.cs (2)
87[JsonSerializable(typeof(JsonNode))] 124[JsonSerializable(typeof(JsonNode))]
Utilities\AIJsonUtilities.Schema.Create.cs (29)
113JsonNode parameterSchema = CreateJsonSchemaCore( 125(requiredProperties ??= []).Add((JsonNode)parameter.Name); 129JsonNode schema = new JsonObject(); 180JsonNode schema = CreateJsonSchemaCore(type, parameterName: null, description, hasDefaultValue, defaultValue, serializerOptions, inferenceOptions); 208private static JsonNode CreateJsonSchemaCore( 233JsonNode? defaultValueNode = defaultValue is not null 261JsonNode TransformSchemaNode(JsonSchemaExporterContext schemaExporterContext, JsonNode schema) 274if (parameterName is not null && objSchema.TryGetPropertyValue(RefPropertyName, out JsonNode? paramName)) 283objSchema[RefPropertyName] = (JsonNode)refUri; 304obj[TypePropertyName] = new JsonArray { (JsonNode)numericType, (JsonNode)"null" }; 308obj[TypePropertyName] = (JsonNode)numericType; 319if (objSchema.TryGetPropertyValue(TypePropertyName, out JsonNode? typeKeyWord) && 325objSchema[TypePropertyName] = new JsonArray { (JsonNode)typeValue, (JsonNode)"null" }; 332objSchema.InsertAtStart(TypePropertyName, new JsonArray { (JsonNode)"string", (JsonNode)"null" }); 339JsonNode? defaultValueNode = JsonSerializer.SerializeToNode(defaultValue, ctx.TypeInfo); 346ConvertSchemaToObject(ref schema).InsertAtStart(DescriptionPropertyName, (JsonNode)localDescription); 352ConvertSchemaToObject(ref schema).InsertAtStart(SchemaPropertyName, (JsonNode)SchemaKeywordUri); 365static JsonObject ConvertSchemaToObject(ref JsonNode schema) 385void ApplyDataAnnotations(string? parameterName, ref JsonNode schema, AIJsonSchemaCreateContext ctx) 423if (obj[TypePropertyName] is JsonNode typeNode && typeNode.GetValueKind() is JsonValueKind.String && typeNode.GetValue<string>() is "string") 436if (obj[TypePropertyName] is JsonNode typeNode && typeNode.GetValueKind() is JsonValueKind.String && typeNode.GetValue<string>() is "string") 450JsonNode? minNode = null; 451JsonNode? maxNode = null; 638foreach (JsonNode? entry in typeArray) 673private static void InsertAtStart(this JsonObject jsonObject, string key, JsonNode value)
Utilities\AIJsonUtilities.Schema.Transform.cs (21)
32JsonNode? nodeSchema = JsonSerializer.SerializeToNode(schema, JsonContext.Default.JsonElement); 33JsonNode transformedSchema = TransformSchema(nodeSchema, transformOptions); 37private static JsonNode TransformSchema(JsonNode? schema, AIJsonSchemaTransformOptions transformOptions) 43private static JsonNode TransformSchemaCore(JsonNode? schema, AIJsonSchemaTransformOptions transformOptions, List<string>? path) 50schema = new JsonObject { [NotPropertyName] = (JsonNode)true }; 68if (schemaObj.TryGetPropertyValue(PropertiesPropertyName, out JsonNode? props) && props is JsonObject propsObj) 82if (schemaObj.TryGetPropertyValue(ItemsPropertyName, out JsonNode? itemsSchema)) 89if (schemaObj.TryGetPropertyValue(AdditionalPropertiesPropertyName, out JsonNode? additionalProps) && 97if (schemaObj.TryGetPropertyValue(NotPropertyName, out JsonNode? notSchema)) 108if (schemaObj.TryGetPropertyValue(combinatorKeyword, out JsonNode? combinatorSchema) && combinatorSchema is JsonArray combinatorArray) 114JsonNode element = TransformSchemaCore(combinatorArray[i], transformOptions, path); 130schemaObj[AdditionalPropertiesPropertyName] = (JsonNode)false; 138requiredProps.Add((JsonNode)prop.Key); 145schemaObj.TryGetPropertyValue(TypePropertyName, out JsonNode? typeSchema) && 151foreach (JsonNode? typeNode in typeArray) 172schemaObj["type"] = (JsonNode)foundType; 173schemaObj["nullable"] = (JsonNode)true; 178schemaObj.TryGetPropertyValue(DefaultPropertyName, out JsonNode? defaultSchema)) 180string? description = schemaObj.TryGetPropertyValue(DescriptionPropertyName, out JsonNode? descriptionSchema) ? descriptionSchema?.GetValue<string>() : null;
Microsoft.Extensions.AI.Abstractions.Tests (36)
AssertExtensions.cs (1)
61if (!JsonNode.DeepEquals(
Contents\FunctionCallContentTests..cs (3)
84var json = JsonSerializer.SerializeToNode(sut, TestJsonSerializerContext.Default.Options); 174var arguments = JsonSerializer.Deserialize<Dictionary<string, JsonNode>>(""" 231AIFunctionArguments arguments = new(JsonSerializer.Deserialize<Dictionary<string, JsonNode>>("""
test\Shared\JsonSchemaExporter\SchemaTestHelpers.cs (11)
17public static void AssertEqualJsonSchema(JsonNode expectedJsonSchema, JsonNode actualJsonSchema) 19if (!JsonNode.DeepEquals(expectedJsonSchema, actualJsonSchema)) 31public static void AssertDocumentMatchesSchema(JsonNode schema, JsonNode? instance) 52public static void AssertDoesNotMatchSchema(JsonNode schema, JsonNode? instance) 67private static EvaluationResults EvaluateSchemaCore(JsonNode schema, JsonNode? instance) 74private static string FormatJson(JsonNode? node) => 78[JsonSerializable(typeof(JsonNode))]
test\Shared\JsonSchemaExporter\TestData.cs (3)
30JsonNode ITestData.ExpectedJsonSchema { get; } = 31JsonNode.Parse(ExpectedJsonSchema, documentOptions: _schemaParseOptions) 63JsonNode ExpectedJsonSchema { get; }
test\Shared\JsonSchemaExporter\TestTypes.cs (6)
103yield return new TestData<JsonNode>(JsonNode.Parse("""[{ "x" : 42 }]"""), "true"); 106yield return new TestData<JsonArray>([(JsonNode)1, (JsonNode)2, (JsonNode)3], """{"type":["array","null"]}"""); 1247[JsonSerializable(typeof(JsonNode))]
TestJsonSerializerContext.cs (1)
30[JsonSerializable(typeof(Dictionary<string, JsonNode>))] // Used in Content tests
Utilities\AIJsonUtilitiesTests.cs (11)
100case null when property.PropertyType == typeof(Func<AIJsonSchemaCreateContext, JsonNode, JsonNode>): 101Func<AIJsonSchemaCreateContext, JsonNode, JsonNode> transformer = static (context, schema) => (JsonNode)true; 414JsonNode? schemaAsNode = JsonSerializer.SerializeToNode(schema, options); 427JsonNode? serializedValue = JsonSerializer.SerializeToNode(testData.Value, testData.Type, options); 1261schemaObj.Add("myAwesomeKeyword", (JsonNode)42); 1277if (schemaObj.TryGetPropertyValue("properties", out JsonNode? props)) 1284if (schemaObj.TryGetPropertyValue("type", out JsonNode? type) && type is JsonArray typeArray) 1335return JsonNode.DeepEquals(
Microsoft.Extensions.AI.AzureAIInference.Tests (1)
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (1)
61if (!JsonNode.DeepEquals(
Microsoft.Extensions.AI.Evaluation.Quality (5)
AIToolExtensions.cs (3)
24JsonNode functionJsonNode = 29["functionSchema"] = JsonNode.Parse(function.JsonSchema.GetRawText()), 35JsonNode.Parse(function.ReturnJsonSchema.Value.GetRawText());
ChatMessageExtensions.cs (1)
21JsonNode? messageJsonNode =
ChatResponseExtensions.cs (1)
36JsonNode? toolCallOrResultJsonNode =
Microsoft.Extensions.AI.Evaluation.Safety (4)
EvaluationMetricExtensions.cs (4)
81JsonNode? jsonData = JsonNode.Parse(data); 87Failed to parse supplied {nameof(data)} below into a {nameof(JsonNode)}. 97internal static void LogJsonData(this EvaluationMetric metric, JsonNode data)
Microsoft.Extensions.AI.Integration.Tests (5)
VerbatimHttpHandler.cs (5)
63JsonNode? expectedNode = null; 64JsonNode? actualNode = null; 67expectedNode = JsonNode.Parse(expected); 68actualNode = JsonNode.Parse(actual); 76if (!JsonNode.DeepEquals(expectedNode, actualNode))
Microsoft.Extensions.AI.OpenAI (1)
OpenAIClientExtensions.cs (1)
89static void AppendLine(ref StringBuilder? sb, string propName, JsonNode propNode)
Microsoft.Extensions.AI.OpenAI.Tests (1)
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (1)
61if (!JsonNode.DeepEquals(
Microsoft.Extensions.AI.Tests (3)
Functions\AIFunctionFactoryTest.cs (1)
88["y"] = JsonNode.Parse("2"),
test\Libraries\Microsoft.Extensions.AI.Abstractions.Tests\AssertExtensions.cs (1)
61if (!JsonNode.DeepEquals(
TestJsonSerializerContext.cs (1)
23[JsonSerializable(typeof(Dictionary<string, JsonNode>))]
Microsoft.ML.AutoML (12)
SweepableEstimator\Converter\MultiModelPipelineConverter.cs (3)
17var jValue = JsonValue.Parse(ref reader); 26var jsonObject = JsonNode.Parse("{}");
SweepableEstimator\Converter\SweepableEstimatorConverter.cs (2)
18var jsonObject = JsonValue.Parse(ref reader); 29var jObject = JsonObject.Parse("{}");
SweepableEstimator\Converter\SweepableEstimatorPipelineConverter.cs (4)
17var jNode = JsonNode.Parse(ref reader); 29var jNode = JsonNode.Parse("{}");
SweepableEstimator\Converter\SweepablePipelineConverter.cs (3)
17var jValue = JsonValue.Parse(ref reader); 27var jsonObject = JsonNode.Parse("{}");
Microsoft.ML.AutoML.SourceGenerator (5)
SearchSpaceGenerator.cs (5)
35var searchSpacesJNodes = searchSpacesJson.Select(x => JsonNode.Parse(x)); 37foreach (var jNode in searchSpacesJNodes) 65var defaultToken = t.AsObject().ContainsKey("default") ? t["default"] : null; 86var searchSpaceNode = t.AsObject().ContainsKey("search_space") ? t["search_space"] : null; 96var minToken = searchSpaceNode["min"];
Roslyn.VisualStudio.Next.UnitTests (9)
UnifiedSettings\UnifiedSettingsTests.cs (9)
131var jsonDocument = await JsonNode.ParseAsync(registrationFileStream!, documentOptions: new JsonDocumentOptions { CommentHandling = JsonCommentHandling.Skip }); 145var jsonDocument = await JsonNode.ParseAsync(registrationFileStream!, documentOptions: new JsonDocumentOptions { CommentHandling = JsonCommentHandling.Skip }); 232var jsonDocument = await JsonNode.ParseAsync(registrationFileStream!, documentOptions: new JsonDocumentOptions { CommentHandling = JsonCommentHandling.Skip }); 246var jsonDocument = await JsonNode.ParseAsync(registrationFileStream!, documentOptions: new JsonDocumentOptions { CommentHandling = JsonCommentHandling.Skip }); 256private static void VerifyProperties(JsonNode jsonDocument, string prefix, ImmutableArray<(IOption2, UnifiedSettingBase)> expectedOptionToSettings)
Shared (31)
JsonSchemaExporter\JsonSchemaExporter.cs (15)
46/// <returns>A new <see cref="JsonNode"/> instance defining the JSON schema for <paramref name="type"/>.</returns> 50public static JsonNode GetJsonSchemaAsNode(this JsonSerializerOptions options, Type type, JsonSchemaExporterOptions? exporterOptions = null) 66/// <returns>A new <see cref="JsonNode"/> instance defining the JSON schema for <paramref name="typeInfo"/>.</returns> 70public static JsonNode GetJsonSchemaAsNode(this JsonTypeInfo typeInfo, JsonSchemaExporterOptions? exporterOptions = null) 80private static JsonNode MapRootTypeJsonSchema(JsonTypeInfo typeInfo, JsonSchemaExporterOptions exporterOptions) 153JsonNode discriminatorNode = discriminatorValue switch 155string stringId => (JsonNode)stringId, 156_ => (JsonNode)(int)discriminatorValue, 290JsonNode? defaultValue = null; 634[typeof(JsonNode)] = _ => JsonSchema.CreateTrueSchema(), 673new JsonSchema { Enum = new() { (JsonNode)"NaN", (JsonNode)"Infinity", (JsonNode)"-Infinity" } }, 708out JsonNode? defaultValue, 762enumValues.Add((JsonNode)effectiveName);
JsonSchemaExporter\JsonSchemaExporter.JsonSchema.cs (14)
132public JsonNode? Constant 142private JsonNode? _constant; 240public JsonNode? DefaultValue 250private JsonNode? _defaultValue; 327public JsonNode ToJsonNode(JsonSchemaExporterOptions options) 331return CompleteSchema((JsonNode)boolSchema); 361if (MapSchemaType(Type) is JsonNode type) 397requiredArray.Add((JsonNode)requiredProperty); 441objSchema.Add(JsonSchemaConstants.MinLengthPropertyName, (JsonNode)minLength); 446objSchema.Add(JsonSchemaConstants.MaxLengthPropertyName, (JsonNode)maxLength); 451JsonNode CompleteSchema(JsonNode schema) 495private static JsonNode? MapSchemaType(JsonSchemaType schemaType) 512array.Add((JsonNode)ToIdentifier(type)!);
JsonSchemaExporter\JsonSchemaExporterOptions.cs (2)
36public Func<JsonSchemaExporterContext, JsonNode, JsonNode>? TransformSchemaNode { get; init; }
Shared.Tests (30)
JsonSchemaExporter\JsonSchemaExporterTests.cs (10)
34JsonNode schema = options.GetJsonSchemaAsNode(testData.Type, (JsonSchemaExporterOptions?)testData.ExporterOptions); 46JsonNode schema = options.GetJsonSchemaAsNode(testData.Type, (JsonSchemaExporterOptions?)testData.ExporterOptions); 47JsonNode? instance = JsonSerializer.SerializeToNode(testData.Value, testData.Type, options); 60JsonNode schema = Options.GetJsonSchemaAsNode(referenceType, config); 76JsonNode schema = Options.GetJsonSchemaAsNode(referenceType, config); 85JsonNode schema = Options.GetJsonSchemaAsNode(typeof(XElement)); 126JsonNode schema = Options.GetJsonSchemaAsNode(typeof(object), config); 133JsonNode schema = Options.GetJsonSchemaAsNode(typeof(TestTypes.PocoDisallowingUnmappedMembers)); 134JsonNode? jsonWithUnmappedProperties = JsonNode.Parse("""{ "UnmappedProperty" : {} }""");
JsonSchemaExporter\SchemaTestHelpers.cs (11)
17public static void AssertEqualJsonSchema(JsonNode expectedJsonSchema, JsonNode actualJsonSchema) 19if (!JsonNode.DeepEquals(expectedJsonSchema, actualJsonSchema)) 31public static void AssertDocumentMatchesSchema(JsonNode schema, JsonNode? instance) 52public static void AssertDoesNotMatchSchema(JsonNode schema, JsonNode? instance) 67private static EvaluationResults EvaluateSchemaCore(JsonNode schema, JsonNode? instance) 74private static string FormatJson(JsonNode? node) => 78[JsonSerializable(typeof(JsonNode))]
JsonSchemaExporter\TestData.cs (3)
30JsonNode ITestData.ExpectedJsonSchema { get; } = 31JsonNode.Parse(ExpectedJsonSchema, documentOptions: _schemaParseOptions) 63JsonNode ExpectedJsonSchema { get; }
JsonSchemaExporter\TestTypes.cs (6)
103yield return new TestData<JsonNode>(JsonNode.Parse("""[{ "x" : 42 }]"""), "true"); 106yield return new TestData<JsonArray>([(JsonNode)1, (JsonNode)2, (JsonNode)3], """{"type":["array","null"]}"""); 1247[JsonSerializable(typeof(JsonNode))]
System.Text.Json (475)
System\Text\Json\Nodes\JsonArray.cs (31)
24private List<JsonNode?>? _list; 39public JsonArray(JsonNodeOptions options, params JsonNode?[] items) : base(options) 49public JsonArray(JsonNodeOptions options, params ReadOnlySpan<JsonNode?> items) : base(options) 58public JsonArray(params JsonNode?[] items) : base() 67public JsonArray(params ReadOnlySpan<JsonNode?> items) : base() 74internal override JsonNode DeepCloneCore() 76GetUnderlyingRepresentation(out List<JsonNode?>? list, out JsonElement? jsonElement); 87_list = new List<JsonNode?>(list.Count) 98internal override bool DeepEqualsCore(JsonNode node) 108List<JsonNode?> currentList = List; 109List<JsonNode?> otherList = array.List; 131internal int GetElementIndex(JsonNode? node) 137/// Returns an enumerable that wraps calls to <see cref="JsonNode.GetValue{T}"/>. 143foreach (JsonNode? item in List) 149private void InitializeFromArray(JsonNode?[] items) 151var list = new List<JsonNode?>(items); 161private void InitializeFromSpan(ReadOnlySpan<JsonNode?> items) 163List<JsonNode?> list = new(items.Length); 220JsonNode? nodeToAdd = ConvertFromValue(value, Options); 227private List<JsonNode?> List => _list ?? InitializeList(); 229private protected override JsonNode? GetItem(int index) 234private protected override void SetItem(int index, JsonNode? value) 241internal override void GetPath(ref ValueStringBuilder path, JsonNode? child) 268GetUnderlyingRepresentation(out List<JsonNode?>? list, out JsonElement? jsonElement); 278foreach (JsonNode? element in List) 294private List<JsonNode?> InitializeList() 296GetUnderlyingRepresentation(out List<JsonNode?>? list, out JsonElement? jsonElement); 305list = new List<JsonNode?>(jElement.GetArrayLength()); 309JsonNode? node = JsonNodeConverter.Create(element, Options); 332private void GetUnderlyingRepresentation(out List<JsonNode?>? list, out JsonElement? jsonElement) 376public JsonNode? Value;
System\Text\Json\Nodes\JsonArray.IList.cs (21)
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"/>. 22public void Add(JsonNode? item) 34List<JsonNode?>? list = _list; 58public bool Contains(JsonNode? item) => List.Contains(item); 63/// <param name="item">The <see cref="JsonNode"/> to locate in the <see cref="JsonArray"/>.</param> 67public int IndexOf(JsonNode? item) => List.IndexOf(item); 73/// <param name="item">The <see cref="JsonNode"/> to insert.</param> 77public void Insert(int index, JsonNode? item) 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"/>. 92public bool Remove(JsonNode? item) 112JsonNode? item = List[index]; 125public int RemoveAll(Func<JsonNode?, bool> match) 166List<JsonNode?> list = List; 208void ICollection<JsonNode?>.CopyTo(JsonNode?[] array, int index) => List.CopyTo(array, index); 213/// <returns>A <see cref="IEnumerator{JsonNode}"/> for the <see cref="JsonNode"/>.</returns> 214public IEnumerator<JsonNode?> GetEnumerator() => List.GetEnumerator(); 227bool ICollection<JsonNode?>.IsReadOnly => false; 231private static void DetachParent(JsonNode? item)
System\Text\Json\Nodes\JsonNode.cs (30)
16/// declared as an <see cref="object"/> should be deserialized as a <see cref="JsonNode"/>. 22private JsonNode? _parent; 118/// Gets the parent <see cref="JsonNode"/>. 122public JsonNode? Parent 151internal abstract void GetPath(ref ValueStringBuilder path, JsonNode? child); 154/// Gets the root <see cref="JsonNode"/>. 159public JsonNode Root 163JsonNode? parent = Parent; 193/// The current <see cref="JsonNode"/> cannot be represented as a {T}. 196/// The current <see cref="JsonNode"/> is not a <see cref="JsonValue"/> or 210/// The current <see cref="JsonNode"/> is not a <see cref="JsonArray"/> or <see cref="JsonObject"/>. 212public JsonNode? this[int index] 218private protected virtual JsonNode? GetItem(int index) 224private protected virtual void SetItem(int index, JsonNode? node) => 236/// The current <see cref="JsonNode"/> is not a <see cref="JsonObject"/>. 238public JsonNode? this[string propertyName] 251/// Creates a new instance of the <see cref="JsonNode"/>. All children nodes are recursively cloned. 254public JsonNode DeepClone() => DeepCloneCore(); 256internal abstract JsonNode DeepCloneCore(); 304/// <param name="node1">The <see cref="JsonNode"/> to compare.</param> 305/// <param name="node2">The <see cref="JsonNode"/> to compare.</param> 307public static bool DeepEquals(JsonNode? node1, JsonNode? node2) 321internal abstract bool DeepEqualsCore(JsonNode node); 332JsonNode? node; 346internal void AssignParent(JsonNode parent) 353JsonNode? p = parent; 369/// to support arbitrary <see cref="JsonElement"/> and <see cref="JsonNode"/> values. 374internal static JsonNode? ConvertFromValue<T>(T? value, JsonNodeOptions? options = null) 381if (value is JsonNode node)
System\Text\Json\Nodes\JsonNode.Operators.cs (198)
11/// Defines an implicit conversion of a given <see cref="bool"/> to a <see cref="JsonNode"/>. 14/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 15public static implicit operator JsonNode(bool value) => JsonValue.Create(value); 18/// Defines an implicit conversion of a given <see cref="bool"/> to a <see cref="JsonNode"/>. 21/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 22public static implicit operator JsonNode?(bool? value) => JsonValue.Create(value); 25/// Defines an implicit conversion of a given <see cref="byte"/> to a <see cref="JsonNode"/>. 28/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 29public static implicit operator JsonNode(byte value) => JsonValue.Create(value); 32/// Defines an implicit conversion of a given <see cref="byte"/> to a <see cref="JsonNode"/>. 35/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 36public static implicit operator JsonNode?(byte? value) => JsonValue.Create(value); 39/// Defines an implicit conversion of a given <see cref="char"/> to a <see cref="JsonNode"/>. 42/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 43public static implicit operator JsonNode(char value) => JsonValue.Create(value); 46/// Defines an implicit conversion of a given <see cref="char"/> to a <see cref="JsonNode"/>. 49/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 50public static implicit operator JsonNode?(char? value) => JsonValue.Create(value); 53/// Defines an implicit conversion of a given <see cref="DateTime"/> to a <see cref="JsonNode"/>. 56/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 57public static implicit operator JsonNode(DateTime value) => JsonValue.Create(value); 60/// Defines an implicit conversion of a given <see cref="DateTime"/> to a <see cref="JsonNode"/>. 63/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 64public static implicit operator JsonNode?(DateTime? value) => JsonValue.Create(value); 67/// Defines an implicit conversion of a given <see cref="DateTimeOffset"/> to a <see cref="JsonNode"/>. 70/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 71public static implicit operator JsonNode(DateTimeOffset value) => JsonValue.Create(value); 74/// Defines an implicit conversion of a given <see cref="DateTimeOffset"/> to a <see cref="JsonNode"/>. 77/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 78public static implicit operator JsonNode?(DateTimeOffset? value) => JsonValue.Create(value); 81/// Defines an implicit conversion of a given <see cref="decimal"/> to a <see cref="JsonNode"/>. 84/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 85public static implicit operator JsonNode(decimal value) => JsonValue.Create(value); 88/// Defines an implicit conversion of a given <see cref="decimal"/> to a <see cref="JsonNode"/>. 91/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 92public static implicit operator JsonNode?(decimal? value) => JsonValue.Create(value); 95/// Defines an implicit conversion of a given <see cref="double"/> to a <see cref="JsonNode"/>. 98/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 99public static implicit operator JsonNode(double value) => JsonValue.Create(value); 102/// Defines an implicit conversion of a given <see cref="double"/> to a <see cref="JsonNode"/>. 105/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 106public static implicit operator JsonNode?(double? value) => JsonValue.Create(value); 109/// Defines an implicit conversion of a given <see cref="Guid"/> to a <see cref="JsonNode"/>. 112/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 113public static implicit operator JsonNode(Guid value) => JsonValue.Create(value); 116/// Defines an implicit conversion of a given <see cref="Guid"/> to a <see cref="JsonNode"/>. 119/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 120public static implicit operator JsonNode?(Guid? value) => JsonValue.Create(value); 123/// Defines an implicit conversion of a given <see cref="short"/> to a <see cref="JsonNode"/>. 126/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 127public static implicit operator JsonNode(short value) => JsonValue.Create(value); 130/// Defines an implicit conversion of a given <see cref="short"/> to a <see cref="JsonNode"/>. 133/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 134public static implicit operator JsonNode?(short? value) => JsonValue.Create(value); 137/// Defines an implicit conversion of a given <see cref="int"/> to a <see cref="JsonNode"/>. 140/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 141public static implicit operator JsonNode(int value) => JsonValue.Create(value); 144/// Defines an implicit conversion of a given <see cref="int"/> to a <see cref="JsonNode"/>. 147/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 148public static implicit operator JsonNode?(int? value) => JsonValue.Create(value); 151/// Defines an implicit conversion of a given <see cref="long"/> to a <see cref="JsonNode"/>. 154/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 155public static implicit operator JsonNode(long value) => JsonValue.Create(value); 158/// Defines an implicit conversion of a given <see cref="long"/> to a <see cref="JsonNode"/>. 161/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 162public static implicit operator JsonNode?(long? value) => JsonValue.Create(value); 165/// Defines an implicit conversion of a given <see cref="sbyte"/> to a <see cref="JsonNode"/>. 168/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 170public static implicit operator JsonNode(sbyte value) => JsonValue.Create(value); 173/// Defines an implicit conversion of a given <see cref="sbyte"/> to a <see cref="JsonNode"/>. 176/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 178public static implicit operator JsonNode?(sbyte? value) => JsonValue.Create(value); 181/// Defines an implicit conversion of a given <see cref="float"/> to a <see cref="JsonNode"/>. 184/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 185public static implicit operator JsonNode(float value) => JsonValue.Create(value); 188/// Defines an implicit conversion of a given <see cref="float"/> to a <see cref="JsonNode"/>. 191/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 192public static implicit operator JsonNode?(float? value) => JsonValue.Create(value); 195/// Defines an implicit conversion of a given <see cref="string"/> to a <see cref="JsonNode"/>. 198/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 200public static implicit operator JsonNode?(string? value) => JsonValue.Create(value); 203/// Defines an implicit conversion of a given <see cref="ushort"/> to a <see cref="JsonNode"/>. 206/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 208public static implicit operator JsonNode(ushort value) => JsonValue.Create(value); 211/// Defines an implicit conversion of a given <see cref="ushort"/> to a <see cref="JsonNode"/>. 214/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 216public static implicit operator JsonNode?(ushort? value) => JsonValue.Create(value); 219/// Defines an implicit conversion of a given <see cref="uint"/> to a <see cref="JsonNode"/>. 222/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 224public static implicit operator JsonNode(uint value) => JsonValue.Create(value); 227/// Defines an implicit conversion of a given <see cref="uint"/> to a <see cref="JsonNode"/>. 230/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 232public static implicit operator JsonNode?(uint? value) => JsonValue.Create(value); 235/// Defines an implicit conversion of a given <see cref="ulong"/> to a <see cref="JsonNode"/>. 238/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 240public static implicit operator JsonNode(ulong value) => JsonValue.Create(value); 243/// Defines an implicit conversion of a given <see cref="ulong"/> to a <see cref="JsonNode"/>. 246/// <returns>A <see cref="JsonNode"/> instance converted from the <paramref name="value"/> parameter.</returns> 248public static implicit operator JsonNode?(ulong? value) => JsonValue.Create(value); 251/// Defines an explicit conversion of a given <see cref="bool"/> to a <see cref="JsonNode"/>. 254/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 255public static explicit operator bool(JsonNode value) => value.GetValue<bool>(); 258/// Defines an explicit conversion of a given <see cref="bool"/> to a <see cref="JsonNode"/>. 261/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 262public static explicit operator bool?(JsonNode? value) => value?.GetValue<bool>(); 265/// Defines an explicit conversion of a given <see cref="byte"/> to a <see cref="JsonNode"/>. 268/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 269public static explicit operator byte(JsonNode value) => value.GetValue<byte>(); 272/// Defines an explicit conversion of a given <see cref="byte"/> to a <see cref="JsonNode"/>. 275/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 276public static explicit operator byte?(JsonNode? value) => value?.GetValue<byte>(); 279/// Defines an explicit conversion of a given <see cref="char"/> to a <see cref="JsonNode"/>. 282/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 283public static explicit operator char(JsonNode value) => value.GetValue<char>(); 286/// Defines an explicit conversion of a given <see cref="char"/> to a <see cref="JsonNode"/>. 289/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 290public static explicit operator char?(JsonNode? value) => value?.GetValue<char>(); 293/// Defines an explicit conversion of a given <see cref="DateTime"/> to a <see cref="JsonNode"/>. 296/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 297public static explicit operator DateTime(JsonNode value) => value.GetValue<DateTime>(); 300/// Defines an explicit conversion of a given <see cref="DateTime"/> to a <see cref="JsonNode"/>. 303/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 304public static explicit operator DateTime?(JsonNode? value) => value?.GetValue<DateTime>(); 307/// Defines an explicit conversion of a given <see cref="DateTimeOffset"/> to a <see cref="JsonNode"/>. 310/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 311public static explicit operator DateTimeOffset(JsonNode value) => value.GetValue<DateTimeOffset>(); 314/// Defines an explicit conversion of a given <see cref="DateTimeOffset"/> to a <see cref="JsonNode"/>. 317/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 318public static explicit operator DateTimeOffset?(JsonNode? value) => value?.GetValue<DateTimeOffset>(); 321/// Defines an explicit conversion of a given <see cref="decimal"/> to a <see cref="JsonNode"/>. 324/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 325public static explicit operator decimal(JsonNode value) => value.GetValue<decimal>(); 328/// Defines an explicit conversion of a given <see cref="decimal"/> to a <see cref="JsonNode"/>. 331/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 332public static explicit operator decimal?(JsonNode? value) => value?.GetValue<decimal>(); 335/// Defines an explicit conversion of a given <see cref="double"/> to a <see cref="JsonNode"/>. 338/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 339public static explicit operator double(JsonNode value) => value.GetValue<double>(); 342/// Defines an explicit conversion of a given <see cref="double"/> to a <see cref="JsonNode"/>. 345/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 346public static explicit operator double?(JsonNode? value) => value?.GetValue<double>(); 349/// Defines an explicit conversion of a given <see cref="Guid"/> to a <see cref="JsonNode"/>. 352/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 353public static explicit operator Guid(JsonNode value) => value.GetValue<Guid>(); 356/// Defines an explicit conversion of a given <see cref="Guid"/> to a <see cref="JsonNode"/>. 359/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 360public static explicit operator Guid?(JsonNode? value) => value?.GetValue<Guid>(); 363/// Defines an explicit conversion of a given <see cref="short"/> to a <see cref="JsonNode"/>. 366/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 367public static explicit operator short(JsonNode value) => value.GetValue<short>(); 370/// Defines an explicit conversion of a given <see cref="short"/> to a <see cref="JsonNode"/>. 373/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 374public static explicit operator short?(JsonNode? value) => value?.GetValue<short>(); 377/// Defines an explicit conversion of a given <see cref="int"/> to a <see cref="JsonNode"/>. 380/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 381public static explicit operator int(JsonNode value) => value.GetValue<int>(); 384/// Defines an explicit conversion of a given <see cref="int"/> to a <see cref="JsonNode"/>. 387/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 388public static explicit operator int?(JsonNode? value) => value?.GetValue<int>(); 391/// Defines an explicit conversion of a given <see cref="long"/> to a <see cref="JsonNode"/>. 394/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 395public static explicit operator long(JsonNode value) => value.GetValue<long>(); 398/// Defines an explicit conversion of a given <see cref="long"/> to a <see cref="JsonNode"/>. 401/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 402public static explicit operator long?(JsonNode? value) => value?.GetValue<long>(); 405/// Defines an explicit conversion of a given <see cref="sbyte"/> to a <see cref="JsonNode"/>. 408/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 410public static explicit operator sbyte(JsonNode value) => value.GetValue<sbyte>(); 413/// Defines an explicit conversion of a given <see cref="sbyte"/> to a <see cref="JsonNode"/>. 416/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 418public static explicit operator sbyte?(JsonNode? value) => value?.GetValue<sbyte>(); 421/// Defines an explicit conversion of a given <see cref="float"/> to a <see cref="JsonNode"/>. 424/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 425public static explicit operator float(JsonNode value) => value.GetValue<float>(); 428/// Defines an explicit conversion of a given <see cref="float"/> to a <see cref="JsonNode"/>. 431/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 432public static explicit operator float?(JsonNode? value) => value?.GetValue<float>(); 435/// Defines an explicit conversion of a given <see cref="string"/> to a <see cref="JsonNode"/>. 438/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 439public static explicit operator string?(JsonNode? value) => value?.GetValue<string>(); 442/// Defines an explicit conversion of a given <see cref="ushort"/> to a <see cref="JsonNode"/>. 445/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 447public static explicit operator ushort(JsonNode value) => value.GetValue<ushort>(); 450/// Defines an explicit conversion of a given <see cref="ushort"/> to a <see cref="JsonNode"/>. 453/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 455public static explicit operator ushort?(JsonNode? value) => value?.GetValue<ushort>(); 458/// Defines an explicit conversion of a given <see cref="uint"/> to a <see cref="JsonNode"/>. 461/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 463public static explicit operator uint(JsonNode value) => value.GetValue<uint>(); 466/// Defines an explicit conversion of a given <see cref="uint"/> to a <see cref="JsonNode"/>. 469/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 471public static explicit operator uint?(JsonNode? value) => value?.GetValue<uint>(); 474/// Defines an explicit conversion of a given <see cref="ulong"/> to a <see cref="JsonNode"/>. 477/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 479public static explicit operator ulong(JsonNode value) => value.GetValue<ulong>(); 482/// Defines an explicit conversion of a given <see cref="ulong"/> to a <see cref="JsonNode"/>. 485/// <returns>A value converted from the <see cref="JsonNode"/> instance.</returns> 487public static explicit operator ulong?(JsonNode? value) => value?.GetValue<ulong>();
System\Text\Json\Nodes\JsonNode.Parse.cs (12)
20/// The <see cref="JsonNode"/> from the reader. 47public static JsonNode? Parse( 62/// A <see cref="JsonNode"/> representation of the JSON value. 70public static JsonNode? Parse( 88/// A <see cref="JsonNode"/> representation of the JSON value. 93public static JsonNode? Parse( 104/// <see cref="JsonNode"/>. The Stream will be read to completion. 110/// A <see cref="JsonNode"/> representation of the JSON value. 115public static JsonNode? Parse( 128/// <see cref="JsonNode"/>. The Stream will be read to completion. 135/// A <see cref="Task"/> to produce a <see cref="JsonNode"/> representation of the JSON value. 140public static async Task<JsonNode?> ParseAsync(
System\Text\Json\Nodes\JsonNode.To.cs (1)
70/// Write the <see cref="JsonNode"/> into the provided <see cref="Utf8JsonWriter"/> as JSON.
System\Text\Json\Nodes\JsonNodeOptions.cs (1)
7/// Options to control <see cref="JsonNode"/> behavior.
System\Text\Json\Nodes\JsonObject.cs (33)
36public JsonObject(IEnumerable<KeyValuePair<string, JsonNode?>> properties, JsonNodeOptions? options = null) : this(options) 38int capacity = properties is ICollection<KeyValuePair<string, JsonNode?>> propertiesCollection ? propertiesCollection.Count : 0; 39OrderedDictionary<string, JsonNode?> dictionary = CreateDictionary(options, capacity); 41foreach (KeyValuePair<string, JsonNode?> node in properties) 78private OrderedDictionary<string, JsonNode?> Dictionary => _dictionary ?? InitializeDictionary(); 80private protected override JsonNode? GetItem(int index) => GetAt(index).Value; 81private protected override void SetItem(int index, JsonNode? value) => SetAt(index, value); 83internal override JsonNode DeepCloneCore() 85GetUnderlyingRepresentation(out OrderedDictionary<string, JsonNode?>? dictionary, out JsonElement? jsonElement); 99foreach (KeyValuePair<string, JsonNode?> item in dictionary) 107internal string GetPropertyName(JsonNode? node) 109KeyValuePair<string, JsonNode?>? item = FindValue(node); 124public bool TryGetPropertyValue(string propertyName, out JsonNode? jsonNode) => TryGetPropertyValue(propertyName, out jsonNode, out _); 141public bool TryGetPropertyValue(string propertyName, out JsonNode? jsonNode, out int index) 165GetUnderlyingRepresentation(out OrderedDictionary<string, JsonNode?>? dictionary, out JsonElement? jsonElement); 176foreach (KeyValuePair<string, JsonNode?> entry in Dictionary) 196internal override bool DeepEqualsCore(JsonNode node) 206OrderedDictionary<string, JsonNode?> currentDict = Dictionary; 207OrderedDictionary<string, JsonNode?> otherDict = jsonObject.Dictionary; 214foreach (KeyValuePair<string, JsonNode?> item in currentDict) 216if (!otherDict.TryGetValue(item.Key, out JsonNode? jsonNode) || !DeepEquals(item.Value, jsonNode)) 229internal JsonNode? GetItem(string propertyName) 233if (TryGetPropertyValue(propertyName, out JsonNode? value)) 242internal override void GetPath(ref ValueStringBuilder path, JsonNode? child) 263internal void SetItem(string propertyName, JsonNode? value) 267OrderedDictionary<string, JsonNode?> dict = Dictionary; 281JsonNode? replacedValue = dict.GetAt(index).Value; 295private void DetachParent(JsonNode? item) 305private KeyValuePair<string, JsonNode?>? FindValue(JsonNode? value) 307foreach (KeyValuePair<string, JsonNode?> item in Dictionary) 340foreach (KeyValuePair<string, JsonNode?> item in _node) 355public JsonNode? Value;
System\Text\Json\Nodes\JsonObject.IDictionary.cs (29)
13private OrderedDictionary<string, JsonNode?>? _dictionary; 26public void Add(string propertyName, JsonNode? value) 43public bool TryAdd(string propertyName, JsonNode? value) => TryAdd(propertyName, value, out _); 55public bool TryAdd(string propertyName, JsonNode? value, out int index) 86public void Add(KeyValuePair<string, JsonNode?> property) => Add(property.Key, property.Value); 93OrderedDictionary<string, JsonNode?>? dictionary = _dictionary; 101foreach (JsonNode? node in dictionary.Values) 145bool success = Dictionary.Remove(propertyName, out JsonNode? removedNode); 155/// Determines whether the <see cref="JsonObject"/> contains a specific property name and <see cref="JsonNode"/> reference. 161bool ICollection<KeyValuePair<string, JsonNode?>>.Contains(KeyValuePair<string, JsonNode?> item) => 162((IDictionary<string, JsonNode?>)Dictionary).Contains(item); 181void ICollection<KeyValuePair<string, JsonNode?>>.CopyTo(KeyValuePair<string, JsonNode?>[] array, int index) => 182((IDictionary<string, JsonNode?>)Dictionary).CopyTo(array, index); 190public IEnumerator<KeyValuePair<string, JsonNode?>> GetEnumerator() => Dictionary.GetEnumerator(); 201bool ICollection<KeyValuePair<string, JsonNode?>>.Remove(KeyValuePair<string, JsonNode?> item) => Remove(item.Key); 206ICollection<string> IDictionary<string, JsonNode?>.Keys => Dictionary.Keys; 211ICollection<JsonNode?> IDictionary<string, JsonNode?>.Values => Dictionary.Values; 227bool IDictionary<string, JsonNode?>.TryGetValue(string propertyName, out JsonNode? jsonNode) 237bool ICollection<KeyValuePair<string, JsonNode?>>.IsReadOnly => false; 247private OrderedDictionary<string, JsonNode?> InitializeDictionary() 249GetUnderlyingRepresentation(out OrderedDictionary<string, JsonNode?>? dictionary, out JsonElement? jsonElement); 259JsonNode? node = JsonNodeConverter.Create(jElementProperty.Value, Options); 278private static OrderedDictionary<string, JsonNode?> CreateDictionary(JsonNodeOptions? options, int capacity = 0) 291private void GetUnderlyingRepresentation(out OrderedDictionary<string, JsonNode?>? dictionary, out JsonElement? jsonElement)
System\Text\Json\Nodes\JsonObject.IList.cs (17)
15public KeyValuePair<string, JsonNode?> GetAt(int index) => Dictionary.GetAt(index); 24public void SetAt(int index, string propertyName, JsonNode? value) 28OrderedDictionary<string, JsonNode?> dictionary = Dictionary; 29KeyValuePair<string, JsonNode?> existing = dictionary.GetAt(index); 40public void SetAt(int index, JsonNode? value) 42OrderedDictionary<string, JsonNode?> dictionary = Dictionary; 43KeyValuePair<string, JsonNode?> existing = dictionary.GetAt(index); 67public void Insert(int index, string propertyName, JsonNode? value) 80KeyValuePair<string, JsonNode?> existing = Dictionary.GetAt(index); 86KeyValuePair<string, JsonNode?> IList<KeyValuePair<string, JsonNode?>>.this[int index] 93int IList<KeyValuePair<string, JsonNode?>>.IndexOf(KeyValuePair<string, JsonNode?> item) => ((IList<KeyValuePair<string, JsonNode?>>)Dictionary).IndexOf(item); 96void IList<KeyValuePair<string, JsonNode?>>.Insert(int index, KeyValuePair<string, JsonNode?> item) => Insert(index, item.Key, item.Value); 99void IList<KeyValuePair<string, JsonNode?>>.RemoveAt(int index) => RemoveAt(index);
System\Text\Json\Nodes\JsonValue.cs (6)
32/// <seealso cref="JsonNode.GetValue{T}"></seealso> 57if (value is JsonNode) 91if (value is JsonNode) 106internal override bool DeepEqualsCore(JsonNode otherNode) 126static JsonElement ToJsonElement(JsonNode node, out JsonDocument? backingDocument) 154internal sealed override void GetPath(ref ValueStringBuilder path, JsonNode? child)
System\Text\Json\Nodes\JsonValueOfElement.cs (2)
20internal override JsonNode DeepCloneCore() => new JsonValueOfElement(Value.Clone(), Options); 23internal override bool DeepEqualsCore(JsonNode otherNode)
System\Text\Json\Nodes\JsonValueOfJsonPrimitive.cs (3)
46internal override JsonNode DeepCloneCore() => new JsonValueOfJsonString(_value, Options); 137internal override JsonNode DeepCloneCore() => new JsonValueOfJsonBool(_value, Options); 184internal override JsonNode DeepCloneCore() => new JsonValueOfJsonNumber(_value, Options);
System\Text\Json\Nodes\JsonValueOfT.cs (1)
19Debug.Assert(value is not JsonNode);
System\Text\Json\Nodes\JsonValueOfTCustomized.cs (1)
27internal override JsonNode DeepCloneCore() => JsonSerializer.SerializeToNode(Value, _jsonTypeInfo)!;
System\Text\Json\Nodes\JsonValueOfTPrimitive.cs (2)
28internal override JsonNode DeepCloneCore() => new JsonValuePrimitive<TValue>(Value, _converter, Options); 30internal override bool DeepEqualsCore(JsonNode otherNode)
System\Text\Json\Schema\JsonSchema.cs (14)
62public JsonNode? Constant { get => _constant; set { VerifyMutable(); _constant = value; } } 63private JsonNode? _constant; 89public JsonNode? DefaultValue { get => _defaultValue; set { VerifyMutable(); _defaultValue = value; } } 90private JsonNode? _defaultValue; 151public JsonNode ToJsonNode(JsonSchemaExporterOptions options) 155return CompleteSchema((JsonNode)boolSchema); 170if (MapSchemaType(Type) is JsonNode type) 206requiredArray.Add((JsonNode)requiredProperty); 250objSchema.Add(MinLengthPropertyName, (JsonNode)minLength); 255objSchema.Add(MaxLengthPropertyName, (JsonNode)maxLength); 260JsonNode CompleteSchema(JsonNode schema) 312public static JsonNode? MapSchemaType(JsonSchemaType schemaType) 329array.Add((JsonNode)ToIdentifier(type)!);
System\Text\Json\Schema\JsonSchemaExporter.cs (7)
21/// Gets the JSON schema for <paramref name="type"/> as a <see cref="JsonNode"/> document. 27public static JsonNode GetJsonSchemaAsNode(this JsonSerializerOptions options, Type type, JsonSchemaExporterOptions? exporterOptions = null) 38/// Gets the JSON schema for <paramref name="typeInfo"/> as a <see cref="JsonNode"/> document. 43public static JsonNode GetJsonSchemaAsNode(this JsonTypeInfo typeInfo, JsonSchemaExporterOptions? exporterOptions = null) 114JsonNode discriminatorNode = discriminatorValue switch 116string stringId => (JsonNode)stringId, 117_ => (JsonNode)(int)discriminatorValue,
System\Text\Json\Schema\JsonSchemaExporterOptions.cs (2)
31public Func<JsonSchemaExporterContext, JsonNode, JsonNode>? TransformSchemaNode { get; init; }
System\Text\Json\Serialization\Attributes\JsonExtensionDataAttribute.cs (1)
16/// <see cref="object"/>, the type of object created will either be a <see cref="System.Text.Json.Nodes.JsonNode"/> or a
System\Text\Json\Serialization\Converters\Node\JsonArrayConverter.cs (1)
57JsonNode? item = JsonNodeConverter.ReadAsJsonNode(ref reader, options);
System\Text\Json\Serialization\Converters\Node\JsonNodeConverter.cs (7)
14internal sealed class JsonNodeConverter : JsonConverter<JsonNode?> 18public override void Write(Utf8JsonWriter writer, JsonNode? value, JsonSerializerOptions options) 30public override JsonNode? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 37internal static JsonNode? ReadAsJsonElement(ref Utf8JsonReader reader, JsonNodeOptions options) 58internal static JsonNode? ReadAsJsonNode(ref Utf8JsonReader reader, JsonNodeOptions options) 79public static JsonNode? Create(JsonElement element, JsonNodeOptions? options) 81JsonNode? node;
System\Text\Json\Serialization\Converters\Node\JsonNodeConverterFactory.cs (2)
33Debug.Assert(typeof(JsonNode) == typeToConvert); 37public override bool CanConvert(Type typeToConvert) => typeof(JsonNode).IsAssignableFrom(typeToConvert);
System\Text\Json\Serialization\Converters\Node\JsonObjectConverter.cs (5)
25bool success = JsonNodeConverter.Instance.TryRead(ref reader, typeof(JsonNode), options, ref state, out JsonNode? value, out _); 31Debug.Assert(value == null || value is JsonNode); 32JsonNode? jNodeValue = value; 98JsonNode? value = JsonNodeConverter.ReadAsJsonNode(ref reader, options);
System\Text\Json\Serialization\Converters\Object\ObjectConverter.cs (1)
132JsonNode? node = JsonNodeConverter.Instance.Read(ref reader, typeToConvert, options);
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (1)
505enumValues.Add((JsonNode)fieldInfo.JsonName);
System\Text\Json\Serialization\Converters\Value\JsonPrimitiveConverter.cs (3)
60new JsonSchema { Enum = [(JsonNode)"NaN", (JsonNode)"Infinity", (JsonNode)"-Infinity"] },
System\Text\Json\Serialization\JsonSerializer.Read.HandleMetadata.cs (3)
416JsonNode? jsonNode, 425foreach (KeyValuePair<string, JsonNode?> property in jsonObject) 463static string ReadAsStringMetadataValue(JsonNode? jsonNode)
System\Text\Json\Serialization\JsonSerializer.Read.HandlePropertyName.cs (1)
126genericArgs[1].UnderlyingSystemType == typeof(Nodes.JsonNode));
System\Text\Json\Serialization\JsonSerializer.Read.Node.cs (17)
15/// Converts the <see cref="JsonNode"/> representing a single JSON value into a <typeparamref name="TValue"/>. 19/// <param name="node">The <see cref="JsonNode"/> to convert.</param> 30public static TValue? Deserialize<TValue>(this JsonNode? node, JsonSerializerOptions? options = null) 37/// Converts the <see cref="JsonNode"/> representing a single JSON value into a <paramref name="returnType"/>. 40/// <param name="node">The <see cref="JsonNode"/> to convert.</param> 52public static object? Deserialize(this JsonNode? node, Type returnType, JsonSerializerOptions? options = null) 61/// Converts the <see cref="JsonNode"/> representing a single JSON value into a <typeparamref name="TValue"/>. 65/// <param name="node">The <see cref="JsonNode"/> to convert.</param> 73public static TValue? Deserialize<TValue>(this JsonNode? node, JsonTypeInfo<TValue> jsonTypeInfo) 82/// Converts the <see cref="JsonNode"/> representing a single JSON value into an instance specified by the <paramref name="jsonTypeInfo"/>. 85/// <param name="node">The <see cref="JsonNode"/> to convert.</param> 90public static object? Deserialize(this JsonNode? node, JsonTypeInfo jsonTypeInfo) 99/// Converts the <see cref="JsonNode"/> representing a single JSON value into a <paramref name="returnType"/>. 102/// <param name="node">The <see cref="JsonNode"/> to convert.</param> 130public static object? Deserialize(this JsonNode? node, Type returnType, JsonSerializerContext context) 139private static TValue? ReadFromNode<TValue>(JsonNode? node, JsonTypeInfo<TValue> jsonTypeInfo) 160private static object? ReadFromNodeAsObject(JsonNode? node, JsonTypeInfo jsonTypeInfo)
System\Text\Json\Serialization\JsonSerializer.Write.Node.cs (19)
15/// Converts the provided value into a <see cref="JsonNode"/>. 18/// <returns>A <see cref="JsonNode"/> representation of the JSON value.</returns> 27public static JsonNode? SerializeToNode<TValue>(TValue value, JsonSerializerOptions? options = null) 34/// Converts the provided value into a <see cref="JsonNode"/>. 36/// <returns>A <see cref="JsonNode"/> representation of the value.</returns> 52public static JsonNode? SerializeToNode(object? value, Type inputType, JsonSerializerOptions? options = null) 60/// Converts the provided value into a <see cref="JsonNode"/>. 63/// <returns>A <see cref="JsonNode"/> representation of the value.</returns> 69public static JsonNode? SerializeToNode<TValue>(TValue value, JsonTypeInfo<TValue> jsonTypeInfo) 78/// Converts the provided value into a <see cref="JsonNode"/>. 80/// <returns>A <see cref="JsonNode"/> representation of the value.</returns> 89public static JsonNode? SerializeToNode(object? value, JsonTypeInfo jsonTypeInfo) 98/// Converts the provided value into a <see cref="JsonNode"/>. 100/// <returns>A <see cref="JsonNode"/> representation of the value.</returns> 115public static JsonNode? SerializeToNode(object? value, Type inputType, JsonSerializerContext context) 124private static JsonNode? WriteNode<TValue>(in TValue value, JsonTypeInfo<TValue> jsonTypeInfo) 134return JsonNode.Parse(output.WrittenSpan, options.GetNodeOptions(), options.GetDocumentOptions()); 142private static JsonNode? WriteNodeAsObject(object? value, JsonTypeInfo jsonTypeInfo) 152return JsonNode.Parse(output.WrittenSpan, options.GetNodeOptions(), options.GetDocumentOptions());
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Converters.cs (3)
143/// Returns a <see cref="JsonConverter{T}"/> instance that converts <see cref="JsonNode"/> values. 146public static JsonConverter<JsonNode?> JsonNodeConverter => s_jsonNodeConverter ??= new JsonNodeConverter(); 147private static JsonConverter<JsonNode?>? s_jsonNodeConverter;
System.Windows.Forms.Analyzers.Tests (3)
CurrentReferences.cs (3)
142JsonObject? jsonObject = JsonNode.Parse(globalJsonString)?.AsObject(); 155JsonObject? jsonObject = JsonNode.Parse(configJsonString)?.AsObject(); 156JsonNode? runtimeOptions = jsonObject?["runtimeOptions"];