ArduinoJson v6.8.0-beta Release Notes
Release Date: 2019-01-30 // about 5 years ago-
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()
acceptsJsonArrayConst
andJsonObjectConst
JsonDocument
was missing in the ArduinoJson namespace- ➕ Added
memoryUsage()
toJsonArray
,JsonObject
, andJsonVariant
- ➕ Added
nesting()
toJsonArray
,JsonDocument
,JsonObject
, andJsonVariant
- Replaced
JsonDocument::nestingLimit
with an additional parameter
todeserializeJson()
anddeserializeMsgPack()
- 🛠 Fixed uninitialized variant in
JsonDocument
- 🛠 Fixed
StaticJsonDocument
copy constructor and copy assignment - The copy constructor of
DynamicJsonDocument
chooses 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
/DynamicJsonDocument
from aJsonArray
/JsonObject
/JsonVariant
- ➕ Added
JsonDocument::isNull()
- ➕ Added
JsonDocument::operator[]
- ➕ Added
ARDUINOJSON_TAB
to configure the indentation character - ⬇️ Reduced the size of the pretty JSON serializer
- ➕ Added
add()
,createNestedArray()
andcreateNestedObject()
toJsonVariant
JsonVariant
automatically promotes toJsonObject
orJsonArray
on write.
CallingJsonVariant::to<T>()
is not required anymore.- 👍
JsonDocument
now support the same operations asJsonVariant
.
CallingJsonDocument::as<T>()
is not required anymore. - 🛠 Fixed example
JsonHttpClient.ino
- 👉 User can now use a
JsonString
as a key or a value
💥 BREAKING CHANGES ⚠️
DynamicJsonDocument
's constructorThe parameter to the constructor of
DynamicJsonDocument
is now mandatoryOld code:
DynamicJsonDocument doc;
New code:
DynamicJsonDocument doc(1024);
Nesting limit
JsonDocument::nestingLimit
was replaced with a new parameter todeserializeJson()
anddeserializeMsgPack()
.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.h
put it in your project folder - Download
ArduinoJson-v6.8.0-beta.zip
and extract it in youlibraries
folder
Note:
ArduinoJson-v6.8.0-beta.h
areArduinoJson-v6.8.0-beta.hpp
are almost identical; the difference is that the.hpp
keeps everything in theArduinoJson
namespace.Try online