anchor.diff:  -spec new_helper(name(), args(), user_ctx(), Insecure :: boolean(),
       storage_path_type()) -> {ok, helpers:helper()}.
   new_helper(HelperName, Args, AdminCtx, Insecure, StoragePathType) ->
  -    {Required, _} = expected_helper_args(HelperName),
  -    ok = check_args(Required, Args),
  +    Fields = expected_helper_args(HelperName),
  +    ok = validate_fields(Fields, Args, false),
       ok = validate_user_ctx(HelperName, AdminCtx),
       {ok, #helper{
           name = HelperName,
  
positive.code: %%--------------------------------------------------------------------
  -spec filter_user_ctx(name(), #{binary() => term()}) -> #{binary() => term()}.
  filter_user_ctx(HelperName, Params) ->
      Required = expected_user_ctx_params(HelperName, Params),
      Optional = optional_user_ctx_params(HelperName, Params),
      maps:with(Required ++ Optional, Params).
  
  
  %%--------------------------------------------------------------------
  
negative.code: %% have valid type.
  %% @end
  %%--------------------------------------------------------------------
  -spec validate_fields([field() | optional_field()], Params :: map(),
      AllowIntegers :: boolean()) ->
      ok | {error, Reason :: term()}.
  validate_fields([], Params, _) when Params == #{} ->
      ok;
  validate_fields([], Params, _) ->
      {error, {invalid_additional_fields, Params}};
  validate_fields([Field | Fields], Params, AllowIntegers) ->
      case validate_field(Field, Params, AllowIntegers) of
          {ok, ParamsRemainder} ->
              validate_fields(Fields, ParamsRemainder, AllowIntegers);
          Error ->
              Error
      end.
  
  
  %% @private
  -spec validate_field(Key, Params, AllowIntegers :: boolean()) ->
      {ok, ParamsRemainder :: user_ctx() | group_ctx()} |
      {error, Reason :: term()} when
      Key :: field() | optional_field(),
      Params :: #{binary() := term()}.
  validate_field({optional, Field}, Params, AllowIntegers) ->
      case validate_field(Field, Params, AllowIntegers) of
          {error, {missing_field, _}} -> {ok, Params};
          Result -> Result
      end;
  
  validate_field(Field, Params, AllowIntegers) ->
      case Params of
          #{Field := <<"null">>} ->
              {error, {invalid_field_value, Field, <<"null">>}};
          #{Field := Value} when
              is_binary(Value);
              is_integer(Value) andalso AllowIntegers ->
              {ok, maps:remove(Field, Params)};
          #{Field := Value} ->
              {error, {invalid_field_value, Field, Value}};
          #{} ->
              {error, {missing_field, Field}}
      end.
  
  
  %%--------------------------------------------------------------------
  %% @private
  %% @doc
  %% Invokes Fun for each key-value pair in the map.
  %% The Fun must return a map, all of which are merged to create the result.
  %% @end
  %%--------------------------------------------------------------------
  -spec map_flatmap(Fun, #{K1 => V1}) -> #{K2 => V2} when
      Fun :: fun((K1, V1) -> #{K2 => V2}).
  map_flatmap(Fun, Map) ->
      maps:fold(fun(K, V, Acc) ->
          maps:merge(Acc, Fun(K, V))
      end, #{}, Map).
  
  