Skip to content

Releases: bblanchon/ArduinoJson

ArduinoJson 6.19.0

08 Jan 15:48
Compare
Choose a tag to compare

ℹ️ Read the blog post

Changes

  • Remove ARDUINOJSON_EMBEDDED_MODE and assume we run on an embedded platform.
    Dependent settings (like ARDUINOJSON_DEFAULT_NESTING_LIMIT) must be set individually.
  • Change the default of ARDUINOJSON_USE_DOUBLE to 1
  • Change the default of ARDUINOJSON_USE_LONG_LONG to 1 on 32-bit platforms
  • Add as<JsonString>() and is<JsonString>()
  • Add safe bool idiom in JsonString
  • Add support for NUL in string values (issue #1646)
  • Add support for arbitrary array rank in copyArray()
  • Add support for char[][] in copyArray()
  • Remove DeserializationError == bool and DeserializationError != bool
  • Renamed undocumented function isUndefined() to isUnbound()
  • Fix JsonVariant::memoryUsage() for raw strings
  • Fix call of overloaded 'swap(BasicJsonDocument&, BasicJsonDocument&)' is ambiguous (issue #1678)
  • Fix inconsistent pool capacity between BasicJsonDocument's copy and move constructors
  • Fix inconsistent pool capacity between BasicJsonDocument's copy and move assignments
  • Fix return type of StaticJsonDocument::operator=
  • Avoid pool reallocation in BasicJsonDocument's copy assignment if capacity is the same
  • Avoid including Arduino.h when all its features are disabled (issue #1692, PR #1693 by @paulocsanz)
  • Assume PROGMEM is available as soon as ARDUINO is defined (consequence of #1693)

View version history

Try online

ArduinoJson 6.18.5

28 Sep 15:22
Compare
Choose a tag to compare

Changes

  • Set ARDUINOJSON_EMBEDDED_MODE to 1 on Nios II (issue #1657)

View version history

Try online

ArduinoJson 6.18.4

06 Sep 07:16
Compare
Choose a tag to compare

Changes

  • Fixed error 'dummy' may be used uninitialized on GCC 11
  • Fixed error expected unqualified-id before 'const' on GCC 11 (issue #1622)
  • Filter: exact match takes precedence over wildcard (issue #1628)
  • Fixed deserialization of \u0000 (issue #1646)

Try online

View version history

ArduinoJson 6.18.3

27 Jul 13:48
Compare
Choose a tag to compare

Changes

  • Changed return type of convertToJson() and Converter<T>::toJson() to void
  • Added as<std::string_view>() and is<std::string_view>()

Try online

View version history

ArduinoJson 6.18.2

19 Jul 08:15
Compare
Choose a tag to compare

Changes

  • Removed a symlink because the Arduino Library Specification forbids it

View version history

Try online

ArduinoJson 6.18.1

03 Jul 14:17
Compare
Choose a tag to compare

Changes

  • Fixed support for volatile float and volatile 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)

View version history

Try online

ArduinoJson 6.18.0

05 May 18:51
Compare
Choose a tag to compare

📰 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 returning NotSupported
  • deserializeMsgPack() inserts null instead of returning NotSupported
  • Removed DeserializationError::NotSupported
  • Added JsonVariant::is<JsonArrayConst/JsonObjectConst>() (issue #1412)
  • Added JsonVariant::is<JsonVariant/JsonVariantConst>() (issue #1412)
  • Changed JsonVariantConst::is<JsonArray/JsonObject>() to return false (issue #1412)
  • Simplified JsonVariant::as<T>() to always return T (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 to false (PR #1550 by @askreet)

BREAKING CHANGES

Support for char removed

We cannot cast a JsonVariant to a char 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"];  // OK

Similarly, 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;  // OK

A deprecation warning with the message "Support for char is deprecated, use int8_t or uint8_t instead" was added to allow a smooth transition.

as<T>() always returns T

Previously, JsonVariant::as<T>() could return a type different from T.
The most common example is as<char*>() that returned a const 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 return T,
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*>());  // OK

A deprecation warning with the message "Replace as<char*>() with as<const char*>()" was added to allow a smooth transition.

DeserializationError::NotSupported removed

On a different topic, DeserializationError::NotSupported has been removed.
Instead of returning this error:

  • deserializeJson() leaves \uXXXX unchanged (only when ARDUINOJSON_DECODE_UNICODE is 0)
  • deserializeMsgPack() replaces unsupported values with nulls

Const-aware is<T>()

Lastly, a very minor change concerns JsonVariantConst::is<T>().
It used to return true for JsonArray and JsonOject, but now it returns false.
Instead, you must use JsonArrayConst and JsonObjectConst.

View version history

How to install

There are several ways to install ArduinoJson, from simpler to more complex:

  1. Use the Arduino Library Manager or equivalent
  2. Download ArduinoJson-v6.18.0.h put it in your project folder
  3. Download ArduinoJson-v6.18.0.zip and extract it into your libraries 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

15 Feb 09:01
Compare
Choose a tag to compare

Changes since 6.17.2

  • Made JsonDocument's destructor protected (issue #1480)
  • Added missing calls to client.stop() in JsonHttpClient.ino (issue #1485)
  • Fixed error expected ')' before 'char' when isdigit() 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)

View version history

How to install

There are several ways to install ArduinoJson, from simpler to more complex:

  1. Use the Arduino Library Manager or equivalent
  2. Download ArduinoJson-v6.17.3.h put it in your project folder
  3. Download ArduinoJson-v6.17.3.zip and extract it into your libraries 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

14 Nov 09:44
Compare
Choose a tag to compare

📰 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 the pgm_read_XXX macros are defined before enabling PROGMEM.

View version history

How to install

There are several ways to install ArduinoJson, from simpler to more complex:

  1. Use the Arduino Library Manager or equivalent
  2. Download ArduinoJson-v6.17.2.h put it in your project folder
  3. Download ArduinoJson-v6.17.2.zip and extract it into you libraries 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

07 Nov 09:19
Compare
Choose a tag to compare

📰 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)

View version history

How to install

There are several ways to install ArduinoJson, from simpler to more complex:

  1. Use the Arduino Library Manager or equivalent
  2. Download ArduinoJson-v6.17.1.h put it in your project folder
  3. Download ArduinoJson-v6.17.1.zip and extract it into you libraries 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