4.7.1
Add an :enforce_max_per_page
option to pagination in Grape APIs:
class MoviesAPI < Grape::API
format :json
desc 'Return a paginated set of movies'
paginate per_page: 25, max_per_page: 100, enforce_max_per_page: true
get do
# If a client tries to make a request with a `per_page` param that is above 100,
# no movies will be returned. Instead, a client error will be returned.
paginate Movie.all
end
end