From ab4ee8031a155e60ae76e5aa9549b8db872c6da4 Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 24 Dec 2019 16:22:10 +0300 Subject: [PATCH] Fix to_json. GitOrigin-RevId: a6ddd1fe716720bad5efe877ac2534889fbb3f9d --- td/generate/tl_json_converter.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/td/generate/tl_json_converter.cpp b/td/generate/tl_json_converter.cpp index f88fff3f4..4ee27697b 100644 --- a/td/generate/tl_json_converter.cpp +++ b/td/generate/tl_json_converter.cpp @@ -224,11 +224,16 @@ void gen_json_converter_file(const tl::simple::Schema &schema, const std::string sb << "namespace td {\n"; sb << "namespace td_api {\n"; if (is_header) { + sb << "\nvoid to_json(JsonValueScope &jv, const tl_object_ptr &value);\n"; sb << "\nStatus from_json(tl_object_ptr &to, td::JsonValue from);\n"; sb << "\nvoid to_json(JsonValueScope &jv, const Object &object);\n"; sb << "\nvoid to_json(JsonValueScope &jv, const Function &object);\n\n"; } else { sb << R"ABCD( +void to_json(JsonValueScope &jv, const tl_object_ptr &value) { + td::to_json(jv, std::move(value)); +} + Status from_json(tl_object_ptr &to, td::JsonValue from) { return td::from_json(to, std::move(from)); }