Releases: bblanchon/ArduinoJson
ArduinoJson 6.2.2-beta
Special note ⚠️
ArduinoJson 6 requires updating code written for version 5.
Visit arduinojson.org for more information.
Changes since 6.2.1-beta
- Fixed
invalid application of 'sizeof' to incomplete type '__FlashStringHelper'
(issue #783) - Fixed
char[]
not duplicated when passed toJsonVariant::operator[]
How to install
There are several ways to install ArduinoJson, from simpler to more complex:
- Use the Arduino Library Manager
- Download
ArduinoJson-v6.2.2-beta.h
put it in your project folder - Download
ArduinoJson-v6.2.2-beta.zip
and extract it in youlibraries
folder
Note: ArduinoJson-v6.2.2-beta.h
are ArduinoJson-v6.2.2-beta.hpp
are almost identical; the difference is that the .hpp
keeps everything in the ArduinoJson
namespace.
Try online
ArduinoJson 6.2.1-beta
Special note ⚠️
ArduinoJson 6 requires updating code written for version 5.
Visit arduinojson.org for more information.
Changes since 6.2.0-beta
- Fixed
JsonObject
not inserting keys of typeString
(issue #782)
How to install
There are several ways to install ArduinoJson, from simpler to more complex:
- Use the Arduino Library Manager
- Download
ArduinoJson-v6.2.1-beta.h
put it in your project folder - Download
ArduinoJson-v6.2.1-beta.zip
and extract it in youlibraries
folder
Note: ArduinoJson-v6.2.1-beta.h
are ArduinoJson-v6.2.1-beta.hpp
are almost identical; the difference is that the .hpp
keeps everything in the ArduinoJson
namespace.
Try online
ArduinoJson 6.2.0-beta
Special note ⚠️
ArduinoJson 6 requires updating code written for version 5.
Visit arduinojson.org for more information.
Changes since 6.1.0-beta
- Disabled lazy number deserialization (issue #772)
- Improved float serialization when
-fsingle-precision-constant
is used - Renamed function
RawJson()
toserialized()
serializeMsgPack()
now supports values marked withserialized()
BREAKING CHANGES ⚠️
Non quoted strings
Non quoted strings are now forbidden in values, but they are still allowed in keys.
For example, {key:"value"}
is accepted, but {key:value}
is not.
Preformatted values
Old code:
object["values"] = RawJson("[1,2,3,4]");
New code:
object["values"] = serialized("[1,2,3,4]");
How to install
There are several ways to install ArduinoJson, from simpler to more complex:
- Use the Arduino Library Manager
- Download
ArduinoJson-v6.2.0-beta.h
put it in your project folder - Download
ArduinoJson-v6.2.0-beta.zip
and extract it in youlibraries
folder
Note: ArduinoJson-v6.2.0-beta.h
are ArduinoJson-v6.2.0-beta.hpp
are almost identical; the difference is that the .hpp
keeps everything in the ArduinoJson
namespace.
Try online
ArduinoJson 6.1.0-beta
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
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.
Try online
ArduinoJson 6.0.1-beta
Special note ⚠️
ArduinoJson 6 requires updating code written for version 5.
Visit arduinojson.org for more information.
Changes since 6.0.0-beta
- Fixed conflicts with
isnan()
andisinf()
macros (issue #752)
How to install
There are several ways to install ArduinoJson, from simpler to more complex:
- Use the Arduino Library Manager
- Download
ArduinoJson-v6.0.1-beta.h
put it in your project folder - Download
ArduinoJson-v6.0.1-beta.zip
and extract it in youlibraries
folder
Note: ArduinoJson-v6.0.1-beta.h
are ArduinoJson-v6.0.1-beta.hpp
are almost identical; the difference is that the .hpp
keeps everything in the ArduinoJson
namespace.
Try online
ArduinoJson 6.0.0-beta
Summary
This release is the first of a new major revision of the library.
It adds new features, like:
- MessagePack serialization and deserialization,
- Error code to tell why deserialization failed,
- Support for non zero terminated input.
Unfortunately, it requires changing the existing programs; please see the "breaking changes" section below.
More information on arduinojson.org
Changes since 5.13.2
- Added
DynamicJsonDocument
andStaticJsonDocument
- Added
deserializeJson()
- Added
serializeJson()
andserializeJsonPretty()
- Added
measureJson()
andmeasureJsonPretty()
- Added
serializeMsgPack()
,deserializeMsgPack()
andmeasureMsgPack()
(issue #358) - Added example
MsgPackParser.ino
(issue #358) - Added support for non zero-terminated strings (issue #704)
- Removed
JsonBuffer::parseArray()
,parseObject()
andparse()
- Removed
JsonBuffer::createArray()
andcreateObject()
- Removed
printTo()
andprettyPrintTo()
- Removed
measureLength()
andmeasurePrettyLength()
- Removed all deprecated features
BREAKING CHANGES ⚠️
Deserialization
Old code:
DynamicJsonBuffer jb; JsonObject& obj = jb.parseObject(json); if (obj.success()) { }
New code:
DynamicJsonDocument doc; DeserializationError error = deserializeJson(doc, json); if (error) { } JsonObject& obj = doc.as<JsonObject>();
Serialization
Old code:
DynamicJsonBuffer jb; JsonObject& obj = jb.createObject(); obj["key"] = "value"; obj.printTo(Serial);
New code:
DynamicJsonDocument obj; JsonObject& obj = doc.to<JsonObject>(); obj["key"] = "value"; serializeJson(doc, Serial);
How to install
There are several ways to install ArduinoJson, from simpler to more complex:
- Use the Arduino Library Manager
- Download
ArduinoJson-v6.0.0-beta.h
put it in your project folder - Download
ArduinoJson-v6.0.0-beta.zip
and extract it in youlibraries
folder
Note: ArduinoJson-v6.0.0-beta.h
are ArduinoJson-v6.0.0-beta.hpp
are almost identical; the difference is that the .hpp
keeps everything in the ArduinoJson
namespace.
Try online
ArduinoJson 5.13.2
Changes since 5.13.1
- Fixed
JsonBuffer::parse()
not respecting nesting limit correctly (issue #693) - Fixed inconsistencies in nesting level counting (PR #695 from Zhenyu Wu)
- Fixed null values that could be pass to
strcmp()
(PR #745 from Mike Karlesky) - Added macros
ARDUINOJSON_VERSION
,ARDUINOJSON_VERSION_MAJOR
...
How to install
There are several ways to install ArduinoJson, from simpler to more complex:
- Use the Arduino Library Manager
- Download
ArduinoJson-v5.13.2.h
put it in your project folder - Download
ArduinoJson-v5.13.2.zip
and extract it in youlibraries
folder
Note: ArduinoJson-v5.13.2.h
are ArduinoJson-v5.13.2.hpp
are almost identical; the difference is that the .hpp
keeps everything in the ArduinoJson
namespace.
ℹ️ The complete documentation is available on arduinojson.org
Try online
ArduinoJson 5.13.1
Changes since 5.13.0
- Fixed
JsonVariant::operator|(int)
that returned the default value if the variant contained a double (issue #675) - Allowed non-quoted key to contain underscores (issue #665)
How to install
There are several ways to install ArduinoJson, from simpler to more complex:
- Use the Arduino Library Manager
- Download
ArduinoJson-v5.13.1.h
put it in your project folder - Download
ArduinoJson-v5.13.1.zip
and extract it in youlibraries
folder
Note: ArduinoJson-v5.13.1.h
are ArduinoJson-v5.13.1.hpp
are almost identical; the difference is that the .hpp
keeps everything in the ArduinoJson
namespace.
ℹ️ The complete documentation is available on arduinojson.org
Try online
ArduinoJson 5.13.0
Changes since 5.12.0
- Changed the rules of string duplication (issue #658)
RawJson()
accepts any kind of string and obeys to the same rules for duplication- Changed the return type of
strdup()
toconst char*
to prevent double duplication - Marked
strdup()
as deprecated
New rules for string duplication
type duplication const char* no char* noyesString yes std::string yes const __FlashStringHelper* yes These new rules make
JsonBuffer::strdup()
useless.
How to install
There are several ways to install ArduinoJson, from simpler to more complex:
- Use the Arduino Library Manager
- Download
ArduinoJson-v5.13.0.h
put it in your project folder - Download
ArduinoJson-v5.13.0.zip
and extract it in youlibraries
folder
Note: ArduinoJson-v5.13.0.h
are ArduinoJson-v5.13.0.hpp
are almost identical; the difference is that the .hpp
keeps everything in the ArduinoJson
namespace.
ℹ️ The complete documentation is available on arduinojson.org
Try online
ArduinoJson 5.12.0
Changes since 5.11.2
- Added
JsonVariant::operator|
to return a default value (see below) - Added a clear error message when compiled as C instead of C++ (issue #629)
- Added detection of MPLAB XC compiler (issue #629)
- Added detection of Keil ARM Compiler (issue #629)
- Added an example that shows how to save and load a configuration file
- Reworked all other examples
How to use the new feature?
If you have a block like this:
const char* ssid = root["ssid"]; if (!ssid) ssid = "default ssid";You can simplify like that:
const char* ssid = root["ssid"] | "default ssid";
How to install
There are several ways to install ArduinoJson, from simpler to more complex:
- Use the Arduino Library Manager
- Download
ArduinoJson-v5.12.0.h
put it in your project folder - Download
ArduinoJson-v5.12.0.zip
and extract it in youlibraries
folder
Note: ArduinoJson-v5.12.0.h
are ArduinoJson-v5.12.0.hpp
are almost identical; the difference is that the .hpp
keeps everything in the ArduinoJson
namespace.
ℹ️ The complete documentation is available on arduinojson.org