Fix to_json.

GitOrigin-RevId: a6ddd1fe716720bad5efe877ac2534889fbb3f9d
This commit is contained in:
levlam 2019-12-24 16:22:10 +03:00
parent eec3a5205c
commit ab4ee8031a

View File

@ -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<Object> &value);\n";
sb << "\nStatus from_json(tl_object_ptr<Function> &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<Object> &value) {
td::to_json(jv, std::move(value));
}
Status from_json(tl_object_ptr<Function> &to, td::JsonValue from) {
return td::from_json(to, std::move(from));
}