ArduinoJson 5.12.0
* Added `JsonVariant::operator|` to return a default value
* 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

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