|
@@ -76,6 +76,7 @@ template <Adapter Root, RegexEngine RE, typename ExtensionVisitor> class Validat
|
|
|
private:
|
|
private:
|
|
|
using VisitedAnnotation = std::tuple<std::unordered_set<size_t>, std::unordered_set<std::string>>;
|
|
using VisitedAnnotation = std::tuple<std::unordered_set<size_t>, std::unordered_set<std::string>>;
|
|
|
friend class ValidationVisitorTest;
|
|
friend class ValidationVisitorTest;
|
|
|
|
|
+ friend class constraint::Constraint;
|
|
|
|
|
|
|
|
private:
|
|
private:
|
|
|
detail::Pointer where_;
|
|
detail::Pointer where_;
|
|
@@ -708,8 +709,7 @@ public:
|
|
|
for (auto const & [key, p_constraint] : schema_->constraints()) {
|
|
for (auto const & [key, p_constraint] : schema_->constraints()) {
|
|
|
BREAK_EARLY_IF_NO_RESULT_TREE();
|
|
BREAK_EARLY_IF_NO_RESULT_TREE();
|
|
|
schema_path_ = current_schema / key;
|
|
schema_path_ = current_schema / key;
|
|
|
- rval &= std::visit([this, &document](auto & cons) { return this->visit(cons, document); },
|
|
|
|
|
- *p_constraint);
|
|
|
|
|
|
|
+ rval &= p_constraint->visit(*this, document);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Post Constraints represent the unevaluatedItems and unevaluatedProperties
|
|
// Post Constraints represent the unevaluatedItems and unevaluatedProperties
|
|
@@ -717,8 +717,7 @@ public:
|
|
|
for (auto const & [key, p_constraint] : schema_->post_constraints()) {
|
|
for (auto const & [key, p_constraint] : schema_->post_constraints()) {
|
|
|
BREAK_EARLY_IF_NO_RESULT_TREE();
|
|
BREAK_EARLY_IF_NO_RESULT_TREE();
|
|
|
schema_path_ = current_schema / key;
|
|
schema_path_ = current_schema / key;
|
|
|
- rval &= std::visit([this, &document](auto & cons) { return this->visit(cons, document); },
|
|
|
|
|
- *p_constraint);
|
|
|
|
|
|
|
+ rval &= p_constraint->visit(*this, document);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
(result_ ? result_->valid(where_, current_schema, static_cast<bool>(rval)) : void());
|
|
(result_ ? result_->valid(where_, current_schema, static_cast<bool>(rval)) : void());
|
|
@@ -792,8 +791,7 @@ public:
|
|
|
if (schema::Node const * const * ppschema = std::get_if<0>(&subschema)) {
|
|
if (schema::Node const * const * ppschema = std::get_if<0>(&subschema)) {
|
|
|
return validate_subschema(*ppschema, document, keys...);
|
|
return validate_subschema(*ppschema, document, keys...);
|
|
|
}
|
|
}
|
|
|
- return std::visit([this, &document](auto & cons) { return this->visit(cons, document); },
|
|
|
|
|
- *std::get<1>(subschema));
|
|
|
|
|
|
|
+ return std::get<1>(subschema)->visit(*this, document);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|