anchor.diff:  
   
   %% @private
  +-spec validate_listed_files(
  +    ListedChildren :: term(),
  +    Format :: gs | rest | deprecated_rest,
  +    ShareId :: undefined | od_share:id(),
  +    Params :: map(),
  +    AllFiles :: [{file_id:file_guid(), Name :: binary(), Path :: binary()}]
  +) ->
  +    ok | no_return().
  +validate_listed_files(ListedChildren, Format, ShareId, Params, AllFiles) ->
  +    Limit = maps:get(<<"limit">>, Params, 1000),
  +    Offset = maps:get(<<"offset">>, Params, 0),
  +
  +    ExpFiles1 = case Offset >= length(AllFiles) of
  +        true ->
  +            [];
  +        false ->
  +            lists:sublist(AllFiles, Offset+1, Limit)
  +    end,
  +
  +    ExpFiles2 = lists:map(fun({Guid, Name, Path}) ->
  +        {file_id:guid_to_share_guid(Guid, ShareId), Name, Path}
  +    end, ExpFiles1),
  +
  +    ExpFiles3 = case Format of
  +        gs ->
  +            #{<<"children">> => lists:map(fun({Guid, _Name, _Path}) ->
  +                Guid
  +            end, ExpFiles2)};
  +        rest ->
  +            #{<<"children">> => lists:map(fun({Guid, Name, _Path}) ->
  +                {ok, ObjectId} = file_id:guid_to_objectid(Guid),
  +                #{
  +                    <<"id">> => ObjectId,
  +                    <<"name">> => Name
  +                }
  +            end, ExpFiles2)};
  +        deprecated_rest ->
  +            lists:map(fun({Guid, _Name, Path}) ->
  +                {ok, ObjectId} = file_id:guid_to_objectid(Guid),
  +                #{
  +                    <<"id">> => ObjectId,
  +                    <<"path">> => Path
  +                }
  +            end, ExpFiles2)
  +    end,
  +
  +    ?assertEqual(ExpFiles3, ListedChildren).
  +
  +
  +%% @private
   get_children_data_spec() ->
       #data_spec{
           optional = [<<"limit">>, <<"offset">>],
  
positive.code:             {<<"attribute">>, 10, {gs, ?ERROR_BAD_VALUE_BINARY(<<"attribute">>)}},
              {<<"attribute">>, <<"NaN">>, ?ERROR_BAD_VALUE_NOT_ALLOWED(<<"attribute">>, ?PRIVATE_BASIC_ATTRIBUTES)}
          ]
      },
      PublicDataSpec = #data_spec{
          optional = [<<"attribute">>],
          correct_values = #{<<"attribute">> => ?PUBLIC_BASIC_ATTRIBUTES},
          bad_values = [
  
negative.code:         get_user_root_dir_children_test,
          get_dir_children_on_provider_not_supporting_space_test,
  
          get_file_attrs_test,
          get_shared_file_attrs_test,
          get_attrs_on_provider_not_supporting_space_test,
  
          set_mode_test
      ]).
  
  