ArduinoJson 6.1.0-beta
* Return `JsonArray` and `JsonObject` by value instead of reference (issue #309)
* Replaced `success()` with `isNull()`

Special note

ArduinoJson 6 requires updating code written for version 5. Visit arduinojson.org for more information.

Changes since 6.0.1-beta

  • Return JsonArray and JsonObject by value instead of reference (issue #309)
  • Replaced success() with isNull()

View version history

BREAKING CHANGES

Old code:

JsonObject& obj = doc.to<JsonObject>();
JsonArray& arr = obj.createNestedArray("key");
if (!arr.success()) {
  Serial.println("Not enough memory");
  return;
}

New code:

JsonObject obj = doc.to<JsonObject>();
JsonArray arr = obj.createNestedArray("key");
if (arr.isNull()) {
  Serial.println("Not enough memory");
  return;
}

How to install

There are several ways to install ArduinoJson, from simpler to more complex:

  1. Use the Arduino Library Manager
  2. Download ArduinoJson-v6.1.0-beta.h put it in your project folder
  3. Download ArduinoJson-v6.1.0-beta.zip and extract it in you libraries folder

Note: ArduinoJson-v6.1.0-beta.h are ArduinoJson-v6.1.0-beta.hpp are almost identical; the difference is that the .hpp keeps everything in the ArduinoJson namespace.

Try online