99.999% of the time, this is caused by a confusion between arrays and objects.

This often happens when the JSON document contains [{ or :[.

Example 1: an array of object

[{"hello":"world"}]

Bad

JsonObject& root = jsonBuffer.parseObject(json);
const char* world = root["hello"];

Good

JsonArray& root = jsonBuffer.parseArray(json);
const char* world = root[0]["hello"];

Example 2: an array in an object

{"hello":["world"]}

Bad

JsonObject& root = jsonBuffer.parseObject(json);
const char* world = root["hello"];

Good

JsonArray& root = jsonBuffer.parseArray(json);
const char* world = root["hello"][0];

Example 3: an object in an array in an object

{"hello":[{"new":"world"}]}

Bad

JsonObject& root = jsonBuffer.parseObject(json);
const char* world = root["hello"]["new"];

Good

JsonArray& root = jsonBuffer.parseArray(json);
const char* world = root["hello"][0]["new"];

See also