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.
This commit is contained in:
Badlop 2024-04-12 11:31:55 +02:00
parent b6a0c7e57f
commit ed6762b8ee
1 changed files with 2 additions and 7 deletions

View File

@ -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">>;