Serialize inner objects

This commit is contained in:
Benoit Blanchon committed 2014-10-01 15:47:32 +02:00
1 parent 57400cee14
commit 1a98fd5dfc
2 files changed
+6 -5

No files matched your search

+3
View File
@@ -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)
+3 -5
View File
@@ -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\":{}}");
}*/ }