|
|
@@ -31,19 +31,21 @@ public:
|
|
|
: schema_(schema), cfg_(cfg) {}
|
|
|
|
|
|
template <Adapter A>
|
|
|
- requires(not MutableAdapter<A>) Status
|
|
|
- validate(A const & json, ValidationResult * result = nullptr) {
|
|
|
+ requires(not MutableAdapter<A>) bool validate(A const & json,
|
|
|
+ ValidationResult * result = nullptr) {
|
|
|
EXPECT_M(not cfg_.construct_default_values,
|
|
|
"Cannot perform mutations on an immutable JSON Adapter");
|
|
|
- return ValidationVisitor<A, RE>(json, schema_, cfg_, regex_cache_, result).validate();
|
|
|
+ return static_cast<bool>(
|
|
|
+ ValidationVisitor<A, RE>(json, schema_, cfg_, regex_cache_, result).validate());
|
|
|
}
|
|
|
|
|
|
- template <MutableAdapter A> Status validate(A const & json, ValidationResult * result = nullptr) {
|
|
|
- return ValidationVisitor<A, RE>(json, schema_, cfg_, regex_cache_, result).validate();
|
|
|
+ template <MutableAdapter A> bool validate(A const & json, ValidationResult * result = nullptr) {
|
|
|
+ return static_cast<bool>(
|
|
|
+ ValidationVisitor<A, RE>(json, schema_, cfg_, regex_cache_, result).validate());
|
|
|
}
|
|
|
|
|
|
template <typename JSON>
|
|
|
- requires(not Adapter<JSON>) Status validate(JSON & json, ValidationResult * result = nullptr) {
|
|
|
+ requires(not Adapter<JSON>) bool validate(JSON & json, ValidationResult * result = nullptr) {
|
|
|
return validate(adapter::AdapterFor<JSON>(json), result);
|
|
|
}
|
|
|
};
|