# json-schema
[](https://travis-ci.org/silkapp/json-schema)
`json-schema` is like XML schemas, but for JSON.
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](http://hackage.haskell.org/package/aeson).
* A Generics module matching aeson instances generated by [generics-aeson](http://hackage.haskell.org/package/generic-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](http://hackage.haskell.org/package/json-schema)
```shell
$ cabal install json-schema
```
## Examples
see [the examples folder](https://github.com/silkapp/json-schema/blob/master/examples/Example.hs) or [The test suite](https://github.com/silkapp/json-schema/tree/master/tests).