Pagination using limit and offset query parameters
还没有人认领这个 Issue。
评估
调研方向
首先跟踪 issue 中所示的现有 limit_with {:param, "limit"} 入口点和 read(:list_companies) action。检查查询参数如何变成资源参数或过滤器,然后确定应如何表示 offset/skip;完成的标准是 API 无需当前的过滤器变通方案即可获取后续页面。
由索引模型根据 Issue 内容生成。
描述
I have an API that achieves pagination using query parameters in the URL. The maximum items returned is 50 so an offset/skip is needed to retrieve the full dataset
Is this possible using the library as-is? I have hacked it for now by adding a "skip" parameter to the resource that gets passed as a filter
read(:list_companies) do
argument :skip, :integer do
allow_nil? true
default 0
end
filter expr(skip == ^arg(:skip))
end
The limit is working nicely as-is:
limit_with {:param, "limit"}
- 主要语言
- Elixir
- 星标
- 28
- 派生
- 13
- 平均合并
- 8 小时 1 分钟
- 30 天内合并 PR
- 2
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ash-project/ash_json_api_wrapper 的其他 Issue
-
enhancement
难度 3/5 1-2 天 新手友好度 45/100
ash-project/ash_json_api_wrapper#107 · 2 条评论 · 1 个 reaction ·
-
enhancement
难度 4/5 3-5 天 新手友好度 35/100
ash-project/ash_json_api_wrapper#7 · 1 条评论 ·
查看 ash-project/ash_json_api_wrapper 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
-
[Python] Worker.close() spins at 100% CPU when its teardown task is canceled可能已有人在做 @Glutexo 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
taskforcesh/bullmq#5053 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
hexlet-codebattle/codebattle#2374 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
mathieuprog/tz#44 ·
-
documentation
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复