2
3
4
5
6
7
8
10#include <nlohmann/json-schema.hpp>
19static void EXPECT_EQ(
const std::string &a,
const std::string &b)
22 std::cerr <<
"Failed: '" << a <<
"' != '" << b <<
"'\n";
33 const std::string &full,
34 const std::string &full_path,
35 const std::string &no_path)
49 EXPECT_EQ(d
, full_path +
"/subdir/subdir2/base.json # ");
62 const std::string &full,
63 const std::string &full_path,
64 const std::string &no_path)
75 a = a
.derive("#foo/looks_like_json/poiner/but/isnt");
76 EXPECT_EQ(a
, full +
" # foo/looks_like_json/poiner/but/isnt");
80 a = a
.derive("#/looks_like_json/poiner/and/it/is");
81 EXPECT_EQ(a
, full +
" # /looks_like_json/poiner/and/it/is");
94 json_uri http
("http://json-schema.org/draft-07/schema#");
96 "http://json-schema.org/draft-07/schema",
97 "http://json-schema.org/draft-07",
98 "http://json-schema.org");
101 "http://json-schema.org/draft-07/schema",
102 "http://json-schema.org/draft-07",
103 "http://json-schema.org");
const std::string & identifier() const
std::string to_string() const
json_uri(const std::string &uri)
const json::json_pointer & pointer() const
json_uri derive(const std::string &uri) const
static void EXPECT_EQ(const nlohmann::json_uri &a, const std::string &b)
static void pointer_plain_name(json_uri start, const std::string &full, const std::string &full_path, const std::string &no_path)
static void paths(json_uri start, const std::string &full, const std::string &full_path, const std::string &no_path)
static void EXPECT_EQ(const std::string &a, const std::string &b)