topica
topica

Reputation: 319

Does Elm have JSON Type Provider?

It seems that the only way to handle JSON in Elm is to decode each JSON scheme manually by Json.Decode.

Is there a nice alternative like F#'s Type Provider or something?

F# Data: JSON Type Provider

Upvotes: 1

Views: 98

Answers (1)

Romario Lopez C
Romario Lopez C

Reputation: 174

There is no official package doing this but there are community alternatives like this one: https://github.com/eeue56/json-to-elm

Create Elm type aliases and decoders based on JSON input

This project allows you to automate the creation of:

  • type aliases from JSON data
  • decoders from type aliases and some union types
  • encoders from type aliases and some union types

Upvotes: 2

Related Questions