Json.byKey

Iterate the keys of a JSON object with foreach.

Notes:

  • If you want to store the key, you need to duplicate it.
struct Json(uint vl = validateUsed, bool validateUtf8 = vl > trustedSource)
@safe @nogc pure nothrow @property
int delegate
(
scope int delegate
(
ref const char[]
)
)
byKey
()
if (
vl > trustedSource ||
!validateUtf8
)

Examples

uint id;
foreach (key; json.byKey)
    if (key == "id")
        id = json.read!uint;

Meta