|
@@ -45,8 +45,6 @@
|
|
|
is_running/2,
|
|
is_running/2,
|
|
|
global_chain/1,
|
|
global_chain/1,
|
|
|
listener_chain/3,
|
|
listener_chain/3,
|
|
|
- make_deprecated_paths/1,
|
|
|
|
|
- make_compatible_schema/2,
|
|
|
|
|
find_gateway_definitions/0
|
|
find_gateway_definitions/0
|
|
|
]).
|
|
]).
|
|
|
|
|
|
|
@@ -531,39 +529,6 @@ default_subopts() ->
|
|
|
is_new => true
|
|
is_new => true
|
|
|
}.
|
|
}.
|
|
|
|
|
|
|
|
-%% Since 5.0.8, the API path of the gateway has been changed from "gateway" to "gateways"
|
|
|
|
|
-%% and we need to be compatible with the old path
|
|
|
|
|
-get_compatible_path("/gateway") ->
|
|
|
|
|
- "/gateways";
|
|
|
|
|
-get_compatible_path("/gateway/" ++ Rest) ->
|
|
|
|
|
- "/gateways/" ++ Rest.
|
|
|
|
|
-
|
|
|
|
|
-get_deprecated_path("/gateways") ->
|
|
|
|
|
- "/gateway";
|
|
|
|
|
-get_deprecated_path("/gateways/" ++ Rest) ->
|
|
|
|
|
- "/gateway/" ++ Rest.
|
|
|
|
|
-
|
|
|
|
|
-make_deprecated_paths(Paths) ->
|
|
|
|
|
- Paths ++ [get_deprecated_path(Path) || Path <- Paths].
|
|
|
|
|
-
|
|
|
|
|
-make_compatible_schema(Path, SchemaFun) ->
|
|
|
|
|
- OldPath = get_compatible_path(Path),
|
|
|
|
|
- make_compatible_schema2(OldPath, SchemaFun).
|
|
|
|
|
-
|
|
|
|
|
-make_compatible_schema2(Path, SchemaFun) ->
|
|
|
|
|
- Schema = SchemaFun(Path),
|
|
|
|
|
- maps:map(
|
|
|
|
|
- fun(Key, Value) ->
|
|
|
|
|
- case lists:member(Key, [get, delete, put, post]) of
|
|
|
|
|
- true ->
|
|
|
|
|
- Value#{deprecated => true};
|
|
|
|
|
- _ ->
|
|
|
|
|
- Value
|
|
|
|
|
- end
|
|
|
|
|
- end,
|
|
|
|
|
- Schema
|
|
|
|
|
- ).
|
|
|
|
|
-
|
|
|
|
|
-spec find_gateway_definitions() -> list(gateway_def()).
|
|
-spec find_gateway_definitions() -> list(gateway_def()).
|
|
|
find_gateway_definitions() ->
|
|
find_gateway_definitions() ->
|
|
|
lists:flatten(
|
|
lists:flatten(
|