inaka / Dayron

A repository `similar` to Ecto.Repo that maps to an underlying http client, sending requests to an external rest api instead of a database
http://inaka.net/blog/2016/05/24/introducing-dayron/
Apache License 2.0
159 stars 20 forks source link

Dynamic atom keys #59

Open cloud8421 opened 7 years ago

cloud8421 commented 7 years ago

The default HTTPoison adapter implementation decodes and creates atom keys, which may lead to unsolvable memory leaks.

I see here that __from_json__/2 assumes (in the default implementation) atom keys, but it doesn't have to.

Would it be worth revising that method default implementation to handle string keys, so that we avoid the problem altogether? If I'm not mistaken, we can leverage the schema as well at that point and generate it from the definition.