Last active
September 28, 2017 23:30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Person exposing (..) | |
import Json.Decode exposing (Decoder, int, string) | |
import Json.Decode.Pipeline exposing (decode, required) | |
type alias Person = | |
{ id : Int | |
, firstName : String | |
, lastName : String | |
} | |
personDecoder : Decoder Person | |
personDecoder = | |
decode Person | |
|> required "id" int | |
|> required "first_name" string | |
|> required "last_name" string |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment