Commit Graph

17 Commits

Author SHA1 Message Date
Luke Kersting
8a7d1d3fde Adapt CMake project name to be coherent with nlohmann::json's naming
Now when json-schema-validator is installed CMake config files are installed in the lib/cmake/json-schema-validator directory.
The install json-schema-validatorTargets.cmake file properly imports the json-hpp and json-schema-validator libraries.
The install json-schema-validatorConfig.cmake file is used by CMake find_package function to include the json-schema-validatorTargets.cmake file and to set the variable JSON_SCHEMA_VALIDATOR_INCLUDE_DIRS to the install include directory.
To use find_package to find the json-schema-validator simply include.
A new test (test_cmake_install) has been added.

When NLohmann's JSON is install with CMake, it follows a certain
naming convention.

As we learned to do proper CMake-install thanks to @lkersting's work
this project now adapts to the way NLohmann is doing it. Namely:

- json-schema.hpp is now located (and installed)
  in a nlohmann/-subdirectory
- the CMake library and project's name is now
  nlohmann_json_schema_validator

Instead of doing non-standard acrobatics to find the json.hpp
now find_package is used in order to find NLohmann's package

Co-Authored-By: Patrick Boettcher <p@yai.se>
2019-12-05 11:12:23 +01:00
mxmlnkn
ad8f158284 add support for some built-in string format specifiers: date-time, date, time, ipv4, ipv6 2019-12-03 16:28:54 +01:00
Ákos Szőts
3ae9c77e83 Open files in read-only mode in validator 2019-06-12 13:09:47 +02:00
Patrick Boettcher
6c482e1035 error-handler now receives a json_pointer as path
Indicating where in the instance the error occurred.
The pointer is relative to the root of the instance.
2019-03-20 15:22:51 +01:00
Patrick Boettcher
7beb40bc61 Complete rewrite of the validator - aiming a 2.0-release
Schema a now "parsed" into C++-validator-objects in a first
step and then validation takes place with these objects.

Errors are now handled via a user-provided error-handler
allowing the user to collect all errors at once or bail out
when a certain threshold is reached. Fixes #36 and #8.

One (sub-)schema can now be referenced with different URIs. Fixes #9

JSON schema draft 7 is now supported. Fixes #35
2018-12-27 16:59:19 +01:00
Patrick Boettcher
81c8bc2190 include "iostream" in programs 2017-08-08 15:51:16 +02:00
Patrick Boettcher
bea8b399d0 cli: print stdin-offset when parsing (or validating) fails 2017-08-08 15:36:59 +02:00
Gert Van Hoey
42b32c500c Build as shared library on Windows using Visual Studio compiler (#10)
* Build on Windows using Visual Studio and export symbols from DLL

* Fix two warnings on raised by Visual Studio 2015 compiler + disable -Wall and -Wextra when using Visual Studio compiler

* Fix indentation (TAB instead of spaces)
2017-08-07 13:35:35 +02:00
Patrick Boettcher
781fd1cebb app: be more precise for error messages 2017-01-27 10:08:20 +01:00
Patrick Boettcher
c78ca226a8 code cleanup and comment for a FIXME 2017-01-12 16:18:40 +01:00
Patrick Boettcher
8b69330804 app: add a default format-checker - which is always happy 2016-12-28 16:46:03 +01:00
Patrick Boettcher
c4a9cdb280 app: do not include <set> - not needed anymore 2016-12-28 10:53:39 +01:00
Patrick Boettcher
5e9605b055 validator: update API so that the root-schema-insertion can be located in a try-catch-block 2016-12-27 13:50:45 +01:00
Patrick Boettcher
998f97ba4e validator: handle undefined schema-loader via a std::function given at construction-time 2016-12-27 11:39:48 +01:00
Patrick Boettcher
b2240084fe validator: rework everything to handle local and remote refs
Added json-uri and json-pointer-classes and a schema-preparation-pass.
2016-12-26 23:48:57 +01:00
Patrick Boettcher
42a8b00d1d validator: $ref implemented for local references
But needs more work.
2016-12-24 00:10:48 +01:00
Patrick Boettcher
bf4cef21c3 initial commit 2016-12-23 00:04:42 +01:00