Commit Graph

206 Commits

Author SHA1 Message Date
Patrick Boettcher
d6ed73f240 Fix #53: only add -Wall/-Wextra for GCC and Clang 2019-03-20 16:58:03 +01:00
vpasacek
b01dcdb984 Install also dynamic library (dll) on windows 2019-03-20 16:53:34 +01:00
Patrick Boettcher
abfa3852f5 README updates and fixes 2019-03-20 16:36:59 +01:00
Patrick Boettcher
0b1fb66b21 travis: use JSON 3.6.0 2019-03-20 16:28:06 +01:00
garethsb-sony
b05248426e fix comments 2019-03-20 15:51:50 +01:00
garethsb-sony
c40fb7aa34 Improve error-message-grammar and style. 2019-03-20 15:44:14 +01: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
746394922a Use push_back of nlohmann::json_pointer if available. 2019-03-20 14:36:07 +01:00
Patrick Boettcher
e8a9f66b1d add non-regression test for #48 2019-01-24 18:27:19 +01:00
Patrick Boettcher
4b6330a0a8 fix format and remove unused arg-warning 2019-01-24 18:25:06 +01:00
garethsb-sony
011bd4470e Performing runtime tests on the combine_logic template argument causes "warning C4127: conditional expression is constant" from Visual Studio. Refactor so that the appropriate tests are selected at compile time. 2019-01-24 18:10:17 +01:00
garethsb-sony
a1c6531540 [#48] Tolerable difference depends on input values (and since x must be larger than multipleOf value in order to succeed, that's the critical one) 2019-01-24 18:10:17 +01:00
garethsb-sony
cf32c4e8fd [#47] Suppress "warning C4244: 'argument': conversion from '__int64' to 'double', possible loss of data" from Visual Studio 2019-01-24 18:10:17 +01:00
garethsb-sony
9dc77f7159 Avoid "warning C4457: declaration of 'e' hides function parameter" from Visual Studio and equivalent in GCC 2019-01-24 18:10:17 +01:00
garethsb-sony
c9ff2c8c4c json_validator used to be copyable; it can still be movable 2019-01-21 11:02:25 +00:00
garethsb-sony
4a9b26afce Add missing #include, to compile with VS2015 2019-01-21 11:02:25 +00:00
Patrick Boettcher
1e50a93626 Fix #44: format-checker-callback was not used, is now 2019-01-13 18:05:44 +01:00
Patrick Boettcher
aa3715bdb7 Add VERSION and SOVERSION propoerty to library 2018-12-28 19:13:45 +01:00
Patrick Boettcher
efe8f7d1a4 Rename readme-target for readme-code-example 2018-12-28 11:45:02 +01:00
Adrien Martin
2c6a930341 Compile options should be private 2018-12-28 11:24:11 +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
Maxim Bondarenko
2785ce0c64 fixed compile error: aggregate ‘std::stringstream s’ has incomplete type and cannot be defined 2018-11-22 17:03:04 +01:00
Bryan Gillespie
e3d42e65c2 Add CMake options to disable extras and support install
Description:
- Adds support for the following CMake options:
- BUILD_TESTS (default: ON)
- BUILD_EXAMPLES (default: ON)
- CMAKE_INSTALL_PREFIX (both static and shared)
2018-05-12 11:22:15 +02:00
Patrick Boettcher
16aa1c05c7 tests: test for explicit false exclusivity 2018-04-24 18:48:26 +02:00
Patrick Boettcher
16f0ad3180 Add Travis build-tag to README 2018-04-18 14:54:14 +02:00
Bryan Gillespie
2db9c1e426 Fix #28: Differentiate integer and floating point validation 2018-04-18 14:08:15 +02:00
Patrick Boettcher
7ee17659fe CI: travis integration 2018-04-18 11:49:36 +02:00
Patrick Boettcher
57f7809532 tests: add draft4-tests from json-schema-test-suite to this repo 2018-04-18 11:49:36 +02:00
Patrick Boettcher
7daba70db3 cmake: use relative path to source-file
If this project is used via `add_subdirectory()` the
json-schema-test.cpp was not found.
2018-04-17 23:11:10 +02:00
Patrick Boettcher
c552c7c02a tests: add some issue-regression-tests 2018-03-30 12:26:52 +02:00
Patrick Boettcher
a5521b4b02 numbers: do not use (unsigned) int for numbers but always double
fixes #27
2018-03-30 11:25:44 +02:00
Patrick Boettcher
5f199477d4 Fix #22: update undefined-schema set after child-schema-insertation
It can well be that a child schema is including a grand-child-schema which
is considered undefined by a parent schema. Before this fix, this failed
because when the parent schema tried to insert the child-child-schema as
child-schema it was already present. Now this is fixed by updating
the undefined references after each schema insertion.
2018-03-07 19:30:54 +01:00
Ian Bell
7e8737e85d Fix preprocessor branches for dllimport 2018-03-01 13:28:22 +01:00
Patrick Boettcher
2a1f77d084 cmake: allow the building of shared or static libraries
Alternative for #15
2018-02-27 11:19:06 +01:00
Patrick Boettcher
6f69d01b58 use #include <nlohmann/json.hpp> to avoid filename clashes
alternative for #20
2018-02-27 11:11:55 +01:00
Ian Bell
95e07469ae Add a runnable and useful exampe 2018-02-24 09:33:05 +01:00
Patrick Boettcher
ad9e9923ab fix message if value is too low (minimum)
A value is rather "below" a minimum than "exceeding" it
2018-02-09 10:25:08 +01:00
Patrick Boettcher
0d50c716b6 deprecated: fix deprecated warning 2018-01-19 09:48:09 +01:00
Patrick Boettcher
990855cded cmake: make NLOHMANN_JSON_DIR a cache-variable for visibility 2018-01-19 09:39:33 +01:00
Patrick Boettcher
b1b5cb891c comment: fix comment regarding gcc 4.8/4.9 2018-01-19 09:39:07 +01:00
Patrick Boettcher
dda72a0023 compatibility: now it works with 3.x-release of nlohmann::json
The name conflict of json_pointer was fixed by renaming the one
from here to local_json_pointer. Ugly, but better fixes take time.
2018-01-19 09:38:50 +01:00
Ryan Ham
378105024e Change error message for "minItems".
The error message for "minItems" was the same as "maxItems". Change it to use the same verbiage as "minProperties".
2017-11-21 08:05:55 +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
Patrick Boettcher
a3a4cd2d56 schema-test: simplify filename resolution of test-suite 2017-08-08 15:36:59 +02:00
Patrick Boettcher
322d2751de cmake: better handling of how to find json.hpp 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
Antoine Havron
0de3d164d7 C++11 argument added in CmakeLists.txt 2017-04-11 08:16:30 +02:00
Patrick Boettcher
e327885992 cmake: if GCC-version is less than 4.9 print a status not a warning 2017-03-08 22:46:48 +01:00
Patrick Boettcher
dd2d95cf0a gcc-4.8: if less than 4.9 use boost::regex, if detected 2017-03-06 10:44:20 +01:00