|
@@ -94,6 +94,7 @@ private:
|
|
|
private:
|
|
private:
|
|
|
schema::Node accept_{true};
|
|
schema::Node accept_{true};
|
|
|
schema::Node reject_{false};
|
|
schema::Node reject_{false};
|
|
|
|
|
+
|
|
|
std::map<std::string, detail::Reference> anchors_;
|
|
std::map<std::string, detail::Reference> anchors_;
|
|
|
std::map<detail::Reference, schema::Node> cache_;
|
|
std::map<detail::Reference, schema::Node> cache_;
|
|
|
|
|
|
|
@@ -140,8 +141,7 @@ private:
|
|
|
|
|
|
|
|
template <Adapter A> schema::Node const * fetch_schema(ParserContext<A> const & context) {
|
|
template <Adapter A> schema::Node const * fetch_schema(ParserContext<A> const & context) {
|
|
|
adapter::Type const type = context.schema.type();
|
|
adapter::Type const type = context.schema.type();
|
|
|
- if (type == adapter::Type::Boolean) {
|
|
|
|
|
- // TODO(samjaffe): Legal Context...
|
|
|
|
|
|
|
+ if (type == adapter::Type::Boolean && context.version >= schema::Version::Draft06) {
|
|
|
return alias(context.where, context.schema.as_boolean() ? &accept_ : &reject_);
|
|
return alias(context.where, context.schema.as_boolean() ? &accept_ : &reject_);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -173,6 +173,10 @@ template <Adapter A> schema::Node const * ParserContext<A>::resolve(std::string_
|
|
|
template <Adapter A> schema::Node const * ParserContext<A>::node() const {
|
|
template <Adapter A> schema::Node const * ParserContext<A>::node() const {
|
|
|
return root.fetch_schema(*this);
|
|
return root.fetch_schema(*this);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+template <Adapter A> schema::Node const * ParserContext<A>::always() const {
|
|
|
|
|
+ return schema.as_boolean() ? &root.accept_ : &root.reject_;
|
|
|
|
|
+}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
namespace jvalidate::schema {
|
|
namespace jvalidate::schema {
|