flatten


Description:

public static HashMap<string,JsonValue>? flatten (JsonValue root)

Flattens a nested JSON object into dot-notation keys.

Nested objects are converted to dot-notation keys. For example, an object with nested key "a.b" becomes flat.

Example:

    var flat = Json.flatten (root);
var v = flat.get ("config.db.port");

Parameters:

root

the root value (must be an object).

Returns:

flat map of dot-notation keys to leaf values, or null if not an object.