Custom keys mapping between struct and json
Mehonoshin opened this issue · 2 comments
Mehonoshin commented
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 commented
@devinus WDYT?
pavellishin commented
I'd love to have this, so our JSON can use camelCase
keys, and our elixir can stay in snake_case