The problem is that then checking for an invalid parameter would have to be done for each controller, duplicating code.

As mentioned in point 3. of the discussion, it is recommended to treat invalid parameters with a 400 rather than a default value.

There is probably a Gem that takes care of this type of REST API boilerplate, but I decided not to search too much for it to implement a single function like this. Using such a Gem is the best long term solution.