Use to_string() on json_pointer string conversions

This commit is contained in:
Sven Fink 2023-01-13 09:52:16 +01:00
parent c6cb3d4c2d
commit b2eaf73765
2 changed files with 5 additions and 5 deletions

View File

@ -171,7 +171,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
@ -884,8 +884,8 @@ class boolean : public schema
{
if (!true_) { // false schema
// empty array
//switch (instance.type()) {
//case json::value_t::array:
// switch (instance.type()) {
// case json::value_t::array:
// if (instance.size() != 0) // valid false-schema
// e.error(ptr, instance, "false-schema required empty array");
// return;

View File

@ -61,7 +61,7 @@ protected:
std::tuple<std::string, std::string, std::string, std::string, std::string> 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_;
}