ITADN

Docs: header rename 'page-items' → 'page-limit' in v43

#860Closedkostas-s 创建于 2026-01-14
documentation
K
kostas-scommented
### 👀 Before submitting... - [x] I asked [Pagy AI](https://gurubase.io/g/pagy) (Good starting point for further investigation). - [x] I searched through the [Documentation](https://ddnexus.github.io/pagy/), [Issues](https://github.com/ddnexus/pagy/issues), and [Q&A](https://github.com/ddnexus/pagy/discussions/categories/q-a) ### Description The default header for the 'limit' value changed from `page-items` to `page-limit` in v43 but it doesn't seem to be mentioned in the changelog or upgrade guide. This header change can potentially impact API consumers. Up to **v9.4.0** [headers.rb#L8](https://github.com/ddnexus/pagy/blob/9.4.0/gem/lib/pagy/extras/headers.rb#L8) ```ruby { page: 'current-page', limit: 'page-items', count: 'total-count', pages: 'total-pages' } ``` Updated on **v43.0.0.rc1** [headers_hash.rb#L9](https://github.com/ddnexus/pagy/blob/43.0.0.rc1/gem/lib/pagy/toolbox/helpers/headers_hash.rb#L9) ```ruby { page: 'current-page', limit: 'page-limit', count: 'total-count', pages: 'total-pages' } ``` In the changelog, a relevant section I was able to find was back in [v9.0](https://ddnexus.github.io/pagy/changelog_legacy/#simple-renaming) where there was a big renaming from the term `items` to the term `limit`, but the header change I'm mentioning did not happen at that point. ## Suggestion Since the upgrade guide was very comprehensive, I believe a warning about the default header rename in the upgrade guide, under [Extras-headers](https://ddnexus.github.io/pagy/guides/upgrade-guide/#extras), would be helpful to include. In addition, some simple instructions on how to retain pre-v43.0 headers could also be nice. (example) If an application needs to preserve the pre-v43 `page-items` header, you can override the defaults in pagy.rb: ```ruby Pagy.options[:headers_map] = { page: 'current-page', limit: 'page-items', count: 'total-count', pages: 'total-pages' } ```
关闭于 2026-01-15 1 条评论