ArduinoJson 6.11.0 * Fixed `deserializeJson()` silently accepting a `Stream*` (issue #978) * Fixed invalid result from `operator|` (issue #981) * Made `deserializeJson()` more picky about trailing characters (issue #980) * Added `ARDUINOJSON_ENABLE_NAN` (default=0) to enable NaN in JSON (issue #973) * Added `ARDUINOJSON_ENABLE_INFINITY` (default=0) to enable Infinity in JSON * Removed implicit conversion in comparison operators (issue #998) * Added lexicographical comparison for `JsonVariant` * Added support for `nullptr` (issue #998)
Looking for a human-readable version?
📰 Read the article on arduinojson.org
6.10.1
Changes since- Fixed
deserializeJson()
silently accepting aStream*
(issue #978) - Fixed invalid result from
operator|
(issue #981) - Made
deserializeJson()
more picky about trailing characters (issue #980) - Added
ARDUINOJSON_ENABLE_NAN
(default=0) to enable NaN in JSON (issue #973) - Added
ARDUINOJSON_ENABLE_INFINITY
(default=0) to enable Infinity in JSON - Removed implicit conversion in comparison operators (issue #998)
- Added lexicographical comparison for
JsonVariant
- Added support for
nullptr
(issue #998)
BREAKING CHANGES
NaN and Infinity
The JSON specification allows neither NaN not Infinity, but previous versions of ArduinoJson supported it. Now, ArduinoJson behaves like most other libraries: a NaN or and Infinity in the
JsonDocument
, becomes anull
in the output JSON. Also,deserializeJson()
returnsInvalidInput
if the JSON document contains NaN or Infinity.This version still supports NaN and Infinity in JSON documents, but it's disabled by default to be compatible with other JSON parsers. If you need the old behavior back, define
ARDUINOJSON_ENABLE_NAN
andARDUINOJSON_ENABLE_INFINITY
to1
:#define ARDUINOJSON_ENABLE_NAN 1 #define ARDUINOJSON_ENABLE_INFINITY 1 #include <ArduinoJson.h>
The "or" operator
This version slightly changes the behavior of the | operator when the variant contains a float and the user requests an integer.
Older versions returned the floating point value truncated. Now, it returns the default value.
// suppose variant contains 1.2 int value = variant | 3; // old behavior: value == 1 // new behavior value == 3
If you need the old behavior, you must add
if (variant.is<float>())
.
How to install
There are several ways to install ArduinoJson, from simpler to more complex:
- Use the Arduino Library Manager
- Download
ArduinoJson-v6.11.0.h
put it in your project folder - Download
ArduinoJson-v6.11.0.zip
and extract it in youlibraries
folder
Note: ArduinoJson-v6.11.0.h
and ArduinoJson-v6.11.0.hpp
are almost identical; the difference is that the .hpp
keeps everything in the ArduinoJson
namespace.