|
@@ -625,7 +625,11 @@ public:
|
|
|
// constraints. This is enforced in the parsing of the schema, rather than
|
|
// constraints. This is enforced in the parsing of the schema, rather than
|
|
|
// during validation {@see jvalidate::schema::Node::construct}.
|
|
// during validation {@see jvalidate::schema::Node::construct}.
|
|
|
if (std::optional<schema::Node const *> ref = schema_->reference_schema()) {
|
|
if (std::optional<schema::Node const *> ref = schema_->reference_schema()) {
|
|
|
- rval = validate_subschema(*ref, document, "$ref");
|
|
|
|
|
|
|
+ if (schema_path_.empty() || schema_path_.back() != "$ref") {
|
|
|
|
|
+ rval = validate_subschema(*ref, document, "$ref");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ rval = validate_subschema(*ref, document);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (result_ && !schema_->description().empty()) {
|
|
if (result_ && !schema_->description().empty()) {
|