Description

JsonObjectConst is a read-only version of JsonObject. It’s also twice smaller because it doesn’t contain a pointer to the memory pool.

Example

// allocate the memory for the document
const size_t CAPACITY = JSON_OBJECT_SIZE(1);
StaticJsonDocument<CAPACITY> doc;

// deserialize the object
char json[] = "{\"hello\":\"world\"}";
deserializeJson(doc, json);

// extract the data
JsonObjectConst object = doc.as<JsonObject>();
const char* world = object["hello"];

Member functions

See also