You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The validated output from a form is represented as a Value. It is easy to encode such a Value into JSON using the Json.Schema.From.Encode module. But if you instead want to use the value in your Elm program it becomes a bit more cumbersome to use the generic Value type.
Solution
Create a way to write decoders that can turn a Value into an arbitrary Elm value. It would work the same exact way as a a Json.Decode decoder.
A nice bonus would be if it was possible to also include metadata from the schema when decoding, so that you can annotate your Elm value with for example the title attribute from the schema.
The text was updated successfully, but these errors were encountered:
Problem
The validated output from a form is represented as a
Value
. It is easy to encode such aValue
into JSON using theJson.Schema.From.Encode
module. But if you instead want to use the value in your Elm program it becomes a bit more cumbersome to use the genericValue
type.Solution
Create a way to write decoders that can turn a
Value
into an arbitrary Elm value. It would work the same exact way as a aJson.Decode
decoder.A nice bonus would be if it was possible to also include metadata from the schema when decoding, so that you can annotate your Elm value with for example the
title
attribute from the schema.The text was updated successfully, but these errors were encountered: