Skip to content

Add a way to decode Value into arbitrary Elm value #6

@niho

Description

@niho

Problem

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions