SparkJson fails to parse array with more than six items

Hi all,

I’ve got myself setup with the SparkJson library and I’ve observed that this JSON fails to parse:

char test[] = "{\"led\":[1,2,3,4,5,6,7]}";

StaticJsonBuffer<200> jsonBuffer;
JsonObject& root = jsonBuffer.parseObject(test);

if (!root.success()) {
  Serial.println("parseObject() failed");
  return -1;
}

However, if I was to remove the number 7 and run it again the JSON is parsed. Anyone know why? Could it be a bug in the SparkJson?

Try to increase the buffer size from 200 to 256 (or more)

Look are the answer to this issue

Obviously a PEBKAC problem :slight_smile:

I incorrectly assumed the buffer size was actually character count (coming from a Java background). I bumped the buffer count to 512 and it now handles the rest of my array.

Thanks!