devinus / poison

An incredibly fast, pure Elixir JSON library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom keys mapping between struct and json

Mehonoshin opened this issue · comments

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.

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