Table of Contents

Namespace Invex.Extensions.Json

Classes

JsonExtensions

Extension methods for working with System.Text.Json nodes using a human-readable path notation.

Path conventions:

  • Object properties are separated by a configurable separator, colon by default (e.g., "user:address:city").
  • Arrays are addressed with bracketed indices (e.g., "users:[0]:name") in flattened/unflattened keys.
  • For in-place replacement via ReplaceValues(JsonObject, Dictionary<string, string?>, string), array steps use bare numeric segments instead (e.g., "users:0:name").

These helpers are allocation-conscious and designed for clarity when manipulating JSON in config and ETL scenarios.

JsonUtil

Provides extension members on System.Text.Json.Nodes.JsonObject for flattening a hierarchical JSON structure into a single level and reconstructing (unflattening) it again.

Path conventions used by this class:

  • Object property segments are joined with a configurable separator (default ":"), e.g., "user:address:city".
  • Array elements are addressed with bare zero-based numeric segments, e.g., "users:0:name".

Note: this differs from Flatten(JsonNode, string), which uses bracketed indices such as "users:[0]:name".