DynamicJsonBuffer constructor to set initial size (issue #152)JsonObjectSuscript::set(value, decimals) (issue #143)float instead of double to reduce the size of JsonVariant (issue #134)JsonArraySubscript and JsonObjectSubscript (issue #122)printTo(String) which wrote numbers instead of strings (issue #120)JsonArray::is<T>() and some others (issue #121)parseObject(String) and parseArray(String), when the
StaticJsonBuffer is too small to hold a copy of the stringString class (issues #55, #56, #70, #77)JsonBuffer::strdup() to make a copy of a string (issues #10, #57)strdup() for String but not for char* (issues #84, #87)JsonVariant to leverage converting constructors instead of assignment operators (issue #66)BREAKING CHANGES:
JsonObject::add() was renamed to set()JsonArray::at() and JsonObject::at() were renamed to get()double_with_n_digits()Personal note about the String class:
Support of the String class has been added to the library because many people use it in their programs.
However, you should not see this as an invitation to use the String class.
The String class is bad because it uses dynamic memory allocation.
Compared to static allocation, it compiles to a bigger, slower program, and is less predictable.
You certainly don't want that in an embedded environment!
DynamicJsonBuffer when memory allocation fails (issue #92)Upgrading is recommended since previous versions contain a potential security risk.
Special thanks to Giancarlo Canales Barreto for finding this nasty bug.
JsonArray::measureLength() and JsonObject::measureLength() (issue #75)JsonArray::removeAt() to remove an element of an array (issue #58)DynamicJsonBuffer when parsing huge JSON files (issue #65)parseArray() and parseObject() when allocation fails (issue #68)BREAKING CHANGE: API changed significantly, see Migrating code to the new API.
IndentedPrint, a decorator for Print to allow indented outputExample:
JsonOject<2> json;
json["key"] = "value";
json.prettyPrintTo(Serial);
JsonArray (bug introduced in v3.1).Generator::JsonObject::add() twice with the same key now replaces the valueGenerator::JsonObject::operator[], see bellow the new APIGenerator::JsonObject::remove() (issue #9)Old generator API:
JsonObject<3> root;
root.add("sensor", "gps");
root.add("time", 1351824120);
root.add("data", array);
New generator API:
JsonObject<3> root;
root["sensor"] = "gps";
root["time"] = 1351824120;
root["data"] = array;
JsonHashTable into JsonObjectJsonArray and JsonObject (issue #4)Old parser API:
JsonHashTable root = parser.parseHashTable(json);
char* sensor = root.getString("sensor");
long time = root.getLong("time");
double latitude = root.getArray("data").getDouble(0);
double longitude = root.getArray("data").getDouble(1);
New parser API:
JsonObject root = parser.parse(json);
char* sensor = root["sensor"];
long time = root["time"];
double latitude = root["data"][0];
double longitude = root["data"][1];
#include "jsmn.cpp" which caused an error in Linux (issue #6)ArduinoJsonParser becomes ArduinoJsonBreaking change: you need to add the following line at the top of your program.
using namespace ArduinoJson::Parser;
char* json into char[] json so that the bytes are not write protectedInitial release