Releases: bblanchon/ArduinoJson
ArduinoJson 6.18.1
Changes
- Fixed support for
volatile float
andvolatile double
(issue #1557) - Fixed error
[Pe070]: incomplete type is not allowed
on IAR (issue #1560) - Fixed
serializeJson(doc, String)
when allocation fails (issue #1572) - Fixed clang-tidy warnings (issue #1574, PR #1577 by @armandas)
- Added fake class
InvalidConversion<T1,T2>
to easily identify invalid conversions (issue #1585) - Added support for
std::string_view
(issue #1578, PR #1554 by @0xFEEDC0DE64) - Fixed warning
definition of implicit copy constructor for 'MsgPackDeserializer' is deprecated because it has a user-declared copy assignment operator
- Added
JsonArray::clear()
(issue #1597) - Fixed
JsonVariant::as<unsigned>()
(issue #1601) - Added support for ESP-IDF component build (PR #1562 by @qt1, PR #1599 by @andreaskuster)
Try online
ArduinoJson 6.18.0
📰 Read the complete article on arduinojson.org
Changes since 6.17.3
- Added support for custom converters (issue #687)
- Added support for
Printable
(issue #1444) - Removed support for
char
values, see below (issue #1498) deserializeJson()
leaves\uXXXX
unchanged instead of returningNotSupported
deserializeMsgPack()
insertsnull
instead of returningNotSupported
- Removed
DeserializationError::NotSupported
- Added
JsonVariant::is<JsonArrayConst/JsonObjectConst>()
(issue #1412) - Added
JsonVariant::is<JsonVariant/JsonVariantConst>()
(issue #1412) - Changed
JsonVariantConst::is<JsonArray/JsonObject>()
to returnfalse
(issue #1412) - Simplified
JsonVariant::as<T>()
to always returnT
(see below) - Updated folders list in
.mbedignore
(PR #1515 by @AGlass0fMilk) - Fixed member-call-on-null-pointer in
getMember()
when array is empty serializeMsgPack(doc, buffer, size)
doesn't add null-terminator anymore (issue #1545)serializeJson(doc, buffer, size)
adds null-terminator only if there is enough room- PlatformIO: set
build.libArchive
tofalse
(PR #1550 by @askreet)
BREAKING CHANGES
Support for
char
removedWe cannot cast a
JsonVariant
to achar
anymore, so the following will break:char age = doc["age"]; // error: no matching function for call to 'variantAs(VariantData*&)'Instead, you must use another integral type, such as
int8_t
:int8_t age = doc["age"]; // OKSimilarly, we cannot assign from a
char
anymore, so the following will break:char age; doc["age"] = age; // error: no matching function for call to 'VariantRef::set(const char&)'Instead, you must use another integral type, such as
int8_t
:int8_t age; doc["age"] = age; // OKA deprecation warning with the message "Support for
char
is deprecated, useint8_t
oruint8_t
instead" was added to allow a smooth transition.
as<T>()
always returnsT
Previously,
JsonVariant::as<T>()
could return a type different fromT
.
The most common example isas<char*>()
that returned aconst char*
.
While this feature simplified a few use cases, it was confusing and complicated the
implementation of custom converters.Starting from this version,
as<T>
doesn't try to auto-correct the return type and always returnT
,
which means that you cannot write this anymore:Serial.println(doc["sensor"].as<char*>()); // error: invalid conversion from 'const char*' to 'char*' [-fpermissive]Instead, you must write:
Serial.println(doc["sensor"].as<const char*>()); // OKA deprecation warning with the message "Replace
as<char*>()
withas<const char*>()
" was added to allow a smooth transition.
DeserializationError::NotSupported
removedOn a different topic,
DeserializationError::NotSupported
has been removed.
Instead of returning this error:
deserializeJson()
leaves\uXXXX
unchanged (only whenARDUINOJSON_DECODE_UNICODE
is0
)deserializeMsgPack()
replaces unsupported values withnull
sConst-aware
is<T>()
Lastly, a very minor change concerns
JsonVariantConst::is<T>()
.
It used to returntrue
forJsonArray
andJsonOject
, but now it returnsfalse
.
Instead, you must useJsonArrayConst
andJsonObjectConst
.
How to install
There are several ways to install ArduinoJson, from simpler to more complex:
- Use the Arduino Library Manager or equivalent
- Download
ArduinoJson-v6.18.0.h
put it in your project folder - Download
ArduinoJson-v6.18.0.zip
and extract it into yourlibraries
folder
Note: ArduinoJson-v6.18.0.h
and ArduinoJson-v6.18.0.hpp
are almost identical; the difference is that the .hpp
keeps everything in the ArduinoJson
namespace.
Try online
ArduinoJson 6.17.3
Changes since 6.17.2
- Made
JsonDocument
's destructor protected (issue #1480) - Added missing calls to
client.stop()
inJsonHttpClient.ino
(issue #1485) - Fixed error
expected ')' before 'char'
whenisdigit()
is a macro (issue #1487) - Fixed error
definition of implicit copy constructor is deprecated
on Clang 10 - PlatformIO: set framework compatibility to
*
(PR #1490 by @maxgerhardt)
How to install
There are several ways to install ArduinoJson, from simpler to more complex:
- Use the Arduino Library Manager or equivalent
- Download
ArduinoJson-v6.17.3.h
put it in your project folder - Download
ArduinoJson-v6.17.3.zip
and extract it into yourlibraries
folder
Note: ArduinoJson-v6.17.3.h
and ArduinoJson-v6.17.3.hpp
are almost identical; the difference is that the .hpp
keeps everything in the ArduinoJson
namespace.
Try online
ArduinoJson 6.17.2
📰 Read the complete article on arduinojson.org
Changes since 6.17.1
- Fixed invalid conversion error in
operator|(JsonVariant, char*)
(issue #1432) - Changed the default value of
ARDUINOJSON_ENABLE_PROGMEM
(issue #1433).
It now checks that thepgm_read_XXX
macros are defined before enablingPROGMEM
.
How to install
There are several ways to install ArduinoJson, from simpler to more complex:
- Use the Arduino Library Manager or equivalent
- Download
ArduinoJson-v6.17.2.h
put it in your project folder - Download
ArduinoJson-v6.17.2.zip
and extract it into youlibraries
folder
Note: ArduinoJson-v6.17.2.h
and ArduinoJson-v6.17.2.hpp
are almost identical; the difference is that the .hpp
keeps everything in the ArduinoJson
namespace.
Try online
ArduinoJson 6.17.1
📰 Read the complete article on arduinojson.org
Changes since 6.17.0
- Fixed error
ambiguous overload for 'operator|'
(issue #1411) - Fixed
operator|(MemberProxy, JsonObject)
(issue #1415) - Allowed more than 32767 values in non-embedded mode (issue #1414)
How to install
There are several ways to install ArduinoJson, from simpler to more complex:
- Use the Arduino Library Manager or equivalent
- Download
ArduinoJson-v6.17.1.h
put it in your project folder - Download
ArduinoJson-v6.17.1.zip
and extract it into youlibraries
folder
Note: ArduinoJson-v6.17.1.h
and ArduinoJson-v6.17.1.hpp
are almost identical; the difference is that the .hpp
keeps everything in the ArduinoJson
namespace.
Try online
ArduinoJson 6.17.0
📰 Read the complete article on arduinojson.org
Changes since 6.16.1
- Added a build failure when nullptr is defined as a macro (issue #1355)
- Added
JsonDocument::overflowed()
which tells if the memory pool was too small (issue #1358) - Added
DeserializationError::EmptyInput
which tells if the input was empty - Added
DeserializationError::f_str()
which returns aconst __FlashStringHelper*
(issue #846) - Added
operator|(JsonVariantConst, JsonVariantConst)
- Added filtering for MessagePack (issue #1298, PR #1394 by Luca Passarella)
- Moved float convertion tables to PROGMEM
- Fixed
JsonVariant::set((char*)0)
which returned false instead of true (issue #1368) - Fixed error
No such file or directory #include <WString.h>
(issue #1381)
How to install
There are several ways to install ArduinoJson, from simpler to more complex:
- Use the Arduino Library Manager or equivalent
- Download
ArduinoJson-v6.17.0.h
put it in your project folder - Download
ArduinoJson-v6.17.0.zip
and extract it in youlibraries
folder
Note: ArduinoJson-v6.17.0.h
and ArduinoJson-v6.17.0.hpp
are almost identical; the difference is that the .hpp
keeps everything in the ArduinoJson
namespace.
Try online
ArduinoJson 6.16.1
📰 Read the complete article on arduinojson.org
Changes since 6.16.0
- Fixed
deserializeJson()
that stopped reading after{}
(issue #1335)
How to install
There are several ways to install ArduinoJson, from simpler to more complex:
- Use the Arduino Library Manager or equivalent
- Download
ArduinoJson-v6.16.1.h
put it in your project folder - Download
ArduinoJson-v6.16.1.zip
and extract it in youlibraries
folder
Note: ArduinoJson-v6.16.1.h
and ArduinoJson-v6.16.1.hpp
are almost identical; the difference is that the .hpp
keeps everything in the ArduinoJson
namespace.
Try online
ArduinoJson 6.16.0
📰 Read the complete article on arduinojson.org
Changes since 6.15.2
- Added comparisons (
>
,>=
,==
,!=
,<
, and<=
) betweenJsonVariant
s - Added string deduplication (issue #1303)
- Added
JsonString::operator!=
- Set
ARDUINOJSON_DECODE_UNICODE
to1
by default - Fixed
copyArray()
not working withString
,ElementProxy
, andMemberProxy
- Fixed error
getOrAddElement is not a member of ElementProxy
(issue #1311) - Fixed excessive stack usage when compiled with
-Og
(issues #1210 and #1314) - Fixed
Warning[Pa093]: implicit conversion from floating point to integer
on IAR compiler (PR #1328 by @stawiski)
How to install
There are several ways to install ArduinoJson, from simpler to more complex:
- Use the Arduino Library Manager or equivalent
- Download
ArduinoJson-v6.16.0.h
put it in your project folder - Download
ArduinoJson-v6.16.0.zip
and extract it in youlibraries
folder
Note: ArduinoJson-v6.16.0.h
and ArduinoJson-v6.16.0.hpp
are almost identical; the difference is that the .hpp
keeps everything in the ArduinoJson
namespace.
Try online
ArduinoJson 6.15.2
Changes since 6.15.1
- CMake: don't build tests when imported in another project
- CMake: made project arch-independent
- Visual Studio: fixed error C2766 with flag
/Zc:__cplusplus
(issue #1250) - Added support for
JsonDocument
tocopyArray()
(issue #1255) - Added support for
enum
s inas<T>()
andis<T>()
(issue #1256) - Added
JsonVariant
as an input type fordeserializeXxx()
For example, you can do:deserializeJson(doc2, doc1["payload"])
- Break the build if using 64-bit integers with ARDUINOJSON_USE_LONG_LONG==0
How to install
There are several ways to install ArduinoJson, from simpler to more complex:
- Use the Arduino Library Manager or equivalent
- Download
ArduinoJson-v6.15.2.h
put it in your project folder - Download
ArduinoJson-v6.15.2.zip
and extract it in youlibraries
folder
Note: ArduinoJson-v6.15.2.h
and ArduinoJson-v6.15.2.hpp
are almost identical; the difference is that the .hpp
keeps everything in the ArduinoJson
namespace.
Try online
ArduinoJson 6.15.1
Changes since 6.15.0
- Fixed "maybe-uninitialized" warning (issue #1217)
- Fixed "statement is unreachable" warning on IAR (issue #1233)
- Fixed "pointless integer comparison" warning on IAR (issue #1233)
- Added CMake "install" target (issue #1209)
- Disabled alignment on AVR (issue #1231)
How to install
There are several ways to install ArduinoJson, from simpler to more complex:
- Use the Arduino Library Manager
- Download
ArduinoJson-v6.15.1.h
put it in your project folder - Download
ArduinoJson-v6.15.1.zip
and extract it in youlibraries
folder
Note: ArduinoJson-v6.15.1.h
and ArduinoJson-v6.15.1.hpp
are almost identical; the difference is that the .hpp
keeps everything in the ArduinoJson
namespace.