@hackage / json-schema

Types and type classes for defining JSON schemas.

Latest0.7.4.2

About

Metadata

  • Last updated , by AdamBergmark
  • License BSD-3-Clause
  • Maintained by: code@silk.co

  • Lottery factor: 0

Links

Installation

Tested Compilers

  1. 8.4.3
  2. 8.2.2
  3. 8.0.2
  4. 7.10.3

Readme

json-schema

Build Status

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 Schema defining the structure of a JSON object.
  • A type class JSONSchema to 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.