jsonapi-rb / jsonapi-rails

Rails gem for fast jsonapi-compliant APIs.
http://jsonapi-rb.org
MIT License
321 stars 63 forks source link

how do I alter key format when deserializing #121

Open bsylvain opened 4 years ago

bsylvain commented 4 years ago

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?