feat(emqx_dashboard): include edition and version in swagger.json info
This commit is contained in:
parent
353cc065db
commit
22b25fbbb3
|
@ -2,7 +2,7 @@
|
||||||
{application, emqx_dashboard, [
|
{application, emqx_dashboard, [
|
||||||
{description, "EMQX Web Dashboard"},
|
{description, "EMQX Web Dashboard"},
|
||||||
% strict semver, bump manually!
|
% strict semver, bump manually!
|
||||||
{vsn, "5.0.24"},
|
{vsn, "5.0.25"},
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{registered, [emqx_dashboard_sup]},
|
{registered, [emqx_dashboard_sup]},
|
||||||
{applications, [kernel, stdlib, mnesia, minirest, emqx, emqx_ctl]},
|
{applications, [kernel, stdlib, mnesia, minirest, emqx, emqx_ctl]},
|
||||||
|
|
|
@ -49,7 +49,7 @@ start_listeners(Listeners) ->
|
||||||
Authorization = {?MODULE, authorize},
|
Authorization = {?MODULE, authorize},
|
||||||
GlobalSpec = #{
|
GlobalSpec = #{
|
||||||
openapi => "3.0.0",
|
openapi => "3.0.0",
|
||||||
info => #{title => "EMQX API", version => ?EMQX_API_VERSION},
|
info => #{title => emqx_api_name(), version => emqx_release_version()},
|
||||||
servers => [#{url => emqx_dashboard_swagger:base_path()}],
|
servers => [#{url => emqx_dashboard_swagger:base_path()}],
|
||||||
components => #{
|
components => #{
|
||||||
schemas => #{},
|
schemas => #{},
|
||||||
|
@ -271,3 +271,9 @@ dynamic_dispatch() ->
|
||||||
{emqx_mgmt_api_status:path(), emqx_mgmt_api_status, []},
|
{emqx_mgmt_api_status:path(), emqx_mgmt_api_status, []},
|
||||||
{'_', emqx_dashboard_not_found, []}
|
{'_', emqx_dashboard_not_found, []}
|
||||||
].
|
].
|
||||||
|
|
||||||
|
emqx_api_name() ->
|
||||||
|
emqx_release:description() ++ " API".
|
||||||
|
|
||||||
|
emqx_release_version() ->
|
||||||
|
emqx_release:version().
|
||||||
|
|
|
@ -149,6 +149,15 @@ t_swagger_json(_Config) ->
|
||||||
{ok, {{"HTTP/1.1", 200, "OK"}, _Headers, Body2}} =
|
{ok, {{"HTTP/1.1", 200, "OK"}, _Headers, Body2}} =
|
||||||
httpc:request(get, {Url, []}, [], [{body_format, binary}]),
|
httpc:request(get, {Url, []}, [], [{body_format, binary}]),
|
||||||
?assertEqual(Body1, Body2),
|
?assertEqual(Body1, Body2),
|
||||||
|
?assertMatch(
|
||||||
|
#{
|
||||||
|
<<"info">> := #{
|
||||||
|
<<"title">> := _,
|
||||||
|
<<"version">> := _
|
||||||
|
}
|
||||||
|
},
|
||||||
|
emqx_utils_json:decode(Body1)
|
||||||
|
),
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
t_cli(_Config) ->
|
t_cli(_Config) ->
|
||||||
|
|
Loading…
Reference in New Issue