Skip to content

ArduinoJson 5.8.0

Compare
Choose a tag to compare
@bblanchon bblanchon released this 03 Jan 21:49

Changes since 5.7.3

  • Added operator == to compare JsonVariant and strings (issue #402)
  • Added support for Stream (issue #300)
  • Reduced memory consumption by not duplicating spaces and comments

View version history

Breaking changes

JsonBuffer::parseObject() and JsonBuffer::parseArray() have been pulled down to the derived classes DynamicJsonBuffer and StaticJsonBufferBase.

This means that if you have code like:

void myFunction(JsonBuffer& jsonBuffer);

you need to replace it by one of the following:

void myFunction(DynamicJsonBuffer& jsonBuffer);
void myFunction(StaticJsonBufferBase& jsonBuffer);
template<typename TJsonBuffer> void myFunction(TJsonBuffer& jsonBuffer);

How to use the new Stream feature?

If you have something like:

char json[256];
size_t n= stream.readBytes(json, sizeof(json));     
json[n] = 0;

JsonObject& root = jsonBuffer.parseObject(json);

then you can replace by:

JsonObject& root = jsonBuffer.parseObject(stream);

but don't forget to increase the size of the JsonBuffer because it now has to hold a copy of the input.