This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
write json schemas in elm
version 3.0.0
license BSD3
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 3.0.0
Committed At 2018-03-12 12:26:41 UTC
norpan/elm-json-patch 1.0.0 <= v < 2.0.0 1.0.1
mgold/elm-random-pcg 4.0.2 <= v < 5.0.0 4.0.2
elm-lang/html 2.0.0 <= v < 3.0.0 2.0.0
elm-lang/core 5.0.0 <= v < 6.0.0 5.1.1
elm-community/maybe-extra 3.1.0 <= v < 4.0.0 3.1.0
elm-community/elm-test 4.0.0 <= v < 5.0.0 4.2.0
eeue56/elm-shrink 1.0.0 <= v < 2.0.0 1.0.0
Skinney/murmur3 2.0.4 <= v < 3.0.0 2.0.8
NoRedInk/elm-decode-pipeline 3.0.0 <= v < 4.0.0 3.0.1

README

Elm JSON Schema

It's very easy to write a JSON Schema that is valid JSON but not a valid JSON Schema. Such faulty schema's still work, they'll just be less strict then you think they are. Usually you'll learn about this a bit later than you'd prefer.

Elm-json-schema allows you to write your JSON schema's in Elm, ensuring a valid result.

Example

personSchema : Schema
personSchema =
    object
        [ title "person"
        , properties
            [ required "firstName" <| string []
            , required "lastName" <| string []
            , optional "age" <|
                integer
                    [ description "Age in years"
                    , minimum 0
                    ]
            , optional "height" <|
                number
                    [ description "Height in meters"
                    , minimum 0
                    ]
            , required "tags" <|
                array 
                    [ items <| string []
                    , minItems 1
                    ]
            ]
        ]

Links