Skip to content

Commit

Permalink
Don't name integer and string results in API examples (#4198)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
badlop committed Apr 12, 2024
1 parent b6a0c7e commit ed6762b
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/ejabberd_commands_doc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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">>;
Expand Down

0 comments on commit ed6762b

Please sign in to comment.