Validator extensions, zomp vsn 0.2.0 #5

Merged
uwiger merged 2 commits from uw-validator-extensions into master 2026-05-14 17:00:04 +09:00
Showing only changes of commit e53c3ff6bb - Show all commits
+15 -2
View File
@@ -101,7 +101,7 @@ mock_config() ->
mock_config(Cfg) ->
ensure_schema_loaded(),
store(Cfg, Mode = silent).
store(Cfg, _Mode = silent).
unmock_config() ->
gmconfig_schema_utils:clear(),
@@ -445,7 +445,20 @@ just_schema_keys(_) ->
schema_default(Path) when is_list(Path) ->
schema_default(Path, schema()).
schema_default(Path, Schema) ->
schema_default(Path0, Schema) ->
%% There is a way to navigate through an array of objects
%% essentially locating the desired object in the array, and then
%% continuing into one of its properties. This is specified in
%% a path exression as `{PropName, Value, ThenProp}`.
%% If the query expects us to fall back to the schema default, then
%% we must adapt the path accordingly.
%%
%% find_config([<<"system">>, <<"plugins">>,
%% {<<"name">>, PluginName, <<"config">>} | Key],
%% [user_config, schema_default]);
Path = lists:flatmap(fun({_, _,P}) -> [<<"items">>, P];
(P) -> [P]
end, Path0),
case schema(Path, Schema) of
undefined -> undefined;
{ok, Tree} ->