jsonapi-rails icon indicating copy to clipboard operation
jsonapi-rails copied to clipboard

how do I alter key format when deserializing

Open bsylvain opened this issue 5 years ago • 0 comments

I want to replace dash by underscore in the keys when I deserialize. I tried to alter the Deserializable resource in an initializer : JSONAPI::Deserializable::Resource.key_formatter = proc {|k| k.to_s.underscore }

and it does not seems to be working. I end up with always the same warning: Unpermitted parameters: :dasherized-param

It seems there is a way to alter key at deserialization, how can I do that?

bsylvain avatar Sep 09 '20 17:09 bsylvain