diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml.off similarity index 100% rename from .github/workflows/clang-tidy.yml rename to .github/workflows/clang-tidy.yml.off diff --git a/.github/workflows/macos.yml.bak b/.github/workflows/macos.yml similarity index 100% rename from .github/workflows/macos.yml.bak rename to .github/workflows/macos.yml diff --git a/.github/workflows/ubuntu.yml.bak b/.github/workflows/ubuntu.yml similarity index 100% rename from .github/workflows/ubuntu.yml.bak rename to .github/workflows/ubuntu.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 38078a2cf2..5cb0dcc778 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,8 @@ to `bignum_format_kind::raw`. Rationale: `bigint_chars_format` was misnamed, as it applied to `bigdec` as well as `bigint` numbers, and defaulting to `bigint_chars_format::base10` produced surprising results for users of our lossless number option. + - The URI argument passed to the jsonschema ResolveURI function object now included the fragment part of the URI. + - Fixed bugs: - Git Issue #554: [jsonpath] evaluation throws on json containing json_const_pointer diff --git a/doc/ref/jsonschema/jsonschema.md b/doc/ref/jsonschema/jsonschema.md index a3968f0304..166d9e7b94 100644 --- a/doc/ref/jsonschema/jsonschema.md +++ b/doc/ref/jsonschema/jsonschema.md @@ -392,11 +392,11 @@ second schema defined in an external file, `name-defs.json`, } ``` -jsoncons allows you to write a resolve function object to handle the URI +jsoncons allows you to write a resolver function object to handle the URI of the external file and translate it into a physical pathname. ```cpp -auto resolve = [](const jsoncons::uri& uri) -> json +auto resolver = [](const jsoncons::uri& uri) -> json { std::cout << "Requested URI: " << uri.string() << "\n"; std::cout << "base: " << uri.base().string() << ", path: " << uri.path() << "\n\n"; @@ -435,9 +435,9 @@ int main() try { // Throws schema_error if JSON Schema compilation fails - jsonschema::json_schema compiled = jsonschema::make_json_schema(schema, resolve); + jsonschema::json_schema compiled = jsonschema::make_json_schema(schema, resolver); - auto report = [](const jsonschema::validation_message& msg) -> jsonschema::walk_result + auto reporter = [](const jsonschema::validation_message& msg) -> jsonschema::walk_result { std::cout << msg.instance_location().string() << ": " << msg.message() << "\n"; for (const auto& detail : msg.details()) @@ -447,8 +447,8 @@ int main() return jsonschema::walk_result::advance; }; - // Will call report function object for each schema violation - compiled.validate(data, report); + // Will call the message handler function object for each schema violation + compiled.validate(data, reporter); } catch (const std::exception& e) { @@ -636,7 +636,7 @@ int main() json data = json::parse("{}"); // will throw schema_error if JSON Schema compilation fails - jsonschema::json_schema compiled = jsonschema::make_json_schema(schema, resolve); + jsonschema::json_schema compiled = jsonschema::make_json_schema(schema); // will throw a validation_error when a schema violation happens json patch; diff --git a/doc/ref/jsonschema/make_json_schema.md b/doc/ref/jsonschema/make_json_schema.md index 832fea1678..46823e52a7 100644 --- a/doc/ref/jsonschema/make_json_schema.md +++ b/doc/ref/jsonschema/make_json_schema.md @@ -11,14 +11,14 @@ template json_schema make_json_schema(Json sch, (since 0.175.0) evaluation_options options = evaluation_options{}); -template +template json_schema make_json_schema(const Json& sch, (until 0.175.0) - const ResolveURI& resolve, + const URIResolver& resolver, evaluation_options options = evaluation_options{}); (2) -template +template json_schema make_json_schema(Json sch, (since 0.175.0) - const ResolveURI& resolve, + const URIResolver& resolver, evaluation_options options = evaluation_options{}); template @@ -31,16 +31,16 @@ json_schema make_json_schema(Json sch, (since 0.175 const std::string& retrieval_uri, evaluation_options options = evaluation_options{}); -template +template json_schema make_json_schema(const Json& sch, (until 0.175.0) const std::string& retrieval_uri, - const ResolveURI& resolve, + const URIResolver& resolver, evaluation_options options = evaluation_options{}); (4) -template +template json_schema make_json_schema(Json sch, (since 0.175.0) const std::string& retrieval_uri, - const ResolveURI& resolve, + const URIResolver& resolver, evaluation_options options = evaluation_options{}); ``` @@ -54,8 +54,8 @@ Returns a [json_schema](json_schema.md) that represents a compiled JSON Sc JSON Schema - resolve - A function object with the signature of resolve being equivalent to + resolver + A function object with the signature of resolver being equivalent to
     Json fun(const jsoncons::uri& uri);
If unable to resolve the resource, it should return Json::null(). diff --git a/doc/ref/jsonschema/make_schema.md b/doc/ref/jsonschema/make_schema.md index 50735b0540..9ca233c7d1 100644 --- a/doc/ref/jsonschema/make_schema.md +++ b/doc/ref/jsonschema/make_schema.md @@ -12,13 +12,13 @@ template std::shared_ptr> make_schema(const Json& schema, const std::string& retrieval_uri); (2) (since 0.173.0) -template +template std::shared_ptr> make_schema(const Json& schema, - const std::string& retrieval_uri, const ResolveURI& resolve); (3) (since 0.173.0) + const std::string& retrieval_uri, const URIResolver& resolver); (3) (since 0.173.0) -template +template std::shared_ptr> make_schema(const Json& schema, - const ResolveURI& resolve); (4) + const URIResolver& resolver); (4) ``` Returns a `shared_ptr` to a `json_schema`. @@ -31,7 +31,7 @@ Returns a `shared_ptr` to a `json_schema`. JSON Schema - resolve + resolver A function object with the signature of resolver being equivalent to
     Json fun(const jsoncons::uri& uri);
diff --git a/examples/src/jsonschema_examples.cpp b/examples/src/jsonschema_examples.cpp index f318d6fad6..68a4b9851c 100644 --- a/examples/src/jsonschema_examples.cpp +++ b/examples/src/jsonschema_examples.cpp @@ -121,7 +121,7 @@ void resolve_uri_example() } )"; - auto resolve = [](const jsoncons::uri& uri) -> json + auto resolver = [](const jsoncons::uri& uri) -> json { std::cout << "Requested URI: " << uri.string() << "\n"; std::cout << "base: " << uri.base().string() << ", path: " << uri.path() << "\n\n"; @@ -151,7 +151,7 @@ void resolve_uri_example() try { // Throws schema_error if JSON Schema compilation fails - jsonschema::json_schema compiled = jsonschema::make_json_schema(schema, resolve); + jsonschema::json_schema compiled = jsonschema::make_json_schema(schema, resolver); auto report = [](const jsonschema::validation_message& msg) -> jsonschema::walk_result { diff --git a/include/jsoncons_ext/cbor/cbor_encoder.hpp b/include/jsoncons_ext/cbor/cbor_encoder.hpp index 96774f8371..5a9b5a9b00 100644 --- a/include/jsoncons_ext/cbor/cbor_encoder.hpp +++ b/include/jsoncons_ext/cbor/cbor_encoder.hpp @@ -1529,7 +1529,7 @@ class basic_cbor_encoder final : public basic_json_visitor else { bool more = this->begin_array(data.size(), semantic_tag::none,context, ec); - for (auto p = data.begin(); more && p != data.end(); ++p) + for (const auto* p = data.begin(); more && p != data.end(); ++p) { more = this->double_value(*p,semantic_tag::none,context, ec); } @@ -1556,19 +1556,17 @@ class basic_cbor_encoder final : public basic_json_visitor write_byte_string_value(byte_string_view(v)); return true; } - else + + bool more = this->begin_array(data.size(), semantic_tag::none,context, ec); + for (auto p = data.begin(); more && p != data.end(); ++p) { - bool more = this->begin_array(data.size(), semantic_tag::none,context, ec); - for (auto p = data.begin(); more && p != data.end(); ++p) - { - more = this->double_value(*p,semantic_tag::none,context, ec); - } - if (more) - { - more = this->end_array(context, ec); - } - return more; + more = this->double_value(*p,semantic_tag::none,context, ec); } + if (more) + { + more = this->end_array(context, ec); + } + return more; } /* bool visit_typed_array(const jsoncons::span&, diff --git a/include/jsoncons_ext/cbor/cbor_parser.hpp b/include/jsoncons_ext/cbor/cbor_parser.hpp index b31c3c9e36..36e012c87f 100644 --- a/include/jsoncons_ext/cbor/cbor_parser.hpp +++ b/include/jsoncons_ext/cbor/cbor_parser.hpp @@ -41,6 +41,8 @@ struct parse_state parse_state(const parse_state&) = default; parse_state(parse_state&&) = default; + parse_state& operator=(const parse_state&) = default; + parse_state& operator=(parse_state&&) = default; ~parse_state() = default; }; @@ -89,9 +91,11 @@ class basic_cbor_parser : public ser_context } mapped_string(const mapped_string&) = default; - mapped_string(mapped_string&&) noexcept = default; + mapped_string& operator=(const mapped_string&) = default; + mapped_string& operator=(mapped_string&&) noexcept = default; + mapped_string(const mapped_string& other, const allocator_type& alloc) : type(other.type), str(other.str,alloc), bytes(other.bytes,alloc) { @@ -102,9 +106,7 @@ class basic_cbor_parser : public ser_context { } - mapped_string& operator=(const mapped_string&) = default; - - mapped_string& operator=(mapped_string&&) = default; + ~mapped_string() = default; }; using mapped_string_allocator_type = typename std::allocator_traits:: template rebind_alloc; @@ -122,8 +124,8 @@ class basic_cbor_parser : public ser_context Source source_; cbor_decode_options options_; - bool more_; - bool done_; + bool more_{true}; + bool done_{false}; string_type text_buffer_; byte_string_type bytes_buffer_; uint64_t item_tag_; @@ -177,8 +179,6 @@ class basic_cbor_parser : public ser_context : alloc_(alloc), source_(std::forward(source)), options_(options), - more_(true), - done_(false), text_buffer_(alloc), bytes_buffer_(alloc), item_tag_(0), @@ -190,6 +190,13 @@ class basic_cbor_parser : public ser_context { state_stack_.emplace_back(parse_mode::root,0); } + + basic_cbor_parser(const basic_cbor_parser&) = delete; + basic_cbor_parser(basic_cbor_parser&&) = delete; + basic_cbor_parser& operator=(const basic_cbor_parser&) = delete; + basic_cbor_parser& operator=(basic_cbor_parser&&) = delete; + + ~basic_cbor_parser() = default; void restart() { diff --git a/include/jsoncons_ext/jsonschema/common/schema_builder.hpp b/include/jsoncons_ext/jsonschema/common/schema_builder.hpp index 64d02b3a5a..f3b70f57aa 100644 --- a/include/jsoncons_ext/jsonschema/common/schema_builder.hpp +++ b/include/jsoncons_ext/jsonschema/common/schema_builder.hpp @@ -353,7 +353,7 @@ namespace jsonschema { uri schema_location = context.make_schema_location("maxLength"); if (!sch.is_number()) { - std::string message("maxLength must be a number value"); + const std::string message("maxLength must be a number value"); JSONCONS_THROW(schema_error(schema_location.string() + ": " + message)); } auto value = sch.template as(); @@ -366,7 +366,7 @@ namespace jsonschema { uri schema_location = context.make_schema_location("minLength"); if (!sch.is_number()) { - std::string message("minLength must be an integer value"); + const std::string message("minLength must be an integer value"); JSONCONS_THROW(schema_error(schema_location.string() + ": " + message)); } auto value = sch.template as(); @@ -409,7 +409,7 @@ namespace jsonschema { uri schema_location = context.make_schema_location("maximum"); if (!sch.is_number()) { - std::string message("maximum must be a number value"); + const std::string message("maximum must be a number value"); JSONCONS_THROW(schema_error(schema_location.string() + ": " + message)); } return jsoncons::make_unique>(parent, schema_location, sch); @@ -421,7 +421,7 @@ namespace jsonschema { uri schema_location = context.make_schema_location("exclusiveMaximum"); if (!sch.is_number()) { - std::string message("exclusiveMaximum must be a number value"); + const std::string message("exclusiveMaximum must be a number value"); JSONCONS_THROW(schema_error(schema_location.string() + ": " + message)); } return jsoncons::make_unique>(parent, schema_location, sch); @@ -434,7 +434,7 @@ namespace jsonschema { if (!sch.is_number()) { - std::string message("minimum must be an integer"); + const std::string message("minimum must be an integer"); JSONCONS_THROW(schema_error(schema_location.string() + ": " + message)); } return jsoncons::make_unique>(parent, schema_location, sch); @@ -446,7 +446,7 @@ namespace jsonschema { uri schema_location = context.make_schema_location("exclusiveMinimum"); if (!sch.is_number()) { - std::string message("exclusiveMinimum must be a number value"); + const std::string message("exclusiveMinimum must be a number value"); JSONCONS_THROW(schema_error(schema_location.string() + ": " + message)); } return jsoncons::make_unique>(parent, schema_location, sch); @@ -458,7 +458,7 @@ namespace jsonschema { uri schema_location = context.make_schema_location("multipleOf"); if (!sch.is_number()) { - std::string message("multipleOf must be a number value"); + const std::string message("multipleOf must be a number value"); JSONCONS_THROW(schema_error(schema_location.string() + ": " + message)); } auto value = sch.template as(); @@ -559,7 +559,7 @@ namespace jsonschema { uri schema_location = context.make_schema_location("contentEncoding"); if (!sch.is_string()) { - std::string message("contentEncoding must be a string"); + const std::string message("contentEncoding must be a string"); JSONCONS_THROW(schema_error(schema_location.string() + ": " + message)); } auto value = sch.template as(); @@ -572,7 +572,7 @@ namespace jsonschema { uri schema_location = context.make_schema_location("contentMediaType"); if (!sch.is_string()) { - std::string message("contentMediaType must be a string"); + const std::string message("contentMediaType must be a string"); JSONCONS_THROW(schema_error(schema_location.string() + ": " + message)); } @@ -582,7 +582,7 @@ namespace jsonschema { { if (!it->value().is_string()) { - std::string message("contentEncoding must be a string"); + const std::string message("contentEncoding must be a string"); JSONCONS_THROW(schema_error(schema_location.string() + ": " + message)); } @@ -671,7 +671,7 @@ namespace jsonschema { uri schema_location = context.make_schema_location("maxItems"); if (!sch.is_number()) { - std::string message("maxItems must be a number value"); + const std::string message("maxItems must be a number value"); JSONCONS_THROW(schema_error(schema_location.string() + ": " + message)); } auto value = sch.template as(); @@ -684,7 +684,7 @@ namespace jsonschema { uri schema_location = context.make_schema_location("minItems"); if (!sch.is_number()) { - std::string message("minItems must be a number value"); + const std::string message("minItems must be a number value"); JSONCONS_THROW(schema_error(schema_location.string() + ": " + message)); } auto value = sch.template as(); @@ -697,7 +697,7 @@ namespace jsonschema { uri schema_location = context.make_schema_location("maxProperties"); if (!sch.is_number()) { - std::string message("maxProperties must be a number value"); + const std::string message("maxProperties must be a number value"); JSONCONS_THROW(schema_error(schema_location.string() + ": " + message)); } auto value = sch.template as(); @@ -710,7 +710,7 @@ namespace jsonschema { uri schema_location = context.make_schema_location("minProperties"); if (!sch.is_number()) { - std::string message("minProperties must be a number value"); + const std::string message("minProperties must be a number value"); JSONCONS_THROW(schema_error(schema_location.string() + ": " + message)); } auto value = sch.template as(); diff --git a/include/jsoncons_ext/jsonschema/draft4/schema_builder_4.hpp b/include/jsoncons_ext/jsonschema/draft4/schema_builder_4.hpp index bf7d5e6382..4edf519a12 100644 --- a/include/jsoncons_ext/jsonschema/draft4/schema_builder_4.hpp +++ b/include/jsoncons_ext/jsonschema/draft4/schema_builder_4.hpp @@ -303,7 +303,7 @@ namespace draft4 { uri schema_location = context.make_schema_location("maximum"); if (!sch.is_number()) { - std::string message("maximum must be a number value"); + const std::string message("maximum must be a number value"); JSONCONS_THROW(schema_error(message)); } @@ -334,7 +334,7 @@ namespace draft4 { if (!sch.is_number()) { - std::string message("minimum must be an integer"); + const std::string message("minimum must be an integer"); JSONCONS_THROW(schema_error(message)); } diff --git a/include/jsoncons_ext/jsonschema/json_schema_factory.hpp b/include/jsoncons_ext/jsonschema/json_schema_factory.hpp index ec2509b38d..eed2e66148 100644 --- a/include/jsoncons_ext/jsonschema/json_schema_factory.hpp +++ b/include/jsoncons_ext/jsonschema/json_schema_factory.hpp @@ -206,9 +206,9 @@ namespace jsonschema { } } - template - typename std::enable_if::value,json_schema>::type - make_json_schema(Json sch, const std::string& retrieval_uri, const ResolveURI& resolve, + template + typename std::enable_if::value,json_schema>::type + make_json_schema(Json sch, const std::string& retrieval_uri, const URIResolver& resolver, evaluation_options options = evaluation_options{}) { using schema_store_type = std::map*>; @@ -216,7 +216,7 @@ namespace jsonschema { schema_builder_factory builder_factory{}; std::unordered_map vocabulary{}; - std::vector> resolve_funcs = {{meta_resolver, resolve}}; + std::vector> resolve_funcs = {{meta_resolver, resolver}}; auto schema_builder = builder_factory(std::move(sch), options, &schema_store, resolve_funcs, vocabulary); schema_builder->build_schema(retrieval_uri); @@ -239,9 +239,9 @@ namespace jsonschema { return json_schema(schema_builder->get_schema_validator()); } - template - typename std::enable_if::value,json_schema>::type - make_json_schema(Json sch, const ResolveURI& resolve, + template + typename std::enable_if::value,json_schema>::type + make_json_schema(Json sch, const URIResolver& resolver, evaluation_options options = evaluation_options{}) { using schema_store_type = std::map*>; @@ -249,7 +249,7 @@ namespace jsonschema { schema_builder_factory builder_factory{}; std::unordered_map vocabulary{}; - std::vector> resolve_funcs = {{meta_resolver, resolve}}; + std::vector> resolve_funcs = {{meta_resolver, resolver}}; auto schema_builder = builder_factory(std::move(sch), options, &schema_store, resolve_funcs, vocabulary); schema_builder->build_schema(); diff --git a/test/jsonschema/src/dynamic_ref_tests.cpp b/test/jsonschema/src/dynamic_ref_tests.cpp index 735475ac3e..c8b856c5ed 100644 --- a/test/jsonschema/src/dynamic_ref_tests.cpp +++ b/test/jsonschema/src/dynamic_ref_tests.cpp @@ -53,7 +53,7 @@ TEST_CASE("jsonschema $recursiveRef tests") json strict_tree_schema = json::parse(strict_tree_schema_str); - auto resolve = [tree_schema](const jsoncons::uri& uri) + auto resolver = [tree_schema](const jsoncons::uri& uri) { //std::cout << "resolve: " << uri.string() << "\n"; if (uri.string() == "https://example.com/tree") @@ -65,7 +65,7 @@ TEST_CASE("jsonschema $recursiveRef tests") return json::null(); } }; - jsonschema::json_schema compiled = jsonschema::make_json_schema(strict_tree_schema, resolve); + jsonschema::json_schema compiled = jsonschema::make_json_schema(strict_tree_schema, resolver); SECTION("instance with misspelled field") { @@ -141,7 +141,7 @@ TEST_CASE("jsonschema $dynamicRef tests") json strict_tree_schema = json::parse(strict_tree_schema_str); - auto resolve = [tree_schema](const jsoncons::uri& uri) + auto resolver = [tree_schema](const jsoncons::uri& uri) { //std::cout << "resolve: " << uri.string() << "\n"; if (uri.string() == "https://example.com/tree") @@ -153,7 +153,7 @@ TEST_CASE("jsonschema $dynamicRef tests") return json::null(); } }; - jsonschema::json_schema compiled = jsonschema::make_json_schema(strict_tree_schema, resolve); + jsonschema::json_schema compiled = jsonschema::make_json_schema(strict_tree_schema, resolver); SECTION("instance with misspelled field") { diff --git a/test/jsonschema/src/jsonschema_draft201909_tests.cpp b/test/jsonschema/src/jsonschema_draft201909_tests.cpp index fc67ee8f3c..489476c615 100644 --- a/test/jsonschema/src/jsonschema_draft201909_tests.cpp +++ b/test/jsonschema/src/jsonschema_draft201909_tests.cpp @@ -16,7 +16,7 @@ namespace jsonschema = jsoncons::jsonschema; namespace { - json resolve(const jsoncons::uri& uri) + json resolver(const jsoncons::uri& uri) { //std::cout << uri.string() << ", " << uri.path() << "\n"; std::string pathname = "./jsonschema/JSON-Schema-Test-Suite/remotes"; @@ -50,7 +50,7 @@ namespace { ++count; try { - jsonschema::json_schema compiled = jsonschema::make_json_schema(test_group.at("schema"), resolve, + jsonschema::json_schema compiled = jsonschema::make_json_schema(test_group.at("schema"), resolver, options); int count_test = 0; diff --git a/test/jsonschema/src/jsonschema_draft202012_tests.cpp b/test/jsonschema/src/jsonschema_draft202012_tests.cpp index e2ad5760ec..80a79c73cb 100644 --- a/test/jsonschema/src/jsonschema_draft202012_tests.cpp +++ b/test/jsonschema/src/jsonschema_draft202012_tests.cpp @@ -16,7 +16,7 @@ namespace jsonschema = jsoncons::jsonschema; namespace { - json resolve(const jsoncons::uri& uri) + json resolver(const jsoncons::uri& uri) { //std::cout << uri.string() << ", " << uri.path() << "\n"; std::string pathname = "./jsonschema/JSON-Schema-Test-Suite/remotes"; @@ -50,7 +50,7 @@ namespace { ++count; try { - jsonschema::json_schema compiled = jsonschema::make_json_schema(test_group.at("schema"), resolve, + jsonschema::json_schema compiled = jsonschema::make_json_schema(test_group.at("schema"), resolver, options); int count_test = 0; diff --git a/test/jsonschema/src/jsonschema_draft4_tests.cpp b/test/jsonschema/src/jsonschema_draft4_tests.cpp index 3fb8ee0d0d..509cb3534b 100644 --- a/test/jsonschema/src/jsonschema_draft4_tests.cpp +++ b/test/jsonschema/src/jsonschema_draft4_tests.cpp @@ -16,7 +16,7 @@ namespace jsonschema = jsoncons::jsonschema; namespace { - json resolve(const jsoncons::uri& uri) + json resolver(const jsoncons::uri& uri) { //std::cout << uri.string() << ", " << uri.path() << "\n"; std::string pathname = "./jsonschema/JSON-Schema-Test-Suite/remotes"; @@ -49,7 +49,7 @@ namespace { ++count; try { - jsonschema::json_schema compiled = jsonschema::make_json_schema(test_group.at("schema"), resolve, + jsonschema::json_schema compiled = jsonschema::make_json_schema(test_group.at("schema"), resolver, jsonschema::evaluation_options{}.default_version(jsonschema::schema_version::draft4()) .require_format_validation(true)); diff --git a/test/jsonschema/src/jsonschema_draft6_tests.cpp b/test/jsonschema/src/jsonschema_draft6_tests.cpp index 068384accf..83ef6edd44 100644 --- a/test/jsonschema/src/jsonschema_draft6_tests.cpp +++ b/test/jsonschema/src/jsonschema_draft6_tests.cpp @@ -16,7 +16,7 @@ namespace jsonschema = jsoncons::jsonschema; namespace { - json resolve(const jsoncons::uri& uri) + json resolver(const jsoncons::uri& uri) { //std::cout << uri.string() << ", " << uri.path() << "\n"; std::string pathname = "./jsonschema/JSON-Schema-Test-Suite/remotes"; @@ -49,7 +49,7 @@ namespace { ++count; try { - jsonschema::json_schema compiled = jsonschema::make_json_schema(test_group.at("schema"), resolve, + jsonschema::json_schema compiled = jsonschema::make_json_schema(test_group.at("schema"), resolver, jsonschema::evaluation_options{}.default_version(jsonschema::schema_version::draft6()) .require_format_validation(true)); diff --git a/test/jsonschema/src/jsonschema_draft7_tests.cpp b/test/jsonschema/src/jsonschema_draft7_tests.cpp index 99413f0462..0c76e9f66a 100644 --- a/test/jsonschema/src/jsonschema_draft7_tests.cpp +++ b/test/jsonschema/src/jsonschema_draft7_tests.cpp @@ -16,7 +16,7 @@ namespace jsonschema = jsoncons::jsonschema; namespace { - json resolve(const jsoncons::uri& uri) + json resolver(const jsoncons::uri& uri) { //std::cout << uri.string() << ", " << uri.path() << "\n"; std::string pathname = "./jsonschema/JSON-Schema-Test-Suite/remotes"; @@ -50,7 +50,7 @@ namespace { ++count; try { - jsonschema::json_schema compiled = jsonschema::make_json_schema(test_group.at("schema"), resolve, + jsonschema::json_schema compiled = jsonschema::make_json_schema(test_group.at("schema"), resolver, options); int count_test = 0;