MCPcopy Create free account
hub / github.com/pboettch/json-schema-validator / uri_format_checker

Function uri_format_checker

example/format.cpp:25–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23static json bad_uri = {{"myUri", "http:/hostname.com/"}};
24
25static void uri_format_checker(const std::string &format, const std::string &value)
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}
33
34int main()
35{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected