The hjsonschema package

[ Tags: data, library, mit ] [ Propose Tags ]

[Skip to Readme]

Properties

Versions 0.1.0.0, 0.1.1.0, 0.2.0.0, 0.3.0.0, 0.4.0.0, 0.5.0.0, 0.5.1.0, 0.5.1.1, 0.5.1.2, 0.5.1.3, 0.5.2.0, 0.5.2.1, 0.5.2.2, 0.5.3.0, 0.5.3.1, 0.5.3.2, 0.6.0.0, 0.6.0.1, 0.6.0.2, 0.7.0.0, 0.7.1.0, 0.8.0.0, 0.8.0.1, 0.9.0.0, 0.10.0.0, 0.10.0.1, 0.10.0.2, 0.10.0.3, 1.0.0.0, 1.1.0.0, 1.1.0.1, 1.2.0.0, 1.2.0.1, 1.2.0.2, 1.3.0.0, 1.3.0.1, 1.4.0.0, 1.5.0.0, 1.5.0.1, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.7.0 (info)
Change log changelog.md
Dependencies aeson (>=0.11 && <1.3), base (>=4.7 && <4.11), 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-types (>=0.8 && <0.10), pcre-heavy (==1.0.*), profunctors (>=5.0 && <5.3), protolude (>=0.1.10 && <1.2), QuickCheck (>=2.8 && <2.11), scientific (==0.3.*), semigroups (==0.18.*), text (>=1.1 && <1.3), unordered-containers (==0.2.*), vector (>=0.10 && <1.0) [details]
License MIT
Author Ian Grant Jeffries
Maintainer ian@housejeffries.com
Category Data
Home page https://github.com/seagreen/hjsonschema
Uploaded Tue Sep 19 03:49:06 UTC 2017 by seagreen
Distributions LTSHaskell:1.6.3, NixOS:1.7.0, Stackage:1.7.0, Tumbleweed:1.5.0.1
Downloads 4501 total (96 in the last 30 days)
Rating 0.0 (0 ratings) [clear rating]
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-09-19 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for hjsonschema-1.7.0

[back to package description]

hjsonschema logo

A Haskell implementation of the most commonly used JSON Schema specification (Draft 4).

Hackage / GitHub / Travis CI

Notes

  • As of 2017 json-schema-org has begun releasing new drafts of the standard. Once this work stabilizes hjsonschema will add coverage for the latest draft.

  • Requires pcre (pkgs.pcre in Nixpkgs).

  • Schemas with circular references can cause infinite loops. hjsonschema does loop detection but it may not be solid yet -- please open an issue if you find a situation where it fails.

Example

See here.

Tests

Run all tests:

stack test

Run only local tests:

stack test hjsonschema:local

Run remote tests (makes GETs to json-schema.org, also temporarily starts an HTTP server on port 1234):

stack test hjsonschema:remote

Details

Goals

  • Be a correct and fast implementation of the spec.

  • Be a useful reference for implementers in other languages. Haskell's high level nature, expressive type system and referential transparency suit this purpose well.

Good Parts

  • Passes all the required tests in the language agnostic test suite. NOTE: due to an issue with the test suite this isn't true at the moment, see #175.

  • Very modular, which should make it easy to support future versions of the specification.

Bad Parts

  • Uses the pcre-heavy regular expression library for the "pattern" validator. It should use a library based on the ECMA 262 regex dialect, which the spec requires.

  • Currently doesn't support the optional "format" validators.

Vendoring

  • 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.

Credits

TJ Weigel created the logo.

Tim Baumann wrote aeson-schema, on which hjsonschema's test code and its implementation of SchemaGraph were based.

Julian Berman maintains the fantastic language agnostic test suite.