The Schema Project is aimed at providing a method of defining the "shape" of your public data structures. This library is a collection of Schema utilities that we believe may be useful to a large part of the community.
Add the latest version into your dependencies
(defproject :dependencies [[cddr/integrity "0.3.0-SNAPSHOT"]])
attributes function generates datomic attribute definitions to match the specified
HAL is the hypertext application language. As the summary at the link above describes, HAL based APIs are easily discoverable by client applications. The vars in this namespace may be helpful when generating walkers that require knowledge of HAL data-structures. For example usage, see the tests
When some data input is checked against some schema,
returns a ValidationError object. The
human-explain function translates
this error object into a message that should be surfaceable to an end-user.
For example usage, see the tests
When using schema's
pred type constructor, be sure to give your predicate
a name which satisfies the function
human-expectation?. This should ensure
that the information needed by
ValidationTransformer to print a human
readable message is attached to your predicate function.
Schema defines a
pred utility which builds a schema that matches it's
input if the supplied predicate returns true. Here, we use this to build
numeric schemas that can be more specific than just a type of number.
(gt 21) builds a schema one could use to ensure the input
data is old enough to buy booze. For more examples, see the tests
Schema walker generators take a schema as input, and use it to return a
function that walks input data in-step with the the corresponding schema. For
lookup walker replaces "references" in the input document
with the result of looking them up in an external data source. For example
usage, see the tests
If you've found a bug, you have the following options, ordered by usefulness to the community
- Issue a pull request that contains a test that fails against a released version, together with a change that fixes the test.
- Create an issue describing the minimal steps to reproduce; the version of the project you are using; what you see; and what you expected to see
- Create an issue describing the problem in as much detail as you can
If you have an idea for a feature, make a github issue and lets talk about it
Running the tests
Before issuing a pull request, please use the following command to ensure the unit tests pass and the API docs can be generated
$ lein do clean, test
Copyright © 2014 Andy Chambers
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.