Go to file
2015-05-05 20:52:29 +10:00
doc Initial commit. 2013-10-30 07:51:11 +11:00
examples Fix custom_schema example and include it in the CMake build 2015-03-15 15:38:40 +11:00
include/valijson Reduce string copying in JSON pointer resolution 2015-05-05 20:52:29 +10:00
tests Lift rough JSON Pointer resolution functions into separate file 2015-05-05 16:18:21 +10:00
thirdparty Upgrade to jsoncpp 0.9.4 2015-03-15 12:24:34 +11:00
xcode/valijson.xcodeproj Lift rough JSON Pointer resolution functions into separate file 2015-05-05 16:18:21 +10:00
.gitignore Update CMake build to include external_schema example, and add usage info to external_schema.cpp. 2014-06-15 15:24:26 +10:00
.travis.yml Attempt to fix Travis CI apt-get issue. 2014-06-15 14:22:12 +10:00
CMakeLists.txt Update test suite sources in CMakeList.txt file 2015-05-04 11:03:59 +10:00
Doxyfile Update Doxygen configuration to include README and fix misplaced @deprecated tag 2015-03-23 14:28:19 +11:00
LICENSE Initial commit. 2013-10-30 07:51:11 +11:00
README.md Fix README file so that it doesn't cause warnings when processed by doxygen 2015-05-04 11:01:44 +10:00

Valijson Build Status

Overview

Valijson is a header-only JSON Schema Validation library for C++.

Valijson provides a simple validation API that allows you load JSON Schemas, and validate documents loaded by one of several supported parser libraries.

Project Goals

The goal of this project is to support validation of all constraints available in JSON Schema v4, while being competitive with the performance of hand-written JSON validators. The library is intended to include support for remote JSON References via a callback interface.

License

Valijson is licensed under the Simplified BSD License. See the LICENSE file for more information.

Dependencies

Required:

  • boost 1.54

Later versions of boost (up to 1.57) are also known to work correctly.

Valijson supports JSON documents loaded using JsonCpp, RapidJson and Boost Property Tree. It has been tested against the following versions of these libraries:

Version of JsonCpp going back to 0.5.0 should also work correctly, but versions from 1.0 onwards have not yet been tested.

Other versions of these libraries may work, but have not been tested.

JSON Schema Support

Valijson supports most of the constraints defined in Draft 3 and Draft 4 of the JSON Schema specification.

The exceptions for Draft 3 are:

  • disallow
  • extends
  • format (optional)
  • readonly
  • ref
  • refRemote

The exceptions for Draft 4 are:

  • definitions
  • format (optional)
  • ref
  • refRemote

Support for JSON References is in development.

Build instructions

cmake

The examples and test suite can be built using cmake:

# Build examples and test suite
mkdir build
cd build
cmake ..
make

# Run test suite (from build directory)
./test_suite

Xcode

An Xcode project has also been provided, in the 'xcode' directory. Note that in order to run the test suite, you may need to configure the working directory for the 'test_suite' scheme. It is recommended that you use the 'xcode' directory as the working directory.

The Xcode project has been configured so that /usr/local/include is in the include path, and /usr/local/lib is in the library path. These are the locations that homebrew installed Boost on my test system.

Documentation

Doxygen documentation can be built by running 'doxygen' from the project root directory. Generated documentation will be placed in 'doc/html'. Other relevant documentation such as schemas and specifications have been included in the 'doc' directory.

Testing

The test suite currently contains several hand-crafted tests and uses the standard JSON Schema Test Suite to test support for parts of the JSON Schema feature set that have been implemented.