code: def _place_secondary_files(inp_tool, inp_binding=None):
      
      def _is_file(val):
          return (val == "File" or (isinstance(val, (list, tuple)) and
                                    ("File" in val or any(isinstance(x, dict) and _is_file(val)) for x in val)))
      secondary_files = inp_tool.pop("secondaryFiles", None)
      if secondary_files:
          key = []
          while (not _is_file(tz.get_in(key + ["type"], inp_tool))
                 and not _is_file(tz.get_in(key + ["items"], inp_tool))
                 and not _is_file(tz.get_in(key + ["items", "items"], inp_tool))):
              key.append("type")
          if tz.get_in(key, inp_tool):
              inp_tool["secondaryFiles"] = secondary_files
          elif inp_binding:
              nested_inp_binding = copy.deepcopy(inp_binding)
              nested_inp_binding["prefix"] = "ignore="
              nested_inp_binding["secondaryFiles"] = secondary_files
              inp_tool = tz.update_in(inp_tool, key, lambda x: nested_inp_binding)
      return inp_tool
docs: Put secondaryFiles at the level of the File item to ensure indexes get passed.