ArduinoJson: F.A.Q

Can I access to object member by its index, instead of its key?


But you can enumerate all the key-value pairs in the object, by using iterators:

char json[] = "{\"key\":\"value\"}";
JsonObject& object = jsonBuffer.parseObject(json);

for(JsonObject::iterator it=object.begin(); it!=object.end(); ++it)
    const char* key = it->key;

    if (it-><char*>()) {
        const char* value = it->value;
        // ...

    if (it-><JsonObject>()) {
        JsonObject& value = it->value;
        // you can recursively traverse objects...

See issue #278.

Fork me on GitHub