new jsonapi_page_size option
fluxsaas opened this issue ยท 3 comments
fluxsaas commented
Hello!
regarding the new jsonapi_page_size
implementation, i would like to suggest to always call the method jsonapi_page_size
even if the params page[size]
is passed to the request:
jsonapi.rb/lib/jsonapi/pagination.rb
Lines 97 to 104 in 3a685a7
a use case could be to implement a logic to set/overwrite the max size of a response:
def jsonapi_page_size
pagination = params[:page].try(:size) || {}
per_page = pagination[:size] || 50
per_page = 50 if per_page.to_f.to_i > 50
return per_page
end
best โ๏ธ
fluxsaas commented
sure, do you want to raise an exception if per_page < 1
or just let the user handle the situation?
best
stas commented
There should be no exceptions. Thank you!