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
678 references to JsonNode
Aspire.Components.Common.Tests (4)
ConformanceTests.cs (4)
326var config = JsonNode.Parse(ValidJsonConfig); 340var config = JsonNode.Parse(json);
Aspire.Dashboard (1)
Otlp\Model\OtlpHelpers.cs (1)
109private static JsonNode? ConvertAnyValue(AnyValue value)
Aspire.Hosting (2)
Dcp\ApplicationExecutor.cs (2)
2038var current = JsonSerializer.SerializeToNode(obj); 2043var changed = JsonSerializer.SerializeToNode(copy);
Aspire.Hosting.Azure (13)
AzureBicepResource.cs (1)
156if (inputValue is JsonNode || inputValue is IEnumerable<string>)
AzureBicepResourceExtensions.cs (1)
160public static IResourceBuilder<T> WithParameter<T>(this IResourceBuilder<T> builder, string name, JsonNode value)
Provisioning\JsonExtensions.cs (3)
10public static JsonNode Prop(this JsonNode obj, string key) 12var node = obj[key];
Provisioning\Provisioners\AzureProvisioner.cs (1)
195? JsonNode.Parse(await File.ReadAllTextAsync(userSecretsPath, cancellationToken).ConfigureAwait(false))!.AsObject()
Provisioning\Provisioners\BicepProvisioner.cs (7)
48JsonNode? outputObj = null; 51outputObj = JsonNode.Parse(outputJson); 279var az = context.UserSecrets.Prop("Azure"); 282var resourceConfig = context.UserSecrets 318var configOutputs = resourceConfig.Prop("SecretOutputs"); 446var parameters = JsonNode.Parse(jsonString)?.AsObject(); 503JsonNode node => node,
Aspire.Hosting.Azure.Tests (19)
AzureBicepResourceTests.cs (19)
749var manifest = await ManifestUtils.GetManifest(infrastructure1.Resource); 774var manifest = await ManifestUtils.GetManifest(infrastructure1.Resource); 813var manifest = await ManifestUtils.GetManifest(infrastructure1.Resource); 1546var manifest = await ManifestUtils.GetManifest(postgres.Resource); 1997var blobManifest = await ManifestUtils.GetManifest(blob.Resource); 2012var queueManifest = await ManifestUtils.GetManifest(queue.Resource); 2027var tableManifest = await ManifestUtils.GetManifest(table.Resource); 2156var blobManifest = await ManifestUtils.GetManifest(blob.Resource); 2171var queueManifest = await ManifestUtils.GetManifest(queue.Resource); 2186var tableManifest = await ManifestUtils.GetManifest(table.Resource); 2314var blobManifest = await ManifestUtils.GetManifest(blob.Resource); 2329var queueManifest = await ManifestUtils.GetManifest(queue.Resource); 2344var tableManifest = await ManifestUtils.GetManifest(table.Resource); 2473var blobManifest = await ManifestUtils.GetManifest(blob.Resource); 2488var queueManifest = await ManifestUtils.GetManifest(queue.Resource); 2503var tableManifest = await ManifestUtils.GetManifest(table.Resource); 2615var aiManifest = await ManifestUtils.GetManifest(ai.Resource); 2619var serviceBusManifest = await ManifestUtils.GetManifest(serviceBus.Resource); 2623var serviceManifest = await ManifestUtils.GetManifest(serviceA.Resource);
Aspire.Hosting.Containers.Tests (5)
ContainerResourceTests.cs (5)
83var manifest = await ManifestUtils.GetManifest(c2.Resource); 113var manifest = await ManifestUtils.GetManifest(containerResource); 147var manifest = await ManifestUtils.GetManifest(containerResource); 194var manifest = await ManifestUtils.GetManifest(containerResource); 243var manifest = await ManifestUtils.GetManifest(containerResource, manifestDirectory: appHostPath);
Aspire.Hosting.Elasticsearch.Tests (2)
AddElasticsearchTests.cs (2)
163var manifest = await ManifestUtils.GetManifest(elasticsearch.Resource); 202var manifest = await ManifestUtils.GetManifest(elasticsearch.Resource);
Aspire.Hosting.Garnet.Tests (1)
AddGarnetTests.cs (1)
93var manifest = await ManifestUtils.GetManifest(garnet.Resource);
Aspire.Hosting.Kafka.Tests (1)
AddKafkaTests.cs (1)
81var manifest = await ManifestUtils.GetManifest(kafka.Resource);
Aspire.Hosting.Keycloak.Tests (1)
KeycloakResourceBuilderTests.cs (1)
133var manifest = await ManifestUtils.GetManifest(keycloak.Resource);
Aspire.Hosting.Milvus.Tests (2)
AddMilvusTests.cs (2)
138var serverManifest = await ManifestUtils.GetManifest(milvus.Resource); // using this method does not get any ExecutionContext.IsPublishMode changes 139var dbManifest = await ManifestUtils.GetManifest(db1.Resource);
Aspire.Hosting.MongoDB.Tests (2)
AddMongoDBTests.cs (2)
196var mongoManifest = await ManifestUtils.GetManifest(mongo.Resource); 197var dbManifest = await ManifestUtils.GetManifest(db.Resource);
Aspire.Hosting.MySql.Tests (3)
AddMySqlTests.cs (3)
161var mySqlManifest = await ManifestUtils.GetManifest(mysql.Resource); 162var dbManifest = await ManifestUtils.GetManifest(db.Resource); 200var serverManifest = await ManifestUtils.GetManifest(mysql.Resource);
Aspire.Hosting.Nats.Tests (2)
AddNatsTests.cs (2)
188var manifest = await ManifestUtils.GetManifest(nats.Resource); 225var manifest = await ManifestUtils.GetManifest(nats.Resource);
Aspire.Hosting.NodeJs.Tests (1)
AddNodeAppTests.cs (1)
19var manifest = await ManifestUtils.GetManifest(nodeApp.Resource);
Aspire.Hosting.Oracle.Tests (3)
AddOracleTests.cs (3)
202var serverManifest = await ManifestUtils.GetManifest(oracleServer.Resource); 203var dbManifest = await ManifestUtils.GetManifest(db.Resource); 241var serverManifest = await ManifestUtils.GetManifest(oracleServer.Resource);
Aspire.Hosting.PostgreSQL.Tests (3)
AddPostgresTests.cs (3)
251var serverManifest = await ManifestUtils.GetManifest(pgServer.Resource); 252var dbManifest = await ManifestUtils.GetManifest(db.Resource); 295var serverManifest = await ManifestUtils.GetManifest(pgServer.Resource);
Aspire.Hosting.Qdrant.Tests (2)
AddQdrantTests.cs (2)
210var serverManifest = await ManifestUtils.GetManifest(qdrant.Resource); // using this method does not get any ExecutionContext.IsPublishMode changes 248var serverManifest = await ManifestUtils.GetManifest(qdrant.Resource); // using this method does not get any ExecutionContext.IsPublishMode changes
Aspire.Hosting.RabbitMQ.Tests (2)
AddRabbitMQTests.cs (2)
205var manifest = await ManifestUtils.GetManifest(rabbit.Resource); 251var manifest = await ManifestUtils.GetManifest(rabbit.Resource);
Aspire.Hosting.Redis.Tests (3)
AddRedisTests.cs (1)
102var manifest = await ManifestUtils.GetManifest(redis.Resource);
RedisFunctionalTests.cs (2)
670var jo = JsonObject.Parse(content); 672var agreements = jo["agreements"];
Aspire.Hosting.SqlServer.Tests (3)
AddSqlServerTests.cs (3)
132var serverManifest = await ManifestUtils.GetManifest(sqlServer.Resource); 133var dbManifest = await ManifestUtils.GetManifest(db.Resource); 173var serverManifest = await ManifestUtils.GetManifest(sqlServer.Resource);
Aspire.Hosting.Tests (57)
AddParameterTests.cs (4)
151var paramManifest = await ManifestUtils.GetManifest(appModel.Resources.OfType<ParameterResource>().Single(r => r.Name == "pass")).DefaultTimeout(); 201var paramManifest = await ManifestUtils.GetManifest(appModel.Resources.OfType<ParameterResource>().Single(r => r.Name == "pass")).DefaultTimeout(); 259var paramManifest = await ManifestUtils.GetManifest(appModel.Resources.OfType<ParameterResource>().Single(r => r.Name == "pass")).DefaultTimeout(); 314var paramManifest = await ManifestUtils.GetManifest(appModel.Resources.OfType<ParameterResource>().Single(r => r.Name == "val")).DefaultTimeout();
Dashboard\DashboardResourceTests.cs (1)
518var manifest = await ManifestUtils.GetManifestOrNull(dashboard).DefaultTimeout();
ExecutableResourceTests.cs (1)
51var manifest = await ManifestUtils.GetManifest(exe2.Resource).DefaultTimeout();
KestrelConfigTests.cs (4)
177var manifest = await ManifestUtils.GetManifest(resource).DefaultTimeout(); 221var manifest = await ManifestUtils.GetManifest(resource).DefaultTimeout(); 292var manifest = await ManifestUtils.GetManifest(resource).DefaultTimeout(); 314var manifest = await ManifestUtils.GetManifest(resource).DefaultTimeout();
ManifestGenerationTests.cs (2)
100var redisManifest = await ManifestUtils.GetManifest(redis.Resource).DefaultTimeout(); 537var manifest = await ManifestUtils.GetManifest(param.Resource).DefaultTimeout();
ProjectResourceTests.cs (2)
481var manifest = await ManifestUtils.GetManifest(resource).DefaultTimeout(); 531var manifest = await ManifestUtils.GetManifest(resource).DefaultTimeout();
PublishAsConnectionStringTests.cs (1)
21var manifest = await ManifestUtils.GetManifest(redis.Resource).DefaultTimeout();
PublishAsDockerfileTests.cs (3)
22var manifest = await ManifestUtils.GetManifest(frontend.Resource).DefaultTimeout(); 57var manifest = await ManifestUtils.GetManifest(frontend.Resource).DefaultTimeout(); 95var manifest = await ManifestUtils.GetManifest(frontend.Resource).DefaultTimeout();
Schema\SchemaTests.cs (16)
231var manifestJson = JsonNode.Parse(manifestText); 265var manifestJson = JsonNode.Parse(manifestText); 285var manifestJson = JsonNode.Parse(manifestText); 304var manifestJson = JsonNode.Parse(manifestText); 344var manifestJson = JsonNode.Parse(manifestText); 367var manifestJson = JsonNode.Parse(manifestText); 745var manifestJson = JsonNode.Parse(manifestText); 758var manifestJson = JsonNode.Parse(manifestText);
Utils\ManifestUtils.cs (14)
13public static async Task<JsonNode> GetManifest(IResource resource, string? manifestDirectory = null) 15var node = await GetManifestOrNull(resource, manifestDirectory); 20public static async Task<JsonNode?> GetManifestOrNull(IResource resource, string? manifestDirectory = null) 33var obj = JsonNode.Parse(ms); 35var resourceNode = obj[resource.Name]; 39public static async Task<JsonNode[]> GetManifests(IResource[] resources) 46var results = new List<JsonNode>(); 55var obj = JsonNode.Parse(ms); 57var resourceNode = obj[r.Name]; 68public static async Task<(JsonNode ManifestNode, string BicepText)> GetManifestWithBicep(IResource resource) 71var manifestNode = await GetManifest(resource, manifestDir); 73if (!manifestNode.AsObject().TryGetPropertyValue("path", out var pathNode))
WithEndpointTests.cs (9)
272var manifest = await ManifestUtils.GetManifest(container.Resource).DefaultTimeout(); 300var manifest = await ManifestUtils.GetManifest(container.Resource).DefaultTimeout(); 327var manifest = await ManifestUtils.GetManifest(container.Resource).DefaultTimeout(); 354var manifest = await ManifestUtils.GetManifest(container.Resource).DefaultTimeout(); 381var manifest = await ManifestUtils.GetManifest(container.Resource).DefaultTimeout(); 408var manifest = await ManifestUtils.GetManifest(container.Resource).DefaultTimeout(); 435var manifest = await ManifestUtils.GetManifest(container.Resource).DefaultTimeout(); 466var manifest = await ManifestUtils.GetManifest(project.Resource).DefaultTimeout(); 536var manifest = await ManifestUtils.GetManifest(project.Resource).DefaultTimeout();
Aspire.Hosting.Valkey.Tests (1)
AddValkeyTests.cs (1)
93var manifest = await ManifestUtils.GetManifest(valkey.Resource);
ConfigurationSchemaGenerator (14)
ConfigSchemaEmitter.cs (14)
119var backupTypeNode = currentNode["type"]; 177var existingValue = propertiesNode[pathSegment]; 244var backupTypeNode = currentNode["type"]; 288var backupPropertyNode = currentNode[property.ConfigurationKeyName]; 319var backupTypeNode = currentNode["type"]; 320var backupContainerNode = currentNode[containerName]; 338private static void RestoreBackup(JsonNode? backupNode, string name, JsonObject parentNode) 453var propertyNodeType = propertyNode["type"]; 722private sealed class SchemaOrderJsonNodeConverter : JsonConverter<JsonNode> 726public override bool CanConvert(Type typeToConvert) => typeof(JsonNode).IsAssignableFrom(typeToConvert) && typeToConvert != typeof(JsonValue); 728public override void Write(Utf8JsonWriter writer, JsonNode? value, JsonSerializerOptions options) 735IEnumerable<KeyValuePair<string, JsonNode>> properties = 749foreach (var item in array) 764public 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);
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (8)
UserJwtsTests.cs (8)
213Assert.True(secretsJson.TryGetPropertyValue("Foo", out var fooField)); 431var signingKey = Assert.Single(secretsJson[SigningKeysHandler.GetSigningKeyPropertyName(DevJwtsDefaults.Scheme)].AsArray()); 434Assert.True(secretsJson.TryGetPropertyValue("Foo", out var fooField)); 459var signingKey = Assert.Single(secretsJson[SigningKeysHandler.GetSigningKeyPropertyName(DevJwtsDefaults.Scheme)].AsArray()); 462Assert.True(secretsJson.TryGetPropertyValue("Foo", out var fooField)); 498var signingKey = Assert.Single(secretsJson[SigningKeysHandler.GetSigningKeyPropertyName("test-scheme")].AsArray()); 541var signingKey1 = Assert.Single(secretsJson[SigningKeysHandler.GetSigningKeyPropertyName("test-scheme")].AsArray()); 545var 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.OpenApi (24)
Extensions\JsonNodeSchemaExtensions.cs (20)
59/// Note that this method targets <see cref="JsonNode"/> and not <see cref="OpenApiSchema"/> because it is 81/// <param name="schema">The <see cref="JsonNode"/> produced by the underlying schema generator.</param> 83internal static void ApplyValidationAttributes(this JsonNode schema, IEnumerable<Attribute> validationAttributes) 148/// <param name="schema">The <see cref="JsonNode"/> produced by the underlying schema generator.</param> 151internal static void ApplyDefaultValue(this JsonNode schema, object? defaultValue, JsonTypeInfo? jsonTypeInfo) 181/// Note that this method targets <see cref="JsonNode"/> and not <see cref="OpenApiSchema"/> because 185/// <param name="schema">The <see cref="JsonNode"/> produced by the underlying schema generator.</param> 188internal static void ApplyPrimitiveTypesAndFormats(this JsonNode schema, JsonSchemaExporterContext context, Func<JsonTypeInfo, string?> createSchemaReferenceId) 208/// <param name="schema">The <see cref="JsonNode"/> produced by the underlying schema generator.</param> 210internal static void ApplyRouteConstraints(this JsonNode schema, IEnumerable<IRouteConstraint> constraints) 284/// <param name="schema">The <see cref="JsonNode"/> produced by the underlying schema generator.</param> 287internal static void ApplyParameterInfo(this JsonNode schema, ApiParameterDescription parameterDescription, JsonTypeInfo? jsonTypeInfo) 355/// <param name="schema">The <see cref="JsonNode"/> produced by the underlying schema generator.</param> 358internal static void MapPolymorphismOptionsToDiscriminator(this JsonNode schema, JsonSchemaExporterContext context, Func<JsonTypeInfo, string?> createSchemaReferenceId) 395/// <param name="schema">The <see cref="JsonNode"/> produced by the underlying schema generator.</param> 398internal static void ApplySchemaReferenceId(this JsonNode schema, JsonSchemaExporterContext context, Func<JsonTypeInfo, string?> createSchemaReferenceId) 427/// <param name="schema">The <see cref="JsonNode"/> produced by the underlying schema generator.</param> 429internal static void ApplyNullabilityContextInfo(this JsonNode schema, ParameterInfo parameterInfo) 447/// <param name="schema">The <see cref="JsonNode"/> produced by the underlying schema generator.</param> 449internal static void ApplyNullabilityContextInfo(this JsonNode schema, JsonPropertyInfo propertyInfo)
Services\Schemas\OpenApiSchemaService.cs (1)
217private JsonNode CreateSchema(OpenApiSchemaKey key)
Services\Schemas\OpenApiSchemaStore.cs (3)
18private readonly ConcurrentDictionary<OpenApiSchemaKey, JsonNode> _schemas = new() 61public JsonNode GetOrAdd(OpenApiSchemaKey key, Func<OpenApiSchemaKey, JsonNode> valueFactory)
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"];
MSBuild (3)
JsonOutputFormatter.cs (3)
21private readonly JsonNode _topLevelNode = new JsonObject(); 37JsonNode propertiesNode = new JsonObject(); 55JsonNode itemsNode = new JsonObject();
System.Text.Json (465)
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) 271GetUnderlyingRepresentation(out List<JsonNode?>? list, out JsonElement? jsonElement); 281foreach (JsonNode? element in List) 297private List<JsonNode?> InitializeList() 299GetUnderlyingRepresentation(out List<JsonNode?>? list, out JsonElement? jsonElement); 308list = new List<JsonNode?>(jElement.GetArrayLength()); 312JsonNode? node = JsonNodeConverter.Create(element, Options); 335private void GetUnderlyingRepresentation(out List<JsonNode?>? list, out JsonElement? jsonElement) 379public 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) 169List<JsonNode?> list = List; 211void ICollection<JsonNode?>.CopyTo(JsonNode?[] array, int index) => List.CopyTo(array, index); 216/// <returns>A <see cref="IEnumerator{JsonNode}"/> for the <see cref="JsonNode"/>.</returns> 217public IEnumerator<JsonNode?> GetEnumerator() => List.GetEnumerator(); 230bool ICollection<JsonNode?>.IsReadOnly => false; 234private static void DetachParent(JsonNode? item)
System\Text\Json\Nodes\JsonNode.cs (30)
14/// declared as an <see cref="object"/> should be deserialized as a <see cref="JsonNode"/>. 20private JsonNode? _parent; 116/// Gets the parent <see cref="JsonNode"/>. 120public JsonNode? Parent 149internal abstract void GetPath(ref ValueStringBuilder path, JsonNode? child); 152/// Gets the root <see cref="JsonNode"/>. 157public JsonNode Root 161JsonNode? parent = Parent; 191/// The current <see cref="JsonNode"/> cannot be represented as a {T}. 194/// The current <see cref="JsonNode"/> is not a <see cref="JsonValue"/> or 208/// The current <see cref="JsonNode"/> is not a <see cref="JsonArray"/> or <see cref="JsonObject"/>. 210public JsonNode? this[int index] 216private protected virtual JsonNode? GetItem(int index) 222private protected virtual void SetItem(int index, JsonNode? node) => 234/// The current <see cref="JsonNode"/> is not a <see cref="JsonObject"/>. 236public JsonNode? this[string propertyName] 249/// Creates a new instance of the <see cref="JsonNode"/>. All children nodes are recursively cloned. 252public JsonNode DeepClone() => DeepCloneCore(); 254internal abstract JsonNode DeepCloneCore(); 302/// <param name="node1">The <see cref="JsonNode"/> to compare.</param> 303/// <param name="node2">The <see cref="JsonNode"/> to compare.</param> 305public static bool DeepEquals(JsonNode? node1, JsonNode? node2) 319internal abstract bool DeepEqualsCore(JsonNode node); 330JsonNode? node; 344internal void AssignParent(JsonNode parent) 351JsonNode? p = parent; 367/// to support arbitrary <see cref="JsonElement"/> and <see cref="JsonNode"/> values. 372internal static JsonNode? ConvertFromValue<T>(T? value, JsonNodeOptions? options = null) 379if (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( 91/// A <see cref="JsonNode"/> representation of the JSON value. 96public static JsonNode? Parse( 107/// <see cref="JsonNode"/>. The Stream will be read to completion. 113/// A <see cref="JsonNode"/> representation of the JSON value. 118public static JsonNode? Parse( 134/// <see cref="JsonNode"/>. The Stream will be read to completion. 141/// A <see cref="Task"/> to produce a <see cref="JsonNode"/> representation of the JSON value. 146public static async Task<JsonNode?> ParseAsync(
System\Text\Json\Nodes\JsonNode.To.cs (1)
72/// 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 (32)
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); 121public bool TryGetPropertyValue(string propertyName, out JsonNode? jsonNode) 139GetUnderlyingRepresentation(out OrderedDictionary<string, JsonNode?>? dictionary, out JsonElement? jsonElement); 150foreach (KeyValuePair<string, JsonNode?> entry in Dictionary) 170internal override bool DeepEqualsCore(JsonNode node) 180OrderedDictionary<string, JsonNode?> currentDict = Dictionary; 181OrderedDictionary<string, JsonNode?> otherDict = jsonObject.Dictionary; 188foreach (KeyValuePair<string, JsonNode?> item in currentDict) 190otherDict.TryGetValue(item.Key, out JsonNode? jsonNode); 205internal JsonNode? GetItem(string propertyName) 212if (TryGetPropertyValue(propertyName, out JsonNode? value)) 221internal override void GetPath(ref ValueStringBuilder path, JsonNode? child) 242internal void SetItem(string propertyName, JsonNode? value) 249OrderedDictionary<string, JsonNode?> dict = Dictionary; 263JsonNode? replacedValue = dict.GetAt(index).Value; 277private void DetachParent(JsonNode? item) 287private KeyValuePair<string, JsonNode?>? FindValue(JsonNode? value) 289foreach (KeyValuePair<string, JsonNode?> item in Dictionary) 322foreach (KeyValuePair<string, JsonNode?> item in _node) 337public JsonNode? Value;
System\Text\Json\Nodes\JsonObject.IDictionary.cs (27)
13private OrderedDictionary<string, JsonNode?>? _dictionary; 26public void Add(string propertyName, JsonNode? value) 49public void Add(KeyValuePair<string, JsonNode?> property) => Add(property.Key, property.Value); 56OrderedDictionary<string, JsonNode?>? dictionary = _dictionary; 64foreach (JsonNode? node in dictionary.Values) 114bool success = Dictionary.Remove(propertyName, out JsonNode? removedNode); 124/// Determines whether the <see cref="JsonObject"/> contains a specific property name and <see cref="JsonNode"/> reference. 130bool ICollection<KeyValuePair<string, JsonNode?>>.Contains(KeyValuePair<string, JsonNode?> item) => 131((IDictionary<string, JsonNode?>)Dictionary).Contains(item); 150void ICollection<KeyValuePair<string, JsonNode?>>.CopyTo(KeyValuePair<string, JsonNode?>[] array, int index) => 151((IDictionary<string, JsonNode?>)Dictionary).CopyTo(array, index); 159public IEnumerator<KeyValuePair<string, JsonNode?>> GetEnumerator() => Dictionary.GetEnumerator(); 170bool ICollection<KeyValuePair<string, JsonNode?>>.Remove(KeyValuePair<string, JsonNode?> item) => Remove(item.Key); 175ICollection<string> IDictionary<string, JsonNode?>.Keys => Dictionary.Keys; 180ICollection<JsonNode?> IDictionary<string, JsonNode?>.Values => Dictionary.Values; 196bool IDictionary<string, JsonNode?>.TryGetValue(string propertyName, out JsonNode? jsonNode) 209bool ICollection<KeyValuePair<string, JsonNode?>>.IsReadOnly => false; 219private OrderedDictionary<string, JsonNode?> InitializeDictionary() 221GetUnderlyingRepresentation(out OrderedDictionary<string, JsonNode?>? dictionary, out JsonElement? jsonElement); 231JsonNode? node = JsonNodeConverter.Create(jElementProperty.Value, Options); 250private static OrderedDictionary<string, JsonNode?> CreateDictionary(JsonNodeOptions? options, int capacity = 0) 263private 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) 31OrderedDictionary<string, JsonNode?> dictionary = Dictionary; 32KeyValuePair<string, JsonNode?> existing = dictionary.GetAt(index); 43public void SetAt(int index, JsonNode? value) 45OrderedDictionary<string, JsonNode?> dictionary = Dictionary; 46KeyValuePair<string, JsonNode?> existing = dictionary.GetAt(index); 73public void Insert(int index, string propertyName, JsonNode? value) 89KeyValuePair<string, JsonNode?> existing = Dictionary.GetAt(index); 95KeyValuePair<string, JsonNode?> IList<KeyValuePair<string, JsonNode?>>.this[int index] 102int IList<KeyValuePair<string, JsonNode?>>.IndexOf(KeyValuePair<string, JsonNode?> item) => ((IList<KeyValuePair<string, JsonNode?>>)Dictionary).IndexOf(item); 105void IList<KeyValuePair<string, JsonNode?>>.Insert(int index, KeyValuePair<string, JsonNode?> item) => Insert(index, item.Key, item.Value); 108void 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) 94if (value is JsonNode) 109internal override bool DeepEqualsCore(JsonNode otherNode) 129static JsonElement ToJsonElement(JsonNode node, out JsonDocument? backingDocument) 157internal 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\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) 45/// Gets the JSON schema for <paramref name="typeInfo"/> as a <see cref="JsonNode"/> document. 50public static JsonNode GetJsonSchemaAsNode(this JsonTypeInfo typeInfo, JsonSchemaExporterOptions? exporterOptions = null) 124JsonNode discriminatorNode = discriminatorValue switch 126string stringId => (JsonNode)stringId, 127_ => (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\JsonNodeConverter.cs (5)
15internal sealed class JsonNodeConverter : JsonConverter<JsonNode?> 27public override void Write(Utf8JsonWriter writer, JsonNode? value, JsonSerializerOptions options) 39public override JsonNode? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 60public static JsonNode? Create(JsonElement element, JsonNodeOptions? options) 62JsonNode? node;
System\Text\Json\Serialization\Converters\Node\JsonNodeConverterFactory.cs (2)
29Debug.Assert(typeof(JsonNode) == typeToConvert); 33public override bool CanConvert(Type typeToConvert) => typeof(JsonNode).IsAssignableFrom(typeToConvert);
System\Text\Json\Serialization\Converters\Node\JsonObjectConverter.cs (4)
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;
System\Text\Json\Serialization\Converters\Object\ObjectConverter.cs (1)
135JsonNode? node = JsonNodeConverter.Instance.Read(ref reader, typeToConvert, options);
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (1)
513enumValues.Add((JsonNode)fieldInfo.JsonName);
System\Text\Json\Serialization\Converters\Value\JsonPrimitiveConverter.cs (3)
63new 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) 64/// Converts the <see cref="JsonNode"/> representing a single JSON value into a <typeparamref name="TValue"/>. 68/// <param name="node">The <see cref="JsonNode"/> to convert.</param> 76public static TValue? Deserialize<TValue>(this JsonNode? node, JsonTypeInfo<TValue> jsonTypeInfo) 88/// Converts the <see cref="JsonNode"/> representing a single JSON value into an instance specified by the <paramref name="jsonTypeInfo"/>. 91/// <param name="node">The <see cref="JsonNode"/> to convert.</param> 96public static object? Deserialize(this JsonNode? node, JsonTypeInfo jsonTypeInfo) 108/// Converts the <see cref="JsonNode"/> representing a single JSON value into a <paramref name="returnType"/>. 111/// <param name="node">The <see cref="JsonNode"/> to convert.</param> 139public static object? Deserialize(this JsonNode? node, Type returnType, JsonSerializerContext context) 154private static TValue? ReadFromNode<TValue>(JsonNode? node, JsonTypeInfo<TValue> jsonTypeInfo) 175private 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) 81/// Converts the provided value into a <see cref="JsonNode"/>. 83/// <returns>A <see cref="JsonNode"/> representation of the value.</returns> 92public static JsonNode? SerializeToNode(object? value, JsonTypeInfo jsonTypeInfo) 104/// Converts the provided value into a <see cref="JsonNode"/>. 106/// <returns>A <see cref="JsonNode"/> representation of the value.</returns> 121public static JsonNode? SerializeToNode(object? value, Type inputType, JsonSerializerContext context) 133private static JsonNode? WriteNode<TValue>(in TValue value, JsonTypeInfo<TValue> jsonTypeInfo) 143return JsonNode.Parse(output.WrittenMemory.Span, options.GetNodeOptions(), options.GetDocumentOptions()); 151private static JsonNode? WriteNodeAsObject(object? value, JsonTypeInfo jsonTypeInfo) 161return JsonNode.Parse(output.WrittenMemory.Span, 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;