Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
niho opened this issue Jun 8, 2021 · 0 comments
Open

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

niho opened this issue Jun 8, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@niho
Copy link
Owner

niho commented Jun 8, 2021

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.

@niho niho added the enhancement New feature or request label Jun 8, 2021
@niho niho self-assigned this Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant