Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ocramz/aeson-schema
Haskell JSON schema validator and parser generator
https://github.com/ocramz/aeson-schema
Last synced: 22 days ago
JSON representation
Haskell JSON schema validator and parser generator
- Host: GitHub
- URL: https://github.com/ocramz/aeson-schema
- Owner: ocramz
- License: mit
- Created: 2015-08-03T16:01:00.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T04:02:05.000Z (almost 2 years ago)
- Last Synced: 2024-05-01T23:24:21.975Z (6 months ago)
- Language: Haskell
- Size: 243 KB
- Stars: 59
- Watchers: 6
- Forks: 17
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# aeson-schema [![Stack-CI](https://github.com/ocramz/aeson-schema/actions/workflows/stack-ci.yaml/badge.svg?branch=master)](https://github.com/ocramz/aeson-schema/actions/workflows/stack-ci.yaml) [![Hackage version](https://img.shields.io/hackage/v/aeson-schema.svg?style=flat)](http://hackage.haskell.org/package/aeson-schema) [![Hackage dependencies](https://img.shields.io/hackage-deps/v/aeson-schema.svg?style=flat)](http://packdeps.haskellers.com/feed?needle=aeson-schema)
aeson-schema is an implementation of the [JSON Schema specification](http://json-schema.org). It can be used in two ways:
* To validate JSON value against a schema.
* To generate a parser for a schema. The generated code includes Haskell data structure definitions and FromJSON instances. This allows you to use the validated data in a type-safe and convenient way.You can install this library using cabal:
cabal update && cabal install aeson-schema
## Running the tests
aeson-schema utilizes the cabal sandbox. To get up and running with the tests you'll need to use these commands:
cd aeson-schema
git submodule init
git submodule update
cabal sandbox init
cabal install
cabal install --enable-tests
cabal test## Compatibility
aeson-schema implements [Draft 3](http://tools.ietf.org/html/draft-zyp-json-schema-03) of the spec. It supports all core schema definitions except the following 'format' values:
* data-time
* date
* time
* utc-millisec
* color
* style
* phone
* uri
* ip-address
* ipv6
* host-nameI would be happy to accept pull requests that implement validation of one of these formats, fix bugs or add other features.
## Other libraries
The [hjsonschema](https://github.com/seagreen/hjsonschema) library is more actively maintained and implements the newer JSON Schema v4. It doesn't do code generation, however.