diff --git a/src/json-validator.cpp b/src/json-validator.cpp index 96fa626..8fc4b5a 100644 --- a/src/json-validator.cpp +++ b/src/json-validator.cpp @@ -1150,6 +1150,11 @@ void json_validator::set_root_schema(const json &schema) root_->set_root_schema(schema); } +void json_validator::set_root_schema(json &&schema) +{ + root_->set_root_schema(std::move(schema)); +} + void json_validator::validate(const json &instance) const { throwing_error_handler err; diff --git a/src/nlohmann/json-schema.hpp b/src/nlohmann/json-schema.hpp index 204f412..d6e0ede 100644 --- a/src/nlohmann/json-schema.hpp +++ b/src/nlohmann/json-schema.hpp @@ -176,6 +176,7 @@ public: // insert and set the root-schema void set_root_schema(const json &); + void set_root_schema(json &&); // validate a json-document based on the root-schema void validate(const json &) const;