Skip to content

Releases: bblanchon/ArduinoJson

ArduinoJson 6.0.0-beta

07 Jun 09:20
Compare
Choose a tag to compare
Pre-release

Summary

This release is the first of a new major revision of the library.
It adds new features, like:

  1. MessagePack serialization and deserialization,
  2. Error code to tell why deserialization failed,
  3. 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 and StaticJsonDocument
  • Added deserializeJson()
  • Added serializeJson() and serializeJsonPretty()
  • Added measureJson() and measureJsonPretty()
  • Added serializeMsgPack(), deserializeMsgPack() and measureMsgPack() (issue #358)
  • Added example MsgPackParser.ino (issue #358)
  • Added support for non zero-terminated strings (issue #704)
  • Removed JsonBuffer::parseArray(), parseObject() and parse()
  • Removed JsonBuffer::createArray() and createObject()
  • Removed printTo() and prettyPrintTo()
  • Removed measureLength() and measurePrettyLength()
  • 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);

View version history

How to install

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

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

01 Jun 07:43
Compare
Choose a tag to compare

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...

View version history

How to install

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

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

19 Feb 08:03
Compare
Choose a tag to compare

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)

View version history

How to install

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

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

19 Jan 14:43
Compare
Choose a tag to compare

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() to const char* to prevent double duplication
  • Marked strdup() as deprecated

New rules for string duplication

type duplication
const char* no
char* no yes
String yes
std::string yes
const __FlashStringHelper* yes

These new rules make JsonBuffer::strdup() useless.

View version history

How to install

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

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

11 Dec 17:04
Compare
Choose a tag to compare

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";

View version history

How to install

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

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

Try online

ArduinoJson 5.11.2

17 Oct 08:42
Compare
Choose a tag to compare

Changes since 5.11.1

  • Fixed DynamicJsonBuffer::clear() not resetting allocation size (issue #561)
  • Fixed incorrect rounding for float values (issue #588)

View version history

How to install

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

  1. Use the Arduino Library Manager
  2. Download ArduinoJson-v5.11.2.h below and put it in your project folder
  3. Download ArduinoJson-v5.11.2.zip and extract it in you libraries folder

Note: ArduinoJson-v5.11.2.h are ArduinoJson-v5.11.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.11.1

14 Jul 09:22
Compare
Choose a tag to compare

Changes since 5.11.0

  • Removed dependency on PGM_P as Particle 0.6.2 doesn't define it (issue #546)
  • Fixed warning "dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]"
  • Fixed warning "floating constant exceeds range of 'float' [-Woverflow]" (issue #544)
  • Fixed warning "this statement may fall through" [-Wimplicit-fallthrough=] (issue #539)
  • Removed ARDUINOJSON_DOUBLE_IS_64BITS as it became useless.
  • Fixed too many decimals places in float serialization (issue #543)

View version history

How to install

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

  1. Use the Arduino Library Manager
  2. Download ArduinoJson-v5.11.1.h below and put it in your project folder
  3. Download ArduinoJson-v5.11.1.zip and extract it in you libraries folder

Note: ArduinoJson-v5.11.1.h are ArduinoJson-v5.11.1.hpp are almost identical; the difference is that the .hpp keeps everything in the ArduinoJson namespace.

Try online

ArduinoJson 5.11.0

25 Jun 13:21
Compare
Choose a tag to compare

Changes since 5.10.1

  • Made JsonBuffer non-copyable (PR #524 by @luisrayas3)
  • Added StaticJsonBuffer::clear()
  • Added DynamicJsonBuffer::clear()

View version history

How to install

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

  1. Use the Arduino Library Manager
  2. Download ArduinoJson-v5.11.0.h below and put it in your project folder
  3. Download ArduinoJson-v5.11.0.zip and extract it in you libraries folder

Note: ArduinoJson-v5.11.0.h are ArduinoJson-v5.11.0.hpp are almost identical; the difference is that the .hpp keeps everything in the ArduinoJson namespace.

Try online

ArduinoJson 5.10.1

12 Jun 19:14
Compare
Choose a tag to compare

Changes since 5.10.0

  • Fixed IntelliSense errors in Visual Micro (issue #483)
  • Fixed compilation in IAR Embedded Workbench (issue #515)
  • Fixed reading "true" as a float (issue #516)
  • Added ARDUINOJSON_DOUBLE_IS_64BITS
  • Added ARDUINOJSON_EMBEDDED_MODE

View version history

How to install

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

  1. Use the Arduino Library Manager
  2. Download ArduinoJson-v5.10.1.h below and put it in your project folder
  3. Download ArduinoJson-v5.10.1.zip and extract it in you libraries folder

Note: ArduinoJson-v5.10.1.h are ArduinoJson-v5.10.1.hpp are almost identical; the difference is that the .hpp keeps everything in the ArduinoJson namespace.

Try online

v5.10.0: ArduinoJson 5.10.0

20 May 07:29
Compare
Choose a tag to compare

Changes since 5.9.0

  • Removed configurable number of decimal places (issues #288, #427 and #506)
  • Changed exponentation thresholds to 1e7 and 1e-5 (issues #288, #427 and #506)
  • JsonVariant::is<double>() now returns true for integers
  • Fixed error IsBaseOf is not a member of ArduinoJson::TypeTraits (issue #495)
  • Fixed error forming reference to reference (issue #495)

BREAKING CHANGES ⚠️

Old syntax New syntax
double_with_n_digits(3.14, 2) 3.14
float_with_n_digits(3.14, 2) 3.14f
obj.set("key", 3.14, 2) obj["key"] = 3.14
arr.add(3.14, 2) arr.add(3.14)
Input Old output New output
3.14159 3.14 3.14159
42.0 42.00 42
0.0 0.00 0
Expression Old result New result
JsonVariant(42).is<int>() true true
JsonVariant(42).is<float>() false true
JsonVariant(42).is<double>() false true

View version history

How to install

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

  1. Use the Arduino Library Manager
  2. Download ArduinoJson-v5.10.0.h below and put it in your project folder
  3. Download ArduinoJson-v5.10.0.zip and extract it in you libraries folder

Note: ArduinoJson-v5.10.0.h are ArduinoJson-v5.10.0.hpp are almost identical; the difference is that the .hpp keeps everything in the ArduinoJson namespace.