Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how do I alter key format when deserializing #121

Open
bsylvain opened this issue Sep 9, 2020 · 0 comments
Open

how do I alter key format when deserializing #121

bsylvain opened this issue Sep 9, 2020 · 0 comments

Comments

@bsylvain
Copy link

bsylvain commented Sep 9, 2020

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant