From ed6762b8ee6467e5cb1eaba81ca4ad0a91485fd5 Mon Sep 17 00:00:00 2001 From: Badlop Date: Fri, 12 Apr 2024 11:31:55 +0200 Subject: [PATCH] Don't name integer and string results in API examples (#4198) Since ejabberd 24.02, mod_http_api does not name any results, previously integer and strings were named, but other results were not. And ejabberdctl obviously does not name results either. Only ejabberd_xmlrpc does. Consequently, the documentation should not name results in the examples. --- src/ejabberd_commands_doc.erl | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/ejabberd_commands_doc.erl b/src/ejabberd_commands_doc.erl index 7d59bcc78..646eafe90 100644 --- a/src/ejabberd_commands_doc.erl +++ b/src/ejabberd_commands_doc.erl @@ -247,13 +247,8 @@ json_call(Name, ArgsDesc, Values, ResultDesc, Result, HTMLOutput) -> {200, [?STR(Text1)]}; {{_, restuple}, {_, Text2}} -> {500, [?STR(Text2)]}; - {{_, {list, _}}, _} -> - {200, json_gen(ResultDesc, Result, Indent, HTMLOutput)}; - {{_, {tuple, _}}, _} -> - {200, json_gen(ResultDesc, Result, Indent, HTMLOutput)}; - {{Name0, _}, _} -> - {200, [Indent, ?OP_L("{"), ?STR_A(Name0), ?OP_L(": "), - json_gen(ResultDesc, Result, Indent, HTMLOutput), ?OP_L("}")]} + {{_, _}, _} -> + {200, json_gen(ResultDesc, Result, Indent, HTMLOutput)} end, CodeStr = case Code of 200 -> <<" 200 OK">>;