You’ve modeled your data exactly how it should be, and everything’s working fine.
Now it’s time to finish your JSON Decoder, but certain fields are strings where in your Elm code they’re complex data types!
This happens most often with dates, but tagged unions have this problem too.
In 0.17 we had
customDecoder, which could turn any
Result String a into a
Decoder a, but it went away in 0.18.
So… what do we do?
You know how it takes so much effort to produce even the simplest of programs when JSON parsing is involved?
Wouldn’t it be nice if you could breeze right on by that step and get on with writing your business logic?
This is what you’ll get with The JSON Survival Kit, a short ebook on JSON decoding in Elm.
You’ll learn how to piece the JSON decoder API together in a way that works for your situation so you can get back to solving your problems.
Get step-by-step instructions for avoiding boilerplate, write decoders so adapting to new data is a breeze, and finally understand why the time and effort is worth it (hint: it so is.)
Never get stuck on JSON Decoding again!