I'm migrating a Ruby on Rails application from 3.0 to 3.1 and ran into some problems with the change of the JSON backend.
The line ActiveSupport::JSON.decode(some_variable)
gives me the MultiJson::DecodeError nesting of 20 is too deep
.
The variable I'm trying to decode is indeed heavily nested (max 29 levels).
The maximum nesting level should be changeable with the :max_nesting
option ('Nesting too deep' error while retrieving JSON using HTTParty) but this doesn't seem to work.
Both ActiveSupport::JSON.decode(some_variable, :max_nesting => false)
and ActiveSupport::JSON.decode(some_variable, :max_nesting => 100)
result in the same error.
Is there a way to pass the max_nesting
option or set it application wide?