@hackage json-schema0.7.3.2
Types and type classes for defining JSON schemas.
Installation
Dependencies (12)
- aeson >=0.7 && <0.9
- base >=4.6 && <5
- containers >=0.3 && <0.6
- generic-aeson >=0.2 && <0.3
- generic-deriving >=1.6 && <1.8
- mtl >=2.1 && <2.3 Show all…
Dependents (8)
@hackage/acme-everything, @hackage/rest-gen, @hackage/rest-snap, @hackage/rest-example, @hackage/diplomacy-server, @hackage/rest-types, Show all…
json-schema
json-schema is like XML schemas, but for JSON. It's haskell specific and has no relation to json-schema.org.
The package provides
- An AST type
Schemadefining the structure of a JSON object. - A type class
JSONSchemato define a schema for a type. - Combinators for defining schemas.
- A module for validating Aeson values against schemas.
- Built-in instances matching aeson's.
- A Generics module matching aeson instances generated by generics-aeson
If you use another library for generating JSON instances (such as aeson's built-in generics/template haskell) or write aeson instances by hand you will not get matching JSONSchema instances if you use json-schema's generics module.
This package assumes that your ToJSON and FromJSON instances match.
Installation
This package is available on hackage
$ cabal install json-schema
Examples
see the examples folder or The test suite.