Sha256: 5be7fcbc1c5141a0f68c30941b1f28a2d66704af05fa7cc74b5b88802abd130f
Contents?: true
Size: 560 Bytes
Versions: 9
Compression:
Stored size: 560 Bytes
Contents
module IntrospectiveGrape module SnakeParams def snake_params_before_validation before_validation do # We have to snake case the Rack params then re-assign @params to the # request.params, because of the I-think-very-goofy-and-inexplicable # way Grape interacts with both independently of each other (CamelSnakeKeys.snake_keys(params)||{}).each do |k,v| request.delete_param(k.camelize(:lower)) request.update_param(k, v) end @params = request.params end end end end
Version data entries
9 entries across 9 versions & 1 rubygems