@set


Description:

public static JsonValue? @set (JsonValue root, string path, JsonValue value)

Sets a value at the given path, returning a new tree.

The original tree is not modified (immutable operation). Only single-level set on object keys is supported (e.g. `$.key`).

Example:

    var updated = Json.set (root, "$.name", JsonValue.ofString ("Bob"));

Parameters:

root

root value (must be an object).

path

JSON path expression (e.g. `$.key`).

value

the value to set.

Returns:

new tree with the value set, or null if path invalid.