hjsonschema: JSON Schema library

[ data, library, mit ] [ Propose Tags ]
Versions,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.7.0, 1.7.1, 1.7.2, 1.8.0 (info)
Change log changelog.md
Dependencies aeson (>=0.11 && <1.3), base (>=4.7 && <5), bytestring (==0.10.*), containers (==0.5.*), file‑embed (>=0.0.8 && <0.1), filepath (>=1.3 && <1.5), hashable (==1.2.*), hjsonpointer (>=1.1 && <1.4), http‑client (>=0.4.30 && <0.6), http‑client‑tls (==0.3.*), http‑types (>=0.8 && <0.10), pcre‑heavy (==1.0.*), profunctors (>=5.0 && <5.3), protolude (>=0.1.10 && <0.3), QuickCheck (>=2.8 && <2.11), safe‑exceptions (>=0.1.6 && <0.2), scientific (==0.3.*), semigroups (==0.18.*), text (>=1.1 && <1.3), unordered‑containers (==0.2.*), vector (>=0.10 && <0.13) [details]
License MIT
Author Ian Grant Jeffries
Maintainer ian@housejeffries.com
Revised Revision 1 made by seagreen at Tue Mar 20 03:05:00 UTC 2018
Category Data
Home page https://github.com/seagreen/hjsonschema
Uploaded by seagreen at Tue Mar 20 03:04:59 UTC 2018
Distributions Arch:1.7.2, LTSHaskell:1.7.2, NixOS:1.8.0, openSUSE:1.7.2
Downloads 10170 total (135 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-03-20 [all 1 reports]
Hackage Matrix CI

[Skip to Readme]




Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

For package maintainers and hackage trustees

Readme for hjsonschema-1.8.0

[back to package description]


A Haskell implementation of JSON Schema (Draft 4).

Hackage / GitHub / Travis CI


See here.


hjsonschema was an attempt to build a very modular JSON Schema library. Validators have a concrete type and can be mixed and matched into new Specs.

However this flexibility comes at the price of complicating the code. I'm no longer sure it was the right tradeoff, especially since situations where you'd want to change what validators make up a Spec at runtime seem rare.

Also, there are edge cases of JSON Schema that hjsonschema doesn't implement properly (as you can see from the issue tracker). My motivation to fix them myself has ended. However, I'll still maintain the library, give feedback on issues, and merge PRs. I'd also be happy to advise any Haskellers who are interested in writing their own JSON Schema libraries.

System dependencies

  • Requires pcre (pkgs.pcre in Nixpkgs).


Run all: stack test

Run only local tests: stack test hjsonschema:local

Run only remote tests (temporarily starts an HTTP server on port 1234 and makes GETs to json-schema.org): stack test hjsonschema:remote


  • JSON-Schema-Test-Suite is vendored from commit # c1b12bf699f29a04b4286711c6e3bbfba66f21e5 here.

  • src/draft4.json is from commit # c1b12bf699f29a04b4286711c6e3bbfba66f21e5 here. The root ref in remote ref test has been modified to fix #175.

  • .travis.yml was created with make_travis_yml_2.hs commit # ea6c7d177a97bfbfb2fdc4deba943d60d2aff199.