forked from bblanchon/ArduinoJson
Serialize inner objects
This commit is contained in:
@ -22,6 +22,9 @@ size_t JsonNodeSerializer::serialize(const JsonNode* node)
|
|||||||
|
|
||||||
case JSON_BOOLEAN:
|
case JSON_BOOLEAN:
|
||||||
return _sink.print(node->content.asBoolean ? "true" : "false");
|
return _sink.print(node->content.asBoolean ? "true" : "false");
|
||||||
|
|
||||||
|
case JSON_PROXY:
|
||||||
|
return serialize(node->content.asProxy.target);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node->type >= JSON_DOUBLE_0_DECIMALS)
|
if (node->type >= JSON_DOUBLE_0_DECIMALS)
|
||||||
|
@ -21,8 +21,6 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
JsonObject object;
|
JsonObject object;
|
||||||
|
|
||||||
private:
|
|
||||||
StaticJsonBuffer<5> json;
|
StaticJsonBuffer<5> json;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -134,12 +132,12 @@ TEST_F(JsonObjectSerializationTests, OneEmptyNestedArray)
|
|||||||
|
|
||||||
outputMustBe("{\"key\":[]}");
|
outputMustBe("{\"key\":[]}");
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
TEST_F(JsonObjectSerializationTests, OneEmptyNestedObject)
|
TEST_F(JsonObjectSerializationTests, OneEmptyNestedObject)
|
||||||
{
|
{
|
||||||
auto nestedObject = JsonObject<1>();
|
auto nestedObject = json.createObject();
|
||||||
|
|
||||||
object["key"] = nestedObject;
|
object["key"] = nestedObject;
|
||||||
|
|
||||||
outputMustBe("{\"key\":{}}");
|
outputMustBe("{\"key\":{}}");
|
||||||
}*/
|
}
|
Reference in New Issue
Block a user