agrafix / agrafix/elm-bridge

Issue with UTCTime to Posix

Aperta
#52 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Elm
Stelle
107
Fork
28
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

It would appear that there are default alterations `UTCTime` that convert fields into `Posix`.
That's great, but it doesn't seem to be followed through in the generated code.

For example, it will correctly rename the field, but it does not import Time and uses a decoder called `jsonDecPosix` (autogenerated naming). That decoder does not exist.

Is there another way around this issue? Is there something I'm missing? We are using servant-elm but I tried directly through elm-bridge and got the same results.

This is an example (ignore the silly naming) from the generated code:
```
type alias FweetDto =
{ fwuser: FwuserDto
, fwody: String
, fwimestamp: Posix
}

jsonDecFweetDto : Json.Decode.Decoder ( FweetDto )
jsonDecFweetDto =
Json.Decode.succeed (\pfwuser pfwody pfwimestamp -> {fwuser = pfwuser, fwody = pfwody, fwimestamp = pfwimestamp})
|> required "fwuser" (jsonDecFwuserDto)
|> required "fwody" (Json.Decode.string)
|> required "fwimestamp" (jsonDecPosix)```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.