Commit Graph

292 Commits

Author SHA1 Message Date
Tristan Penman
fba5a9e8a7 Reject JSON references that index into empty arrays 2021-01-17 13:34:52 +11:00
Brian Sipos
cbcde15c0b Possible fix for #118 2021-01-12 13:12:57 -05:00
Tristan Penman
3621f98d43 Update rapidjson_utils.hpp to use iterative parsing 2021-01-07 21:34:51 +11:00
Jordan Bayles
1f964c1299 Fix memory leak in concrete constraints
This patch fixes a memory leak found from ASAN testing. There may be
more here, but this is the only one blocking our workflow.
2020-12-02 11:16:41 -08:00
Tristan Penman
c1e75c700f
Merge pull request #110 from baylesj/remote_throws
Add VALIJSON_USE_EXCEPTIONS mode
2020-11-09 16:51:19 +11:00
Jordan Bayles
bc81adbd3f add version checks around BOOST_NORETURN 2020-11-08 21:40:01 -08:00
Jordan Bayles
7a560db2ed Fixup headers
This patch removes the include for boost's internal suffix.hpp header,
in favor of just including the throw_exception.hpp header.
2020-11-08 21:21:54 -08:00
Jordan Bayles
b8e9581057 Apply feedback, add boost version check 2020-11-08 19:54:53 -08:00
Jordan Bayles
f100614249 Cleanup unnecessary returns 2020-11-08 17:04:52 -08:00
Jordan Bayles
a30ef97465 Add VALIJSON_USE_EXCEPTIONS mode
This patch adds support for a new Cmake option,
VALIJSON_USE_EXCEPTIONS. If specified and set to `0`, Valijson will
disable all exception throwing, add the `-fno-exceptions` compiler flag,
and print to std::err and abort where exceptions would have been thrown.

NOTE: to set the value of a CMake option, the easiest way is to modify
the appropriate source line in the <build folder>/CMakeCache.txt file.

Bug: #106
2020-11-08 16:58:32 -08:00
Joshua Eckroth
bbfc3f5c97 Fixed build on certain GCC toolchains 2020-11-08 11:43:37 +11:00
Tristan Penman
90783ca4be Minor code style changes 2020-11-08 11:38:52 +11:00
Samuel
d5091b2dbb added feature : now users can get a detailed error message when if-then-else conditional constraints are not met 2020-10-07 20:16:30 +09:00
Tristan Penman
89e37cbf42 Fix typo 2020-09-04 20:53:29 +10:00
Tristan Penman
7f01c39116 Minor suggestions from clangtidy 2020-09-04 20:47:38 +10:00
Joshua Eckroth
ccad6b140f Switched from jsoncpp deprecated Reader to CharReader 2020-08-06 06:57:20 +00:00
Tristan Penman
0ee3bada09 Fix broken build 2020-07-17 17:20:11 +10:00
Tristan Penman
bbe62ecd7d
Merge pull request #95 from wirenboard/feature/cache-regex
Regex objects cache for pattern constraints
2020-07-17 16:59:47 +10:00
pete
39f350692c Regex objects cache for pattern constraints 2020-07-15 17:09:18 +05:00
pete
2216c2b8b3 Pass visitor to validationCallback by ref 2020-07-15 16:43:46 +05:00
Delgan
1c825cc638 Remove unused parameters instead of commenting them out 2020-07-15 10:06:16 +02:00
Delgan
ca031221fc Fix compilation errors due to unused parameters 2020-07-15 09:44:44 +02:00
Tristan Penman
d453ee2ed4 Revert breaking changes to jsoncpp_adapter.hpp 2020-07-06 19:55:07 +10:00
Tristan Penman
f3a0390e17 Revert changes to json11_adapter.hpp 2020-07-06 19:50:10 +10:00
Tristan Penman
49c20301ed Disable -Wshadow for included header in property_tree_utils.hpp 2020-07-06 19:46:31 +10:00
Tristan Penman
77d2ef8299 Cosmetic improvements for poco_json_adapter.hpp and property_tree_adapter.hpp 2020-07-06 12:48:55 +10:00
Tristan Penman
8c0d16a068 Cosmetic improvements for std_string_adapter.hpp, test_json_pointer.cpp and test_poly_constraint.cpp 2020-07-06 11:47:58 +10:00
Tristan Penman
217b990b00 Cosmetic improvements for schema_parser.hpp and validation_results.hpp 2020-07-06 11:30:41 +10:00
Tristan Penman
71f4cdaa84 Cosmetic improvements for custom_allocator.hpp 2020-07-06 11:03:11 +10:00
Tristan Penman
e46af24588 Cosmetic improvements for concrete_constraints.hpp and basic_constraint.hpp 2020-07-06 09:16:40 +10:00
Tristan Penman
7917b2f75f Cosmetic improvements for schema.hpp, schema_parser.hpp and subschema.hpp 2020-07-05 22:38:47 +10:00
Tristan Penman
28cc9e8eeb Cosmetic improvements for qtjson_adapter.hpp 2020-07-05 22:11:01 +10:00
Tristan Penman
508bc019ec Cosmetic improvements for rapidjson_adapter.hpp 2020-07-05 22:02:55 +10:00
Tristan Penman
d7901d4858 Cosmetics improvements for picojson_adapter.hpp 2020-07-05 21:49:11 +10:00
Tristan Penman
3211a04dd1 Cosmetic improvements for nlohmann_json_adapter.hpp 2020-07-05 21:43:10 +10:00
Tristan Penman
0f57cb31bc Cosmetic improvements for jsoncpp_adapter.hpp 2020-07-05 21:37:03 +10:00
Tristan Penman
e11c17c3f0 Cosmetic improvements for json11_adapter.hpp 2020-07-05 21:10:26 +10:00
Tristan Penman
6f1f4acb82 Cosmetic improvements for basic_adapter.hpp 2020-07-05 20:31:47 +10:00
Tristan Penman
3ddbe585ba Cosmetic improvements for validation_visitor.hpp 2020-07-05 20:21:17 +10:00
Tristan Penman
0481a0bb69 Minor tidy up of const auto usage 2020-06-28 12:39:50 +10:00
Silver Kuusik
622f9d6839
Add QJsonArray include to use doc.array()
* otherwise invalid use of incomplete type 'class QJsonArray'
2020-06-10 06:18:58 +02:00
Silver Kuusik
4e1b3be88e
Add missing include for DerefProxy 2020-06-08 23:00:21 +02:00
Tristan Penman
aa0f766b03 Merge branch 'master' of github.com:tristanpenman/valijson 2020-06-03 19:56:37 +10:00
Tristan Penman
8febb456f4 Merge remote-tracking branch 'origin/master' into v6-and-v7-support 2020-06-03 19:54:48 +10:00
myxo
8866e6da24 Fix warning C4244 on x86 target
Warning message: "warning C4244: '=': conversion from 'uint64_t' to 'std::size_t'"
2020-02-04 16:08:50 +03:00
Cédric CARRÉE
4338affeb3 Fix bad iterator comparaison when resolving json pointer
When resolving a json pointer and use an empty string as a
referenceToken, the value is coerced as an empty object and a temporary empty
object is returned from 'asObject()'. Then we used to compare 2
iterators from 2 differents temporary empty objects.
2020-01-07 16:36:56 +01:00
Tristan Penman
42cdb3f5b3 Add file-level documentation to std_string_adapter.hpp 2019-10-10 13:32:16 +11:00
Tristan Penman
6287656e2b Implement propertyNames constraint 2019-10-10 13:23:42 +11:00
Tristan Penman
dcddea604d Add StdStringAdapter to support propertyNames constraint 2019-10-10 13:22:51 +11:00
Tristan Penman
bae7991fda Update some old-style for loops 2019-10-09 21:42:36 +11:00
Tristan Penman
05bd44744f Change default draft version 2019-10-09 21:22:36 +11:00
Tristan Penman
caf5543402 Rename internal function for consistency 2019-09-26 10:59:36 +10:00
Tristan Penman
5f8c73fdf7 Update 'dependencies' constraint to pass v7 tests 2019-09-24 21:46:03 +10:00
Tristan Penman
5430e79754 Update 'required' constraint to match v7 tests 2019-09-24 21:22:15 +10:00
Tristan Penman
98d804a367 Add support for const constraint 2019-09-24 20:38:45 +10:00
Tristan Penman
caff3cdbd9 Fix up comments 2019-09-24 20:13:46 +10:00
Tristan Penman
c4f15c92cc Replace NULL with nullptr in schema_parser.hpp 2019-09-24 14:12:03 +10:00
Tristan Penman
f71355b90f Add support for 'contains' constraint 2019-09-24 14:08:45 +10:00
Delgan
1e6a8c778f
Add the name of the unexpected object's property to the corresponding error message 2019-09-10 21:22:51 +02:00
Tristan Penman
ba44a8d641 Replace NULLs with nullptr in validation_visitor.hpp 2019-09-03 21:38:08 +10:00
Tristan Penman
866f5761bf Improve support for boolean subschemas 2019-08-31 21:37:55 +10:00
Tristan Penman
c210d07c61 Update AllOfConstraint and AnyOfConstraint to support draft 7 2019-08-30 10:33:56 +10:00
Tristan Penman
9b299c9517 Fix issues in parsing of if/then/else constraints 2019-08-29 22:18:04 +10:00
Tristan Penman
ef61c8e0de Support for draft 7 exclusiveMaximum and exclusiveMinimum constraints 2019-08-29 21:34:22 +10:00
Tristan Penman
925ff8ff68 Initial support for 'if', 'then' and 'else' subschemas 2019-08-29 10:31:37 +10:00
Tristan Penman
dac4cff42f Whitespace fixes 2019-08-28 21:27:45 +10:00
Tristan Penman
c8dfd94035 Merge remote-tracking branch 'origin/master' into v6-and-v7-support 2019-08-27 12:38:34 +10:00
Tristan Penman
d3a560d329 Remove non-pragma header guards, and cleanup whitespace 2019-08-27 12:32:47 +10:00
Tristan Penman
d0f67e4afc Remove old header inclusion guards 2019-08-22 22:19:09 +10:00
Tristan Penman
162f246e63 Add placeholders for conditional constraint 2019-08-22 22:12:40 +10:00
Tristan Penman
c19a02bff0
Merge pull request #69 from drdavella/use-maybe
Fix places in adapter implementation where non-strict checks should be used
2019-08-20 10:44:22 +10:00
Daniel D'Avella
25c5a5df51 Fix instances in basic_adapter that should use maybe 2018-09-06 09:13:12 -04:00
Daniel D'Avella
d23f4047ed Fix instances in schema_parser.hpp that should use maybe* 2018-09-06 09:13:12 -04:00
Daniel D'Avella
67efb56b2c Allow findAbsoluteDocumentUri to be overridden by subclasses of SchemaParser 2018-08-28 13:41:22 -04:00
Tristan Penman
c2f22fddf5 Minor change to internal/optional.hp so that __has_include is used only if __cplusplus >= 201703 2018-08-02 12:07:51 +10:00
Tristan Penman
d91991c2d1 Whitespace corrections for schema_parser.hpp 2018-08-01 14:43:40 +10:00
Tristan Penman
69b2bec157 Produce a more useful error message when attempting to parse a schema from a JSON value that is not an object 2018-08-01 14:39:43 +10:00
Tristan Penman
d9c4f22f30 Address std::allocator deprecation warning in custom_allocator.hpp 2018-03-08 11:10:39 +11:00
Andrij Abyzov
c9fe25907f
Fix compilation warning on 32-bit systems.
On 32-bit systems size_t is a 32-bit type which causes the following warning:
warning: large integer implicitly truncated to unsigned type [-Woverflow]

There's no reason have size_t storage variable for uint64_t accessors.
2018-03-07 16:23:38 +01:00
Tristan Penman
4be2a79a37 Merge pull request #51 from falstaff84/fix-oneof-anyof
Make sure that errors from failed 'oneOf' or 'anyOf' constraint check…
2017-09-24 09:03:12 +10:00
Charles Francoise
3b67951a74 fix compilation for clang libc++ 3.8.0 2017-09-22 17:47:13 +02:00
Stefan Agner
cf50f63665 Make sure that errors from failed 'oneOf' or 'anyOf' constraint checks do not appear in error list 2017-08-04 21:03:26 -07:00
Tristan Penman
64abe842b8 Only call fetchDoc if actual document URI is equal to current scope as set using 'id' attribute 2017-07-10 12:51:20 +10:00
Valeriy Bykov
26e16f9cad Compile with gcc-7.1.0 2017-06-14 19:55:33 +03:00
Valeriy Bykov
20ea506b31 Include <optional> from dedicated file optional.hpp 2017-06-14 19:54:22 +03:00
Tristan Penman
c08413d010 Fix exception type and error message in poco_json_utils.hpp 2017-05-31 15:05:42 +10:00
drewxa
e943e3ef94 add poco json adapter
* new adapter
* util
* tests
2017-05-24 15:36:50 +03:00
plamot
2c0477c30a qtjson utils and tests update 2017-03-27 01:20:24 +02:00
plamot
51c916c029 Provide proper implementation of isInteger for qtjson 2017-03-22 00:38:26 +01:00
Pierre Lamot
b8b2634ad6 add support for Qt Json parser
http://doc.qt.io/qt-5/json.html
2017-03-06 16:38:02 +01:00
JustCameToHelp
e3ac11e52b Corrected reporting of array indices violating uniqueItems constraint. 2017-01-29 13:40:13 +01:00
Tristan Penman
22bf9f2278 Add explicit qualifier to single-argument FrozenValue constructors 2016-11-07 23:01:13 -08:00
Tristan Penman
032a8bdcf2 Remove unused variable from nlohmann_json_utils.hpp 2016-11-07 23:00:25 -08:00
Tristan Penman
187c66d06c Add missing return statement to CustomAllocator::operator= 2016-11-07 22:58:58 -08:00
Tristan Penman
c5f2852029 Merge pull request #34 from iterion/topic/add-iterator-accessor
Add iterator accessors to ValidationResult class
2016-11-07 21:21:07 -08:00
Adam Sunderland
bc8120f531 Add iterator accessor
Move iterators to results class
2016-11-07 17:13:03 -06:00
Tristan Penman
c04b82c47a Remove unnecessary destructor from ValidationResults class 2016-11-04 09:04:36 -07:00
Adam Sunderland
b4940a6e91 Add #include cstring 2016-10-31 12:21:56 -05:00
Martin Robinson
2e9d147c99 Added an empty virtual destructor to the ConstraintVisitor class. 2016-09-13 10:23:07 +01:00
Nicolas Witczak
8adbe3e959 Using std::function instead of function pointer in type FunctionPtrs 2016-09-12 10:19:07 +02:00