docs: private DocumentPath getDocumentPath(List<PathSegment> params) {
      if (params.isEmpty()) {
        return DocumentPath.ROOT;
      } else {
        return DocumentPath.from(params.stream().map(PathSegment::getPath).collect(Collectors.toList()));
      }
    }