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

Custom keys mapping between struct and json #163

Open
Mehonoshin opened this issue Mar 24, 2018 · 2 comments
Open

Custom keys mapping between struct and json #163

Mehonoshin opened this issue Mar 24, 2018 · 2 comments

Comments

@Mehonoshin
Copy link

Hey, folks!

I wonder if it is possible to implement some custom mapping of keys?

E.g. I have a json
{"a": 1, "b": 2} and I want to decode it to defstruct key_one: '', key_two: ''

Do you think it is possible to implement such behavior within your library?
I can do that if you approve that it is suitable for your project.

@Mehonoshin
Copy link
Author

@devinus WDYT?

@pavellishin
Copy link

I'd love to have this, so our JSON can use camelCase keys, and our elixir can stay in snake_case

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

2 participants