For root value, use empty pointer
This commit is contained in:
parent
491ac44026
commit
59c9d6200b
@ -553,6 +553,9 @@ class type_schema : public schema
|
|||||||
else_->validate(ptr, instance, patch, e);
|
else_->validate(ptr, instance, patch, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (instance.is_null()) {
|
||||||
|
patch.add(nlohmann::json::json_pointer{}, default_value_);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -1134,6 +1137,11 @@ public:
|
|||||||
propertyNames_ = schema::make(attr.value(), root, {"propertyNames"}, uris);
|
propertyNames_ = schema::make(attr.value(), root, {"propertyNames"}, uris);
|
||||||
sch.erase(attr);
|
sch.erase(attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
attr = sch.find("default");
|
||||||
|
if (attr != sch.end()) {
|
||||||
|
set_default_value(*attr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user