diff --git a/src/json-validator.cpp b/src/json-validator.cpp index 3ffd087..c7c5f75 100644 --- a/src/json-validator.cpp +++ b/src/json-validator.cpp @@ -179,7 +179,7 @@ public: auto fragment = new_uri.pointer(); // is there a reference looking for this unknown-keyword, which is thus no longer a unknown keyword but a schema - auto unresolved = file.unresolved.find(fragment); + auto unresolved = file.unresolved.find(fragment.to_string()); if (unresolved != file.unresolved.end()) schema::make(value, this, {}, {{new_uri}}); else { // no, nothing ref'd it, keep for later diff --git a/src/nlohmann/json-schema.hpp b/src/nlohmann/json-schema.hpp index ebe7cef..07befd3 100644 --- a/src/nlohmann/json-schema.hpp +++ b/src/nlohmann/json-schema.hpp @@ -61,7 +61,7 @@ protected: std::tuple as_tuple() const { - return std::make_tuple(urn_, scheme_, authority_, path_, identifier_ != "" ? identifier_ : pointer_); + return std::make_tuple(urn_, scheme_, authority_, path_, identifier_ != "" ? identifier_ : pointer_.to_string()); } public: @@ -80,7 +80,7 @@ public: std::string fragment() const { if (identifier_ == "") - return pointer_; + return pointer_.to_string(); else return identifier_; } diff --git a/test/binary-validation.cpp b/test/binary-validation.cpp index 01392cf..4a9c7ea 100644 --- a/test/binary-validation.cpp +++ b/test/binary-validation.cpp @@ -163,7 +163,7 @@ int main() val.set_root_schema(array_of_types_without_binary); val.validate({{"something", binary}}, err); EXPECT_EQ(err.failed_pointers.size(), 1); - EXPECT_EQ(err.failed_pointers[0], "/something"); + EXPECT_EQ(err.failed_pointers[0].to_string(), "/something"); err.reset(); // check that without content callback you get exception with schema with contentEncoding or contentMeditType diff --git a/test/uri.cpp b/test/uri.cpp index 9083cd3..38c81ee 100644 --- a/test/uri.cpp +++ b/test/uri.cpp @@ -75,11 +75,11 @@ static void pointer_plain_name(json_uri start, a = a.derive("#foo/looks_like_json/poiner/but/isnt"); EXPECT_EQ(a, full + " # foo/looks_like_json/poiner/but/isnt"); EXPECT_EQ(a.identifier(), "foo/looks_like_json/poiner/but/isnt"); - EXPECT_EQ(a.pointer(), ""); + EXPECT_EQ(a.pointer().to_string(), ""); a = a.derive("#/looks_like_json/poiner/and/it/is"); EXPECT_EQ(a, full + " # /looks_like_json/poiner/and/it/is"); - EXPECT_EQ(a.pointer(), "/looks_like_json/poiner/and/it/is"); + EXPECT_EQ(a.pointer().to_string(), "/looks_like_json/poiner/and/it/is"); EXPECT_EQ(a.identifier(), ""); }