#include <iostream>
#include <nlohmann/json-schema.hpp>
Go to the source code of this file.
◆ main()
◆ uri_format_checker()
| void uri_format_checker |
( |
const std::string & | format, |
|
|
const std::string & | value ) |
|
static |
Definition at line 25 of file format.cpp.
26{
27 if (format == "uri") {
28 if (value.find("://") == std::string::npos)
29 throw std::invalid_argument("URI does not contain :// - invalid");
30 } else
31 throw std::logic_error("Don't know how to validate " + format);
32}
Referenced by main().
◆ bad_uri
| json bad_uri = {{"myUri", "http:/hostname.com/"}} |
|
static |
Definition at line 23 of file format.cpp.
23{{"myUri", "http:/hostname.com/"}};
Referenced by main().
◆ good_uri
| json good_uri = {{"myUri", "http://hostname.com/"}} |
|
static |
Definition at line 22 of file format.cpp.
22{{"myUri", "http://hostname.com/"}};
Referenced by main().
◆ uri_schema
Initial value:= R"(
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"myUri": {
"type":"string",
"format": "uri"
}
}
})"_json
Definition at line 9 of file format.cpp.
Referenced by main().