I've created a post about this decoder problem, I hope it helps other 
people: 
https://medium.com/@adrian_ribao/recursive-decoders-on-elm-to-manage-server-side-validation-errors-82bee47cc38c


El lunes, 27 de marzo de 2017, 12:37:38 (UTC+2), Adrian Ribao escribió:
>
> Hello,
>
> I'm creating a library to manage persistence with an Elixir backend using 
> Phoenix Framework. In Phoenix, invalid fields are returned like this:
>
> { "errors" : 
>     field_name: ["list", "of", "errors"]
> }
>
> And when you are working with nested relations, errors are like:
>
> { "errors" : 
>     nested_form: [
>         {name: ["Name too short"]}
>     ]
> }
>
> For each field name, instead of getting a list of strings, now you get a 
> dict with a list of strings.
>
> The two kind of errors may appear in the same json:
>
> { "errors" : 
>     field_name: ["This field is not valid"],
>     nested_form: [
>         {name: ["Name too short"]}
>     ]
> }
>
> I've created a recursive decoder, you can see it here: 
> https://ellie-app.com/LdLVZWNJHfa1/11
>
> But event though it compiles, using the lazy function raises a runtime 
> exception.
>
> Is this a bug or I'm implementing it wrong?
>
> Thanks,
>
> Adrián
>
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to