Comments (2)
Its a good point. The reasoning for using atoms was readability - struct fields tend to pervade client code so there's a good amount of re-use of the atom keys here.
In this particular case, the keys returned in a SparkPost API response are a bounded smallish set except for 2 cases: transmission substitution_data and metadata keys. That comment is about keeping those 2 situations under control.
I wonder whether exposing string/atom decoding as an option might be worthwhile? It'd require all field use in the client lib to be string/atom agnostic which sounds non-trivial.
from elixir-sparkpost.
@ewandennis I agree with the fact that most of the atoms should be being re-used.
There are three ways I can think of accomplishing this:
1.) As an option, as you suggested.
2.) Allowing the caller to handle transformations before moving forward.
3.) As a specific whitelist of endpoints to atom-ify using pattern matching
Not looking for an immediate decision to be made, but I did want to see it in the issue tracker so that anyone who does run into this issue has somewhere centralized to discuss
from elixir-sparkpost.
Related Issues (20)
- Create Transmission with "ip_pool" option
- Create Transmission with "inline_css" option
- Update to Poison 3
- Cut a new release
- `:application.get_env(:sparkpost, :vsn)` returns undefined
- HTTPoison timout option
- Update readme version HOT 1
- More idiomatic response tuples HOT 1
- "test" mode HOT 1
- Template API HOT 1
- Broader Elixir version support
- "Resource not found" when previewing template HOT 1
- Update readme for 0.4.0
- Remove ibrowse from README
- Impossible to use with Phoenix due version mistmatch HOT 1
- Add support in Address structure for BCC and CC HOT 1
- Transmission.get no longer supported? HOT 2
- use httpoison 1.x HOT 4
- Is anyone still maintaining this? HOT 1
- SparkPost.Endpoint.decode_response_body/1 uses decoding as atoms
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elixir-sparkpost.