How to convert from String to Int in Json.Decoder
... and to answer myself :) I found the solution in this Flickr example
decodeData : Json.Decoder (Id, String)
decodeData =
let number =
Json.oneOf [ Json.int, Json.customDecoder Json.string String.toInt ]
in
Json.at ["data", "0"]
<| Json.object2 (,)
("id" := number)
("label" := Json.string)