- Fixed
deserializeJson()
that stopped reading after{}
(issue #1335)
- 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)
- 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
- 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)
- Added
DeserializationOption::Filter
(issue #959) - Added example
JsonFilterExample.ino
- Changed the array subscript operator to automatically add missing elements
- Fixed "deprecated-copy" warning on GCC 9 (fixes #1184)
- Fixed
MemberProxy::set(char[])
not duplicating the string (issue #1191) - Fixed enums serialized as booleans (issue #1197)
- Fixed incorrect string comparison on some platforms (issue #1198)
- Added move-constructor and move-assignment to
BasicJsonDocument
- Added
BasicJsonDocument::garbageCollect()
(issue #1195) - Added
StaticJsonDocument::garbageCollect()
- Changed copy-constructor of
BasicJsonDocument
to preserve the capacity of the source. - Removed copy-constructor of
JsonDocument
(issue #1189)
In previous versions, the copy constructor of
BasicJsonDocument
looked at the source'smemoryUsage()
to choose its capacity. Now, the copy constructor ofBasicJsonDocument
uses the same capacity as the source.Example:
DynamicJsonDocument doc1(64); doc1.set(String("example")); DynamicJsonDocument doc2 = doc1; Serial.print(doc2.capacity()); // 8 with ArduinoJson 6.14 // 64 with ArduinoJson 6.15I made this change to get consistent results between copy-constructor and move-constructor, and whether RVO applies or not.
If you use the copy-constructor to optimize your documents, you can use
garbageCollect()
orshrinkToFit()
instead.In previous versions, it was possible to create a function that take a
JsonDocument
by value.void myFunction(JsonDocument doc) {}This function gives the wrong clues because it doesn't receive a copy of the
JsonDocument
, only a sliced version. It worked because the copy constructor copied the internal pointers, but it was an accident.From now, if you need to pass a
JsonDocument
to a function, you must use a reference:void myFunction(JsonDocument& doc) {}
- Fixed regression in UTF16 decoding (issue #1173)
- Fixed
containsKey()
onJsonVariantConst
- Added
getElement()
andgetMember()
toJsonVariantConst
- Added
BasicJsonDocument::shrinkToFit()
- Added support of
uint8_t
forserializeJson()
,serializeJsonPretty()
, andserializeMsgPack()
(issue #1142) - Added
ARDUINOJSON_ENABLE_COMMENTS
to enable support for comments (defaults to 0) - Auto enable support for
std::string
andstd::stream
on modern compilers (issue #1156) (No need to defineARDUINOJSON_ENABLE_STD_STRING
andARDUINOJSON_ENABLE_STD_STREAM
anymore) - Improved decoding of UTF-16 surrogate pairs (PR #1157 by @kaysievers) (ArduinoJson now produces standard UTF-8 instead of CESU-8)
- Added
measureJson
,measureJsonPretty
, andmeasureMsgPack
tokeywords.txt
(This file is used for syntax highlighting in the Arduino IDE) - Fixed
variant.is<nullptr_t>()
- Fixed value returned by
serializeJson()
,serializeJsonPretty()
, andserializeMsgPack()
when writing to aString
- Improved speed of
serializeJson()
,serializeJsonPretty()
, andserializeMsgPack()
when writing to aString
Support for comments in input is now optional and disabled by default.
If you need support for comments, you must defined
ARDUINOJSON_ENABLE_COMMENTS
to1
; otherwise, you'll receiveInvalidInput
errors.#define ARDUINOJSON_ENABLE_COMMENTS 1 #include <ArduinoJson.h>
- Added support for custom writer/reader classes (issue #1088)
- Added conversion from
JsonArray
andJsonObject
tobool
, to be consistent withJsonVariant
- Fixed
deserializeJson()
when input contains duplicate keys (issue #1095) - Improved
deserializeMsgPack()
speed by reading several bytes at once - Added detection of Atmel AVR8/GNU C Compiler (issue #1112)
- Fixed deserializer that stopped reading at the first
0xFF
(PR #1118 by @mikee47) - Fixed dangling reference in copies of
MemberProxy
andElementProxy
(issue #1120)
- Use absolute instead of relative includes (issue #1072)
- Changed
JsonVariant::as<bool>()
to returntrue
for any non-null value (issue #1005) - Moved ancillary files to
extras/
(issue #1011)
- Added fallback implementations of
strlen_P()
,strncmp_P()
,strcmp_P()
, andmemcpy_P()
(issue #1073)
- Added
measureJson()
to theArduinoJson
namespace (PR #1069 by @nomis) - Added support for
basic_string<char, traits, allocator>
(issue #1045) - Fixed example
JsonConfigFile.ino
for ESP8266 - Include
Arduino.h
ifARDUINO
is defined (PR #1071 by @nomis)
- Added operators
==
and!=
forJsonDocument
,ElementProxy
, andMemberProxy
- Fixed comparison of
JsonVariant
when one contains a linked string and the other contains an owned string (issue #1051)
- Fixed assignment of
JsonDocument
toJsonVariant
(issue #1023) - Fix invalid conversion error on Particle Argon (issue #1035)
- Fixed
serialized()
not working with Flash strings (issue #1030)
- Fixed
deserializeJson()
silently accepting aStream*
(issue #978) - Fixed invalid result from
operator|
(issue #981) - Made
deserializeJson()
more picky about trailing characters (issue #980) - Added
ARDUINOJSON_ENABLE_NAN
(default=0) to enable NaN in JSON (issue #973) - Added
ARDUINOJSON_ENABLE_INFINITY
(default=0) to enable Infinity in JSON - Removed implicit conversion in comparison operators (issue #998)
- Added lexicographical comparison for
JsonVariant
- Added support for
nullptr
(issue #998)
The JSON specification allows neither NaN not Infinity, but previous versions of ArduinoJson supported it. Now, ArduinoJson behaves like most other libraries: a NaN or and Infinity in the
JsonDocument
, becomes anull
in the output JSON. Also,deserializeJson()
returnsInvalidInput
if the JSON document contains NaN or Infinity.This version still supports NaN and Infinity in JSON documents, but it's disabled by default to be compatible with other JSON parsers. If you need the old behavior back, define
ARDUINOJSON_ENABLE_NAN
andARDUINOJSON_ENABLE_INFINITY
to1
;:#define ARDUINOJSON_ENABLE_NAN 1 #define ARDUINOJSON_ENABLE_INFINITY 1 #include <ArduinoJson.h>This version slightly changes the behavior of the | operator when the variant contains a float and the user requests an integer.
Older versions returned the floating point value truncated. Now, it returns the default value.
// suppose variant contains 1.2 int value = variant | 3; // old behavior: value == 1 // new behavior value == 3If you need the old behavior, you must add
if (variant.is<float>())
.
- Fixed error "attributes are not allowed on a function-definition"
- Fixed
deserializeJson()
not being picky enough (issue #969) - Fixed error "no matching function for call to write(uint8_t)" (issue #972)
- Fixed an integer overflow in the JSON deserializer
- Added overflow handling in
JsonVariant::as<T>()
andJsonVariant::is<T>()
.as<T>()
returns0
if the integerT
overflowsis<T>()
returnsfalse
if the integerT
overflows
- Added
BasicJsonDocument
to support custom allocator (issue #876) - Added
JsonDocument::containsKey()
(issue #938) - Added
JsonVariant::containsKey()
- Fixed warning "unused variable" with GCC 4.4 (issue #912)
- Fixed warning "cast increases required alignment" (issue #914)
- Fixed warning "conversion may alter value" (issue #914)
- Fixed naming conflict with "CAPACITY" (issue #839)
- Muted warning "will change in GCC 7.1" (issue #914)
- Added a clear error message for
StaticJsonBuffer
andDynamicJsonBuffer
- Marked ArduinoJson.h as a "system header"
- Decode escaped Unicode characters like \u00DE (issue #304, PR #791) Many thanks to Daniel Schulte (aka @trilader) who implemented this feature.
- Added option ARDUINOJSON_DECODE_UNICODE to enable it
- Converted
JsonArray::copyFrom()/copyTo()
to free functionscopyArray()
- Renamed
JsonArray::copyFrom()
andJsonObject::copyFrom()
toset()
- Renamed
JsonArray::get()
togetElement()
- Renamed
JsonArray::add()
(without arg) toaddElement()
- Renamed
JsonObject::get()
togetMember()
- Renamed
JsonObject::getOrCreate()
togetOrAddMember()
- Fixed
JsonVariant::isNull()
not returningtrue
afterset((char*)0)
- Fixed segfault after
variant.set(serialized((char*)0))
- Detect
IncompleteInput
infalse
,true
, andnull
- Added
JsonDocument::size()
- Added
JsonDocument::remove()
- Added
JsonVariant::clear()
- Added
JsonVariant::remove()
- Import functions in the ArduinoJson namespace to get clearer errors
- Improved syntax highlighting in Arduino IDE
- Removed default capacity of
DynamicJsonDocument
JsonArray::copyFrom()
acceptsJsonArrayConst
JsonVariant::set()
acceptsJsonArrayConst
andJsonObjectConst
JsonDocument
was missing in the ArduinoJson namespace- Added
memoryUsage()
toJsonArray
,JsonObject
, andJsonVariant
- Added
nesting()
toJsonArray
,JsonDocument
,JsonObject
, andJsonVariant
- Replaced
JsonDocument::nestingLimit
with an additional parameter todeserializeJson()
anddeserializeMsgPack()
- Fixed uninitialized variant in
JsonDocument
- Fixed
StaticJsonDocument
copy constructor and copy assignment - The copy constructor of
DynamicJsonDocument
chooses the capacity according to the memory usage of the source, not from the capacity of the source. - Added the ability to create/assign a
StaticJsonDocument
/DynamicJsonDocument
from aJsonArray
/JsonObject
/JsonVariant
- Added
JsonDocument::isNull()
- Added
JsonDocument::operator[]
- Added
ARDUINOJSON_TAB
to configure the indentation character - Reduced the size of the pretty JSON serializer
- Added
add()
,createNestedArray()
andcreateNestedObject()
toJsonVariant
JsonVariant
automatically promotes toJsonObject
orJsonArray
on write. CallingJsonVariant::to<T>()
is not required anymore.JsonDocument
now support the same operations asJsonVariant
. CallingJsonDocument::as<T>()
is not required anymore.- Fixed example
JsonHttpClient.ino
- User can now use a
JsonString
as a key or a value
The parameter to the constructor of
DynamicJsonDocument
is now mandatoryOld code:
DynamicJsonDocument doc;New code:
DynamicJsonDocument doc(1024);
JsonDocument::nestingLimit
was replaced with a new parameter todeserializeJson()
anddeserializeMsgPack()
.Old code:
doc.nestingLimit = 15; deserializeJson(doc, input);New code:
deserializeJson(doc, input, DeserializationOption::NestingLimit(15));
- Removed the automatic expansion of
DynamicJsonDocument
, it now has a fixed capacity. - Restored the monotonic allocator because the code was getting too big
- Reduced the memory usage
- Reduced the code size
- Renamed
JsonKey
toJsonString
- Removed spurious files in the Particle library
- Removed
JsonArray::is<T>(i)
andJsonArray::set(i,v)
- Removed
JsonObject::is<T>(k)
andJsonObject::set(k,v)
- Replaced
T JsonArray::get<T>(i)
withJsonVariant JsonArray::get(i)
- Replaced
T JsonObject::get<T>(k)
withJsonVariant JsonObject::get(k)
- Added
JSON_STRING_SIZE()
Replacing or removing a value now releases the memory- Added
DeserializationError::code()
to be used in switch statements (issue #846)
- Added implicit conversion from
JsonArray
andJsonObject
toJsonVariant
- Allow mixed configuration in compilation units (issue #809)
- Fixed object keys not being duplicated
JsonPair::key()
now returns aJsonKey
- Increased the default capacity of
DynamicJsonDocument
- Fixed
JsonVariant::is<String>()
(closes #763) - Added
JsonArrayConst
,JsonObjectConst
, andJsonVariantConst
- Added copy-constructor and copy-assignment-operator for
JsonDocument
(issue #827)
- Copy
JsonArray
andJsonObject
, instead of storing pointers (issue #780) - Added
JsonVariant::to<JsonArray>()
andJsonVariant::to<JsonObject>()
- Implemented reference semantics for
JsonVariant
- Replaced
JsonPair
'skey
andvalue
withkey()
andvalue()
- Fixed
serializeJson(obj[key], dst)
(issue #794)
JsonVariant
now has a semantic similar toJsonObject
andJsonArray
. It's a reference to a value stored in theJsonDocument
. As a consequence, aJsonVariant
cannot be used as a standalone variable anymore.Old code:
JsonVariant myValue = 42;
New code:
DynamicJsonDocument doc; JsonVariant myValue = doc.to<JsonVariant>(); myValue.set(42);
Old code:
for(JsonPair p : myObject) { Serial.println(p.key); Serial.println(p.value.as<int>()); }New code:
for(JsonPair p : myObject) { Serial.println(p.key()); Serial.println(p.value().as<int>()); }CAUTION: the key is now read only!
- Fixed exception when using Flash strings as object keys (issue #784)
- Fixed
invalid application of 'sizeof' to incomplete type '__FlashStringHelper'
(issue #783) - Fixed
char[]
not duplicated when passed toJsonVariant::operator[]
- Fixed
JsonObject
not inserting keys of typeString
(issue #782)
- Disabled lazy number deserialization (issue #772)
- Fixed
JsonVariant::is<int>()
that returned true for empty strings - Improved float serialization when
-fsingle-precision-constant
is used - Renamed function
RawJson()
toserialized()
serializeMsgPack()
now supports values marked withserialized()
Non quoted strings are now forbidden in values, but they are still allowed in keys. For example,
{key:"value"}
is accepted, but{key:value}
is not.Old code:
object["values"] = RawJson("[1,2,3,4]");New code:
object["values"] = serialized("[1,2,3,4]");
- Return
JsonArray
andJsonObject
by value instead of reference (issue #309) - Replaced
success()
withisNull()
Old code:
JsonObject& obj = doc.to<JsonObject>(); JsonArray& arr = obj.createNestedArray("key"); if (!arr.success()) { Serial.println("Not enough memory"); return; }New code:
JsonObject obj = doc.to<JsonObject>(); JsonArray arr = obj.createNestedArray("key"); if (arr.isNull()) { Serial.println("Not enough memory"); return; }
- Fixed conflicts with
isnan()
andisinf()
macros (issue #752)
- Added
DynamicJsonDocument
andStaticJsonDocument
- Added
deserializeJson()
- Added
serializeJson()
andserializeJsonPretty()
- Added
measureJson()
andmeasureJsonPretty()
- Added
serializeMsgPack()
,deserializeMsgPack()
andmeasureMsgPack()
(issue #358) - Added example
MsgPackParser.ino
(issue #358) - Added support for non zero-terminated strings (issue #704)
- Removed
JsonBuffer::parseArray()
,parseObject()
andparse()
- Removed
JsonBuffer::createArray()
andcreateObject()
- Removed
printTo()
andprettyPrintTo()
- Removed
measureLength()
andmeasurePrettyLength()
- Removed all deprecated features
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>();
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);
- 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
...
- 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)
- 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()
toconst char*
to prevent double duplication - Marked
strdup()
as deprecated
type duplication const char* no char* noyesString yes std::string yes const __FlashStringHelper* yes These new rules make
JsonBuffer::strdup()
useless.
- 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
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";
- Fixed
DynamicJsonBuffer::clear()
not resetting allocation size (issue #561) - Fixed incorrect rounding for float values (issue #588)
- 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)
- Made
JsonBuffer
non-copyable (PR #524 by @luisrayas3) - Added
StaticJsonBuffer::clear()
- Added
DynamicJsonBuffer::clear()
- 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
- Removed configurable number of decimal places (issues #288, #427 and #506)
- Changed exponentiation thresholds to
1e7
and1e-5
(issues #288, #427 and #506) JsonVariant::is<double>()
now returnstrue
for integers- Fixed error
IsBaseOf is not a member of ArduinoJson::TypeTraits
(issue #495) - Fixed error
forming reference to reference
(issue #495)
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
- Added
JsonArray::remove(iterator)
(issue #479) - Added
JsonObject::remove(iterator)
- Renamed
JsonArray::removeAt(size_t)
intoremove(size_t)
- Renamed folder
include/
tosrc/
- Fixed warnings
floating constant exceeds range of float
andfloating constant truncated to zero
(issue #483) - Removed
Print
class and convertedprintTo()
to a template method (issue #276) - Removed example
IndentedPrintExample.ino
- Now compatible with Particle 0.6.1, thanks to Jacob Nite (issue #294 and PR #461 by @foodbag)
- Added custom implementation of
strtod()
(issue #453) - Added custom implementation of
strtol()
(issue #465) char
is now treated as an integral type (issue #337, #370)
- Fixed an access violation in
DynamicJsonBuffer
when memory allocation fails (issue #433) - Added operators
==
and!=
for twoJsonVariant
s (issue #436) - Fixed
JsonVariant::operator[const FlashStringHelper*]
(issue #441)
- Fixed parsing of comments (issue #421)
- Fixed ignored
Stream
timeout (issue #422) - Made sure we don't read more that necessary (issue #422)
- Fixed error when the key of a
JsonObject
is achar[]
(issue #423) - Reduced code size when using
const
references - Fixed error with string of type
unsigned char*
(issue #428) - Added
deprecated
attribute onasArray()
,asObject()
andasString()
(issue #420)
- Fixed error when assigning a
volatile int
to aJsonVariant
(issue #415) - Fixed errors with Variable Length Arrays (issue #416)
- Fixed error when both
ARDUINOJSON_ENABLE_STD_STREAM
andARDUINOJSON_ENABLE_ARDUINO_STREAM
are set to1
- Fixed error "Stream does not name a type" (issue #412)
- Added operator
==
to compareJsonVariant
and strings (issue #402) - Added support for
Stream
(issue #300) - Reduced memory consumption by not duplicating spaces and comments
JsonBuffer::parseObject()
andJsonBuffer::parseArray()
have been pulled down to the derived classesDynamicJsonBuffer
andStaticJsonBufferBase
.This means that if you have code like:
void myFunction(JsonBuffer& jsonBuffer);you need to replace it with one of the following:
void myFunction(DynamicJsonBuffer& jsonBuffer); void myFunction(StaticJsonBufferBase& jsonBuffer); template<typename TJsonBuffer> void myFunction(TJsonBuffer& jsonBuffer);
- Added an
printTo(char[N])
andprettyPrintTo(char[N])
(issue #292) - Added ability to set a nested value like this:
root["A"]["B"] = "C"
(issue #352) - Renamed
*.ipp
to*Impl.hpp
because they were ignored by Arduino IDE (issue #396)
- Made PROGMEM available on more platforms (issue #381)
- Fixed PROGMEM causing an exception on ESP8266 (issue #383)
- Added support for PROGMEM (issue #76)
- Fixed compilation error when index is not an
int
(issue #381)
- Templatized all functions using
String
orstd::string
- Removed
ArduinoJson::String
- Removed
JsonVariant::defaultValue<T>()
- Removed non-template
JsonObject::get()
andJsonArray.get()
- Fixed support for
StringSumHelper
(issue #184) - Replaced
ARDUINOJSON_USE_ARDUINO_STRING
byARDUINOJSON_ENABLE_STD_STRING
andARDUINOJSON_ENABLE_ARDUINO_STRING
(issue #378) - Added example
StringExample.ino
to show whereString
can be used - Increased default nesting limit to 50 when compiled for a computer (issue #349)
The non-template functions
JsonObject::get()
andJsonArray.get()
have been removed. This means that you need to explicitely tell the type you expect in return.Old code:
#define ARDUINOJSON_USE_ARDUINO_STRING 0 JsonVariant value1 = myObject.get("myKey"); JsonVariant value2 = myArray.get(0);New code:
#define ARDUINOJSON_ENABLE_ARDUINO_STRING 0 #define ARDUINOJSON_ENABLE_STD_STRING 1 JsonVariant value1 = myObject.get<JsonVariant>("myKey"); JsonVariant value2 = myArray.get<JsonVariant>(0);
- Fixed
array[idx].as<JsonVariant>()
andobject[key].as<JsonVariant>()
- Fixed return value of
JsonObject::set()
(issue #350) - Fixed undefined behavior in
Prettyfier
andPrint
(issue #354) - Fixed parser that incorrectly rejected floats containing a
+
(issue #349)
- Fixed
-Wparentheses
warning introduced in v5.6.5 (PR #335 by @nuket) - Added
.mbedignore
for ARM mbdeb (PR #334 by @nuket) - Fixed
JsonVariant::success()
which didn't propagateJsonArray::success()
norJsonObject::success()
(issue #342).
as<char*>()
now returnstrue
when input isnull
(issue #330)
- Fixed error in float serialization (issue #324)
- Improved speed of float serialization (about twice faster)
- Added
as<JsonArray>()
as a synonym foras<JsonArray&>()
... (issue #291) - Fixed
call of overloaded isinf(double&) is ambiguous
(issue #284)
- Fixed build when another lib does
#undef isnan
(issue #284)
- Added missing
#pragma once
(issue #310)
- ArduinoJson is now a header-only library (issue #199)
- Fixed compilation error with Intel Galileo (issue #299)
- Added
JsonVariant::success()
(issue #279) - Renamed
JsonVariant::invalid<T>()
toJsonVariant::defaultValue<T>()
- Changed
::String
toArduinoJson::String
(issue #275) - Changed
::Print
toArduinoJson::Print
too
- Added custom implementation of
ftoa
(issues #266, #267, #269 and #270) - Added
JsonVariant JsonBuffer::parse()
(issue #265) - Fixed
unsigned long
printed assigned long
(issue #170)
- Added
JsonVariant::as<char*>()
as a synonym forJsonVariant::as<const char*>()
(issue #257) - Added example
JsonHttpClient
(issue #256) - Added
JsonArray::copyTo()
andJsonArray::copyFrom()
(issue #254) - Added
RawJson()
to insert pregenerated JSON portions (issue #259)
- Removed
String
duplication when one replaces a value in aJsonObject
(PR #232 by @ulion)
- Added support of
long long
(issue #171) - Moved all build settings to
ArduinoJson/Configuration.hpp
If you defined
ARDUINOJSON_ENABLE_STD_STREAM
, you now need to define it to1
.
- Made the library compatible with PlatformIO (issue #181)
- Fixed
JsonVariant::is<bool>()
that was incorrectly returning false (issue #214)
- Made library easier to use from a CMake project: simply
add_subdirectory(ArduinoJson/src)
- Changed
String
to be atypedef
ofstd::string
(issues #142 and #161)
JsonVariant(true).as<String>()
now returns"true"
instead of"1"
JsonVariant(false).as<String>()
now returns"false"
instead of"0"
- Added parameter to
DynamicJsonBuffer
constructor to set initial size (issue #152) - Fixed warning about library category in Arduino 1.6.6 (issue #147)
- Examples: Added a loop to wait for serial port to be ready (issue #156)
- Added overload
JsonObjectSuscript::set(value, decimals)
(issue #143) - Use
float
instead ofdouble
to reduce the size ofJsonVariant
(issue #134)
- Fixed ambiguous overload with
JsonArraySubscript
andJsonObjectSubscript
(issue #122)
- Fixed
printTo(String)
which wrote numbers instead of strings (issue #120) - Fixed return type of
JsonArray::is<T>()
and some others (issue #121)
- Fixed segmentation fault in
parseObject(String)
andparseArray(String)
, when theStaticJsonBuffer
is too small to hold a copy of the string - Fixed Clang warning "register specifier is deprecated" (issue #102)
- Fixed GCC warning "declaration shadows a member" (issue #103)
- Fixed memory alignment, which made ESP8266 crash (issue #104)
- Fixed compilation on Visual Studio 2010 and 2012 (issue #107)
- Fixed compilation with Arduino 1.0.6 (issue #99)
- Added support of
String
class (issues #55, #56, #70, #77) - Added
JsonBuffer::strdup()
to make a copy of a string (issues #10, #57) - Implicitly call
strdup()
forString
but not forchar*
(issues #84, #87) - Added support of non standard JSON input (issue #44)
- Added support of comments in JSON input (issue #88)
- Added implicit cast between numerical types (issues #64, #69, #93)
- Added ability to read number values as string (issue #90)
- Redesigned
JsonVariant
to leverage converting constructors instead of assignment operators (issue #66) - Switched to new the library layout (requires Arduino 1.0.6 or above)
JsonObject::add()
was renamed toset()
JsonArray::at()
andJsonObject::at()
were renamed toget()
- Number of digits of floating point value are now set with
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!