git.iko.soy/typeable/hjsonschema
on 0.9.0.0 help sign in
57 lines 2.1 kB history raw
1![hjsonschema logo](./logo.jpg)
3A Haskell implementation of the current [JSON Schema](http://json-schema.org/) specification (Draft 4).
5[Hackage](https://hackage.haskell.org/package/hjsonschema) / [GitHub](https://github.com/seagreen/hjsonschema) / [Travis CI](https://travis-ci.org/seagreen/hjsonschema)
7NOTE: You CANNOT use untrusted JSON data to make schemas. Schemas with circular references can cause infinite loops. See the issue list for more info.
9# Example
11See [here](https://github.com/seagreen/hjsonschema/blob/master/examples/Example.hs).
13# Tests
15## Install
17`git submodule update --init`
19## Run
21Will run self-contained:
23`cabal test local`
25Will start an HTTP server temporarily on port 1234:
27`cabal test remote`
29# Details
31## Goals
33+ Be a correct and fast implementation of the spec.
35+ Be a useful reference for implementers in other languages. Haskell's high level nature, expressive type system and referential transparency suit this purpose well.
37## Good Parts
39+ Passes all the tests in the [language agnostic test suite](https://github.com/json-schema/JSON-Schema-Test-Suite).
41+ Very modular, which should make it easy to support future versions of the specification.
43## Bad Parts
45+ Uses the [regexpr](https://hackage.haskell.org/package/regexpr-0.5.4) regular expression library for the "pattern" validator. It should use a library based on the ECMA 262 regex dialect, which the [spec](http://json-schema.org/latest/json-schema-validation.html#anchor33) requires.
47## Notes
49+ `draft4.json` is from commit # cc8ec81ce0abe2385ebd6c2a6f2d6deb646f874a [here](https://github.com/json-schema/json-schema).
51## Credits
53[TJ Weigel](http://tjweigel.com/) created the logo.
55[Tim Baumann](https://github.com/timjb) wrote [aeson-schema](https://hackage.haskell.org/package/aeson-schema), on which hjsonschema's test code and its implementation of `SchemaGraph` were based.
57[Julian Berman](https://github.com/Julian) maintains the fantastic [language agnostic test suite](https://github.com/json-schema/JSON-Schema-Test-Suite).