You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I configure custom parameters for library I get incorrect links for headers.
For example,
ApiPagination.configuredo |config|
...
# If you have more than one gem included, you can choose a paginator.config.paginator=:pagy# or :will_paginate# Optional: what parameter should be used to set the page optionconfig.page_paramdo |params|
params[:page][:number]ifparams[:page].is_a?(ActionController::Parameters)end# Optional: what parameter should be used to set the per page optionconfig.per_page_paramdo |params|
params[:page][:size]ifparams[:page].is_a?(ActionController::Parameters)end
...
end
Yeah, it looks like both Rails and grape just hardcode page as the parameter name despite configuration.
To be honest, I'm not sure how to solve this given how the configuration class currently works. The configuration options for the page and per_page parameter names take a block, and the block can contain anything. There can be any sort of nesting within the params hash, and I can't see any way of actually retrieving the names themselves so that I can just set the new param.
This issue makes me think that the method for configuring these parameter names itself is flawed and would need to be changed, which would be a breaking change. Or maybe it wouldn't be, since this technically doesn't work.
When I configure custom parameters for library I get incorrect links for headers.
For example,
Some response,
Maybe is it hardcode?
The text was updated successfully, but these errors were encountered: