Skip to content

Commit

Permalink
Fix jsonschema example
Browse files Browse the repository at this point in the history
  • Loading branch information
danielaparker committed Nov 5, 2024
1 parent de7f9f1 commit 3363572
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions doc/ref/jsonschema/jsonschema.md
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ namespace jsonschema = jsoncons::jsonschema;
// Until 0.174.0, throw a `schema_error` instead of returning json::null()
json resolver(const jsoncons::uri& uri)
{
std::cout << "uri: " << uri.string() << ", path: " << uri.path() << "\n\n";
std::cout << "base: " << uri.base() << ", path: " << uri.path() << "\n\n";

std::string pathname = "./input/jsonschema/";
pathname += std::string(uri.path());
Expand Down Expand Up @@ -431,8 +431,8 @@ int main()

auto reporter = [](const jsonschema::validation_message& msg) -> jsonschema::walk_result
{
std::cout << message.instance_location().string() << ": " << message.message() << "\n";
for (const auto& detail : message.details())
std::cout << msg.instance_location().string() << ": " << msg.message() << "\n";
for (const auto& detail : msg.details())
{
std::cout << " " << detail.message() << "\n";
}
Expand All @@ -450,7 +450,7 @@ int main()
```
Output:
```
uri: http://localhost:1234/draft2020-12/name-defs.json, path: /draft2020-12/name-defs.json
base: http://localhost:1234/draft2020-12/name-defs.json, path: /draft2020-12/name-defs.json

/name: Must be valid against at least one schema, but found no matching schemas
Expected null, found object
Expand Down

0 comments on commit 3363572

Please sign in to comment.