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.
6.0.1-beta
Changes since- Return
JsonArray
andJsonObject
by value instead of reference (issue #309) - Replaced
success()
withisNull()
⚠ ️
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:
- Use the Arduino Library Manager
- Download
ArduinoJson-v6.1.0-beta.h
put it in your project folder - Download
ArduinoJson-v6.1.0-beta.zip
and extract it in youlibraries
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.