ArduinoJson 6.8.0-beta * Import functions in the ArduinoJson namespace to get clearer errors * Improved syntax highlighting in Arduino IDE * Removed default capacity of `DynamicJsonDocument` * `JsonArray::copyFrom()` accepts `JsonArrayConst` * `JsonVariant::set()` accepts `JsonArrayConst` and `JsonObjectConst` * `JsonDocument` was missing in the ArduinoJson namespace * Added `memoryUsage()` to `JsonArray`, `JsonObject`, and `JsonVariant` * Added `nesting()` to `JsonArray`, `JsonDocument`, `JsonObject`, and `JsonVariant` * Replaced `JsonDocument::nestingLimit` with an additional parameter
Looking for a human-readable version?
📰 Read the article on arduinojson.org
Special note ⚠ ️
ArduinoJson 6 requires updating code written for version 5. See the migration guide for details.
Changes since 6.7.0-beta
- Import functions in the ArduinoJson namespace to get clearer errors
- Improved syntax highlighting in Arduino IDE
- Removed default capacity of
DynamicJsonDocument -
JsonArray::copyFrom()acceptsJsonArrayConst -
JsonVariant::set()acceptsJsonArrayConstandJsonObjectConst -
JsonDocumentwas missing in the ArduinoJson namespace - Added
memoryUsage()toJsonArray,JsonObject, andJsonVariant - Added
nesting()toJsonArray,JsonDocument,JsonObject, andJsonVariant - Replaced
JsonDocument::nestingLimitwith an additional parameter todeserializeJson()anddeserializeMsgPack() - Fixed uninitialized variant in
JsonDocument - Fixed
StaticJsonDocumentcopy constructor and copy assignment - The copy constructor of
DynamicJsonDocumentchooses the capacity according to the memory usage of the source, not from the capacity of the source. - Added the ability to create/assign a
StaticJsonDocument/DynamicJsonDocumentfrom aJsonArray/JsonObject/JsonVariant - Added
JsonDocument::isNull() - Added
JsonDocument::operator[] - Added
ARDUINOJSON_TABto configure the indentation character - Reduced the size of the pretty JSON serializer
- Added
add(),createNestedArray()andcreateNestedObject()toJsonVariant -
JsonVariantautomatically promotes toJsonObjectorJsonArrayon write. CallingJsonVariant::to<T>()is not required anymore. -
JsonDocumentnow support the same operations asJsonVariant. CallingJsonDocument::as<T>()is not required anymore. - Fixed example
JsonHttpClient.ino - User can now use a
JsonStringas a key or a value
BREAKING CHANGES ⚠ ️
DynamicJsonDocument's constructor
The parameter to the constructor of DynamicJsonDocument is now mandatory
Old code:
DynamicJsonDocument doc;
New code:
DynamicJsonDocument doc(1024);
Nesting limit
JsonDocument::nestingLimit was replaced with a new parameter to deserializeJson() and deserializeMsgPack().
Old code:
doc.nestingLimit = 15; deserializeJson(doc, input);
New code:
deserializeJson(doc, input, DeserializationOption::NestingLimit(15));
How to install
There are several ways to install ArduinoJson, from simpler to more complex:
- Use the Arduino Library Manager
- Download
ArduinoJson-v6.8.0-beta.hput it in your project folder - Download
ArduinoJson-v6.8.0-beta.zipand extract it in youlibrariesfolder
Note: ArduinoJson-v6.8.0-beta.h are ArduinoJson-v6.8.0-beta.hpp are almost identical; the difference is that the .hpp keeps everything in the ArduinoJson namespace.