diff --git a/src/jsonschema/CMakeLists.txt b/src/jsonschema/CMakeLists.txt index 62ea42ec4..8de677a11 100644 --- a/src/jsonschema/CMakeLists.txt +++ b/src/jsonschema/CMakeLists.txt @@ -5,7 +5,7 @@ include(./official_resolver.cmake) noa_library(NAMESPACE sourcemeta PROJECT jsontoolkit NAME jsonschema FOLDER "JSON Toolkit/JSON Schema" PRIVATE_HEADERS anchor.h bundle.h resolver.h - walker.h reference.h frame.h error.h unevaluated.h + walker.h reference.h frame.h error.h unevaluated.h keywords.h SOURCES jsonschema.cc default_walker.cc frame.cc anchor.cc resolver.cc walker.cc bundle.cc unevaluated.cc "${CMAKE_CURRENT_BINARY_DIR}/official_resolver.cc") diff --git a/src/jsonschema/default_walker.cc b/src/jsonschema/default_walker.cc index 877dc1189..e9073a02a 100644 --- a/src/jsonschema/default_walker.cc +++ b/src/jsonschema/default_walker.cc @@ -5,7 +5,7 @@ auto sourcemeta::jsontoolkit::default_schema_walker( -> sourcemeta::jsontoolkit::SchemaWalkerResult { #define WALK(vocabulary, _keyword, strategy, ...) \ if (vocabularies.contains(vocabulary) && keyword == _keyword) \ - return {sourcemeta::jsontoolkit::SchemaWalkerStrategy::strategy, \ + return {sourcemeta::jsontoolkit::KeywordType::strategy, \ vocabulary, \ {__VA_ARGS__}}; @@ -261,9 +261,8 @@ auto sourcemeta::jsontoolkit::default_schema_walker( // $ref also takes precedence over any unknown keyword if (vocabularies.contains(HTTP_BASE "draft-07/schema#") && keyword != "$ref") { - return {sourcemeta::jsontoolkit::SchemaWalkerStrategy::Unknown, - std::nullopt, - {"$ref"}}; + return { + sourcemeta::jsontoolkit::KeywordType::Unknown, std::nullopt, {"$ref"}}; } // Draft6 @@ -327,9 +326,8 @@ auto sourcemeta::jsontoolkit::default_schema_walker( // $ref also takes precedence over any unknown keyword if (vocabularies.contains(HTTP_BASE "draft-06/schema#") && keyword != "$ref") { - return {sourcemeta::jsontoolkit::SchemaWalkerStrategy::Unknown, - std::nullopt, - {"$ref"}}; + return { + sourcemeta::jsontoolkit::KeywordType::Unknown, std::nullopt, {"$ref"}}; } // Draft4 @@ -381,9 +379,8 @@ auto sourcemeta::jsontoolkit::default_schema_walker( // $ref also takes precedence over any unknown keyword if (vocabularies.contains(HTTP_BASE "draft-04/schema#") && keyword != "$ref") { - return {sourcemeta::jsontoolkit::SchemaWalkerStrategy::Unknown, - std::nullopt, - {"$ref"}}; + return { + sourcemeta::jsontoolkit::KeywordType::Unknown, std::nullopt, {"$ref"}}; } // Draft3 @@ -427,9 +424,8 @@ auto sourcemeta::jsontoolkit::default_schema_walker( // $ref also takes precedence over any unknown keyword if (vocabularies.contains(HTTP_BASE "draft-03/schema#") && keyword != "$ref") { - return {sourcemeta::jsontoolkit::SchemaWalkerStrategy::Unknown, - std::nullopt, - {"$ref"}}; + return { + sourcemeta::jsontoolkit::KeywordType::Unknown, std::nullopt, {"$ref"}}; } // Draft2 @@ -552,6 +548,5 @@ auto sourcemeta::jsontoolkit::default_schema_walker( #undef HTTP_BASE #undef WALK #undef WALK_MAYBE_DEPENDENT - return { - sourcemeta::jsontoolkit::SchemaWalkerStrategy::Unknown, std::nullopt, {}}; + return {sourcemeta::jsontoolkit::KeywordType::Unknown, std::nullopt, {}}; } diff --git a/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema.h b/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema.h index 5e77ff514..3f18f1648 100644 --- a/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema.h +++ b/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_keywords.h b/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_keywords.h new file mode 100644 index 000000000..a878dd194 --- /dev/null +++ b/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_keywords.h @@ -0,0 +1,83 @@ +#ifndef SOURCEMETA_JSONTOOLKIT_JSONSCHEMA_KEYWORDS_H_ +#define SOURCEMETA_JSONTOOLKIT_JSONSCHEMA_KEYWORDS_H_ + +#include // std::uint8_t + +namespace sourcemeta::jsontoolkit { + +#if defined(__GNUC__) +#pragma GCC diagnostic push +// For some strange reason, GCC on Debian 11 believes that a member of +// an enum class (which is namespaced by definition), can shadow an +// alias defined even on a different namespace. +#pragma GCC diagnostic ignored "-Wshadow" +#endif +/// @ingroup jsonschema +/// Determines the type of a JSON Schema keyword +enum class KeywordType : std::uint8_t { + /// The JSON Schema keyword is unknown + Unknown, + /// The JSON Schema keyword is a non-applicator assertion + Assertion, + /// The JSON Schema keyword is a non-applicator annotation + Annotation, + /// The JSON Schema keyword is a reference + Reference, + /// The JSON Schema keyword is known but doesn't match any other type + Other, + /// The JSON Schema keyword is an applicator that potentially + /// takes a JSON Schema definition as an argument + ApplicatorValue, + /// The JSON Schema keyword is an applicator that potentially + /// takes a JSON Schema definition as an argument but its evaluation follows + /// special rules + ApplicatorValueOther, + /// The JSON Schema keyword is an applicator that potentially + /// takes a JSON Schema definition as an argument without affecting the + /// instance location + ApplicatorValueInPlace, + /// The JSON Schema keyword is an applicator that potentially + /// takes an array of potentially JSON Schema definitions + /// as an argument + ApplicatorElements, + /// The JSON Schema keyword is an applicator that potentially + /// takes an array of potentially JSON Schema definitions + /// as an argument without affecting the instance location + ApplicatorElementsInPlace, + /// The JSON Schema keyword is an applicator that potentially + /// takes an array of potentially JSON Schema definitions + /// as an argument without affecting the instance location and that can be + /// statically inlined + ApplicatorElementsInline, + /// The JSON Schema keyword is an applicator that potentially + /// takes an object as argument, whose values are potentially + /// JSON Schema definitions + ApplicatorMembers, + /// The JSON Schema keyword is an applicator that potentially + /// takes an object as argument, whose values are potentially + /// JSON Schema definitions without affecting the instance location + ApplicatorMembersInPlace, + /// The JSON Schema keyword is an applicator that may take a JSON Schema + /// definition or an array of potentially JSON Schema definitions + /// as an argument + ApplicatorValueOrElements, + /// The JSON Schema keyword is an applicator that may take a JSON Schema + /// definition or an array of potentially JSON Schema definitions + /// as an argument without affecting the instance location + ApplicatorValueOrElementsInPlace, + /// The JSON Schema keyword is an applicator that may take an array of + /// potentially JSON Schema definitions or an object whose values are + /// potentially JSON Schema definitions as an argument + ApplicatorElementsOrMembers, + /// The JSON Schema keyword is a reserved location that potentially + /// takes an object as argument, whose values are potentially + /// JSON Schema definitions + LocationMembers, +}; +#if defined(__GNUC__) +#pragma GCC diagnostic pop +#endif + +} // namespace sourcemeta::jsontoolkit + +#endif diff --git a/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_walker.h b/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_walker.h index c7b68ab38..a2eecc592 100644 --- a/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_walker.h +++ b/src/jsonschema/include/sourcemeta/jsontoolkit/jsonschema_walker.h @@ -7,9 +7,10 @@ #include #include +#include #include -#include // std::uint8_t +#include // std::uint64_t #include // std::function #include // std::map #include // std::optional @@ -20,85 +21,11 @@ namespace sourcemeta::jsontoolkit { -#if defined(__GNUC__) -#pragma GCC diagnostic push -// For some strange reason, GCC on Debian 11 believes that a member of -// an enum class (which is namespaced by definition), can shadow an -// alias defined even on a different namespace. -#pragma GCC diagnostic ignored "-Wshadow" -#endif -// TODO: Extract this into a more generic keyword identification enumeration -/// @ingroup jsonschema -/// Determines the possible states of a schema walk strategy -enum class SchemaWalkerStrategy : std::uint8_t { - /// The JSON Schema keyword is unknown - Unknown, - /// The JSON Schema keyword is a non-applicator assertion - Assertion, - /// The JSON Schema keyword is a non-applicator annotation - Annotation, - /// The JSON Schema keyword is a reference - Reference, - /// The JSON Schema keyword is known but doesn't match any other type - Other, - /// The JSON Schema keyword is an applicator that potentially - /// takes a JSON Schema definition as an argument - ApplicatorValue, - /// The JSON Schema keyword is an applicator that potentially - /// takes a JSON Schema definition as an argument but its evaluation follows - /// special rules - ApplicatorValueOther, - /// The JSON Schema keyword is an applicator that potentially - /// takes a JSON Schema definition as an argument without affecting the - /// instance location - ApplicatorValueInPlace, - /// The JSON Schema keyword is an applicator that potentially - /// takes an array of potentially JSON Schema definitions - /// as an argument - ApplicatorElements, - /// The JSON Schema keyword is an applicator that potentially - /// takes an array of potentially JSON Schema definitions - /// as an argument without affecting the instance location - ApplicatorElementsInPlace, - /// The JSON Schema keyword is an applicator that potentially - /// takes an array of potentially JSON Schema definitions - /// as an argument without affecting the instance location and that can be - /// statically inlined - ApplicatorElementsInline, - /// The JSON Schema keyword is an applicator that potentially - /// takes an object as argument, whose values are potentially - /// JSON Schema definitions - ApplicatorMembers, - /// The JSON Schema keyword is an applicator that potentially - /// takes an object as argument, whose values are potentially - /// JSON Schema definitions without affecting the instance location - ApplicatorMembersInPlace, - /// The JSON Schema keyword is an applicator that may take a JSON Schema - /// definition or an array of potentially JSON Schema definitions - /// as an argument - ApplicatorValueOrElements, - /// The JSON Schema keyword is an applicator that may take a JSON Schema - /// definition or an array of potentially JSON Schema definitions - /// as an argument without affecting the instance location - ApplicatorValueOrElementsInPlace, - /// The JSON Schema keyword is an applicator that may take an array of - /// potentially JSON Schema definitions or an object whose values are - /// potentially JSON Schema definitions as an argument - ApplicatorElementsOrMembers, - /// The JSON Schema keyword is a reserved location that potentially - /// takes an object as argument, whose values are potentially - /// JSON Schema definitions - LocationMembers, -}; -#if defined(__GNUC__) -#pragma GCC diagnostic pop -#endif - /// @ingroup jsonschema /// A structure that encapsulates the result of walker over a specific keyword struct SchemaWalkerResult { /// The walker strategy to continue traversing across the schema - const SchemaWalkerStrategy strategy; + const KeywordType type; /// The vocabulary associated with the keyword, if any const std::optional vocabulary; /// The keywords a given keyword depends on (if any) during the evaluation @@ -127,7 +54,7 @@ SOURCEMETA_JSONTOOLKIT_JSONSCHEMA_EXPORT inline auto schema_walker_none(std::string_view, const std::map &) -> sourcemeta::jsontoolkit::SchemaWalkerResult { - return {SchemaWalkerStrategy::Unknown, std::nullopt, {}}; + return {KeywordType::Unknown, std::nullopt, {}}; } /// @ingroup jsonschema diff --git a/src/jsonschema/unevaluated.cc b/src/jsonschema/unevaluated.cc index b36bdd263..02e4799f8 100644 --- a/src/jsonschema/unevaluated.cc +++ b/src/jsonschema/unevaluated.cc @@ -58,11 +58,9 @@ auto find_adjacent_dependencies( continue; } - const auto strategy{ - walker(property.first, subschema_vocabularies).strategy}; - switch (strategy) { + switch (walker(property.first, subschema_vocabularies).type) { // References - case SchemaWalkerStrategy::Reference: + case KeywordType::Reference: if (references.contains({ReferenceType::Static, entry.pointer.concat({property.first})})) { const auto &reference{references.at( @@ -82,7 +80,7 @@ auto find_adjacent_dependencies( break; // Static - case SchemaWalkerStrategy::ApplicatorElementsInline: + case KeywordType::ApplicatorElementsInline: for (std::size_t index = 0; index < property.second.size(); index++) { find_adjacent_dependencies( current, schema, frame, references, walker, resolver, keywords, @@ -93,7 +91,7 @@ auto find_adjacent_dependencies( break; // Dynamic - case SchemaWalkerStrategy::ApplicatorElementsInPlace: + case KeywordType::ApplicatorElementsInPlace: if (property.second.is_array()) { for (std::size_t index = 0; index < property.second.size(); index++) { find_adjacent_dependencies( @@ -104,7 +102,7 @@ auto find_adjacent_dependencies( } break; - case SchemaWalkerStrategy::ApplicatorValueInPlace: + case KeywordType::ApplicatorValueInPlace: if (is_schema(property.second)) { find_adjacent_dependencies( current, schema, frame, references, walker, resolver, keywords, @@ -113,7 +111,7 @@ auto find_adjacent_dependencies( } break; - case SchemaWalkerStrategy::ApplicatorValueOrElementsInPlace: + case KeywordType::ApplicatorValueOrElementsInPlace: if (property.second.is_array()) { for (std::size_t index = 0; index < property.second.size(); index++) { find_adjacent_dependencies( @@ -129,7 +127,7 @@ auto find_adjacent_dependencies( } break; - case SchemaWalkerStrategy::ApplicatorMembersInPlace: + case KeywordType::ApplicatorMembersInPlace: if (property.second.is_object()) { for (const auto &pair : property.second.as_object()) { find_adjacent_dependencies( diff --git a/src/jsonschema/walker.cc b/src/jsonschema/walker.cc index 0ade9b674..00b98ab15 100644 --- a/src/jsonschema/walker.cc +++ b/src/jsonschema/walker.cc @@ -61,25 +61,22 @@ auto walk(sourcemeta::jsontoolkit::Pointer &pointer, } for (auto &pair : subschema.as_object()) { - switch (walker(pair.first, vocabularies).strategy) { - case sourcemeta::jsontoolkit::SchemaWalkerStrategy::ApplicatorValue: + switch (walker(pair.first, vocabularies).type) { + case sourcemeta::jsontoolkit::KeywordType::ApplicatorValue: [[fallthrough]]; - case sourcemeta::jsontoolkit::SchemaWalkerStrategy::ApplicatorValueOther: + case sourcemeta::jsontoolkit::KeywordType::ApplicatorValueOther: [[fallthrough]]; - case sourcemeta::jsontoolkit::SchemaWalkerStrategy:: - ApplicatorValueInPlace: { + case sourcemeta::jsontoolkit::KeywordType::ApplicatorValueInPlace: { sourcemeta::jsontoolkit::Pointer new_pointer{pointer}; new_pointer.emplace_back(pair.first); walk(new_pointer, subschemas, pair.second, walker, resolver, new_dialect, type, level + 1); } break; - case sourcemeta::jsontoolkit::SchemaWalkerStrategy::ApplicatorElements: + case sourcemeta::jsontoolkit::KeywordType::ApplicatorElements: [[fallthrough]]; - case sourcemeta::jsontoolkit::SchemaWalkerStrategy:: - ApplicatorElementsInline: + case sourcemeta::jsontoolkit::KeywordType::ApplicatorElementsInline: [[fallthrough]]; - case sourcemeta::jsontoolkit::SchemaWalkerStrategy:: - ApplicatorElementsInPlace: + case sourcemeta::jsontoolkit::KeywordType::ApplicatorElementsInPlace: if (pair.second.is_array()) { for (std::size_t index = 0; index < pair.second.size(); index++) { sourcemeta::jsontoolkit::Pointer new_pointer{pointer}; @@ -91,12 +88,11 @@ auto walk(sourcemeta::jsontoolkit::Pointer &pointer, } break; - case sourcemeta::jsontoolkit::SchemaWalkerStrategy::ApplicatorMembers: + case sourcemeta::jsontoolkit::KeywordType::ApplicatorMembers: [[fallthrough]]; - case sourcemeta::jsontoolkit::SchemaWalkerStrategy:: - ApplicatorMembersInPlace: + case sourcemeta::jsontoolkit::KeywordType::ApplicatorMembersInPlace: [[fallthrough]]; - case sourcemeta::jsontoolkit::SchemaWalkerStrategy::LocationMembers: + case sourcemeta::jsontoolkit::KeywordType::LocationMembers: if (pair.second.is_object()) { for (auto &subpair : pair.second.as_object()) { sourcemeta::jsontoolkit::Pointer new_pointer{pointer}; @@ -108,10 +104,9 @@ auto walk(sourcemeta::jsontoolkit::Pointer &pointer, } break; - case sourcemeta::jsontoolkit::SchemaWalkerStrategy:: - ApplicatorValueOrElements: + case sourcemeta::jsontoolkit::KeywordType::ApplicatorValueOrElements: [[fallthrough]]; - case sourcemeta::jsontoolkit::SchemaWalkerStrategy:: + case sourcemeta::jsontoolkit::KeywordType:: ApplicatorValueOrElementsInPlace: if (pair.second.is_array()) { for (std::size_t index = 0; index < pair.second.size(); index++) { @@ -129,8 +124,7 @@ auto walk(sourcemeta::jsontoolkit::Pointer &pointer, } break; - case sourcemeta::jsontoolkit::SchemaWalkerStrategy:: - ApplicatorElementsOrMembers: + case sourcemeta::jsontoolkit::KeywordType::ApplicatorElementsOrMembers: if (pair.second.is_array()) { for (std::size_t index = 0; index < pair.second.size(); index++) { sourcemeta::jsontoolkit::Pointer new_pointer{pointer}; @@ -150,15 +144,15 @@ auto walk(sourcemeta::jsontoolkit::Pointer &pointer, } break; - case sourcemeta::jsontoolkit::SchemaWalkerStrategy::Assertion: + case sourcemeta::jsontoolkit::KeywordType::Assertion: break; - case sourcemeta::jsontoolkit::SchemaWalkerStrategy::Annotation: + case sourcemeta::jsontoolkit::KeywordType::Annotation: break; - case sourcemeta::jsontoolkit::SchemaWalkerStrategy::Reference: + case sourcemeta::jsontoolkit::KeywordType::Reference: break; - case sourcemeta::jsontoolkit::SchemaWalkerStrategy::Other: + case sourcemeta::jsontoolkit::KeywordType::Other: break; - case sourcemeta::jsontoolkit::SchemaWalkerStrategy::Unknown: + case sourcemeta::jsontoolkit::KeywordType::Unknown: break; } } diff --git a/test/jsonschema/jsonschema_default_walker_2019_09_test.cc b/test/jsonschema/jsonschema_default_walker_2019_09_test.cc index 01587a0c4..d7dfc08d4 100644 --- a/test/jsonschema/jsonschema_default_walker_2019_09_test.cc +++ b/test/jsonschema/jsonschema_default_walker_2019_09_test.cc @@ -34,7 +34,7 @@ TEST(JSONSchema_default_walker_2019_09, core_schema) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("$schema", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/core"); @@ -45,7 +45,7 @@ TEST(JSONSchema_default_walker_2019_09, core_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("$vocabulary", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/core"); @@ -55,7 +55,7 @@ TEST(JSONSchema_default_walker_2019_09, core_vocabulary) { TEST(JSONSchema_default_walker_2019_09, core_id) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("$id", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/core"); @@ -66,7 +66,7 @@ TEST(JSONSchema_default_walker_2019_09, core_anchor) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("$anchor", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/core"); @@ -77,7 +77,7 @@ TEST(JSONSchema_default_walker_2019_09, core_recursiveAnchor) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("$recursiveAnchor", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/core"); @@ -87,7 +87,7 @@ TEST(JSONSchema_default_walker_2019_09, core_recursiveAnchor) { TEST(JSONSchema_default_walker_2019_09, core_ref) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("$ref", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Reference); + EXPECT_EQ(result.type, KeywordType::Reference); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/core"); @@ -98,7 +98,7 @@ TEST(JSONSchema_default_walker_2019_09, core_recursiveRef) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("$recursiveRef", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Reference); + EXPECT_EQ(result.type, KeywordType::Reference); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/core"); @@ -108,7 +108,7 @@ TEST(JSONSchema_default_walker_2019_09, core_recursiveRef) { TEST(JSONSchema_default_walker_2019_09, core_defs) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("$defs", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::LocationMembers); + EXPECT_EQ(result.type, KeywordType::LocationMembers); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/core"); @@ -119,7 +119,7 @@ TEST(JSONSchema_default_walker_2019_09, core_comment) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("$comment", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/core"); @@ -130,7 +130,7 @@ TEST(JSONSchema_default_walker_2019_09, applicator_allOf) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("allOf", VOCABULARIES_2019_09_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorElementsInline); + EXPECT_EQ(result.type, KeywordType::ApplicatorElementsInline); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/applicator"); @@ -141,7 +141,7 @@ TEST(JSONSchema_default_walker_2019_09, applicator_anyOf) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("anyOf", VOCABULARIES_2019_09_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorElementsInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorElementsInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/applicator"); @@ -152,7 +152,7 @@ TEST(JSONSchema_default_walker_2019_09, applicator_oneOf) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("oneOf", VOCABULARIES_2019_09_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorElementsInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorElementsInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/applicator"); @@ -163,7 +163,7 @@ TEST(JSONSchema_default_walker_2019_09, applicator_not) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("not", VOCABULARIES_2019_09_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueOther); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueOther); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/applicator"); @@ -174,7 +174,7 @@ TEST(JSONSchema_default_walker_2019_09, applicator_if) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("if", VOCABULARIES_2019_09_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/applicator"); @@ -185,7 +185,7 @@ TEST(JSONSchema_default_walker_2019_09, applicator_then) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("then", VOCABULARIES_2019_09_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/applicator"); @@ -197,7 +197,7 @@ TEST(JSONSchema_default_walker_2019_09, applicator_else) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("else", VOCABULARIES_2019_09_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/applicator"); @@ -209,7 +209,7 @@ TEST(JSONSchema_default_walker_2019_09, applicator_dependentSchemas) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("dependentSchemas", VOCABULARIES_2019_09_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorMembersInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorMembersInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/applicator"); @@ -220,7 +220,7 @@ TEST(JSONSchema_default_walker_2019_09, applicator_items) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("items", VOCABULARIES_2019_09_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueOrElements); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueOrElements); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/applicator"); @@ -231,7 +231,7 @@ TEST(JSONSchema_default_walker_2019_09, applicator_additionalItems) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("additionalItems", VOCABULARIES_2019_09_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/applicator"); @@ -243,7 +243,7 @@ TEST(JSONSchema_default_walker_2019_09, applicator_contains_only) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("contains", VOCABULARIES_2019_09_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/applicator"); @@ -260,7 +260,7 @@ TEST(JSONSchema_default_walker_2019_09, applicator_contains_with_validation) { VOCABULARIES_2019_09_VALIDATION.cend(), std::inserter(vocabularies, vocabularies.end())); const auto result{default_schema_walker("contains", vocabularies)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/applicator"); @@ -272,7 +272,7 @@ TEST(JSONSchema_default_walker_2019_09, applicator_properties) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("properties", VOCABULARIES_2019_09_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorMembers); + EXPECT_EQ(result.type, KeywordType::ApplicatorMembers); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/applicator"); @@ -283,7 +283,7 @@ TEST(JSONSchema_default_walker_2019_09, applicator_patternProperties) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("patternProperties", VOCABULARIES_2019_09_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorMembers); + EXPECT_EQ(result.type, KeywordType::ApplicatorMembers); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/applicator"); @@ -294,7 +294,7 @@ TEST(JSONSchema_default_walker_2019_09, applicator_additionalProperties) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("additionalProperties", VOCABULARIES_2019_09_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/applicator"); @@ -306,7 +306,7 @@ TEST(JSONSchema_default_walker_2019_09, applicator_propertyNames) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("propertyNames", VOCABULARIES_2019_09_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/applicator"); @@ -317,7 +317,7 @@ TEST(JSONSchema_default_walker_2019_09, applicator_unevaluatedItems) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("unevaluatedItems", VOCABULARIES_2019_09_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/applicator"); @@ -329,7 +329,7 @@ TEST(JSONSchema_default_walker_2019_09, applicator_unevaluatedProperties) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("unevaluatedProperties", VOCABULARIES_2019_09_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/applicator"); @@ -342,7 +342,7 @@ TEST(JSONSchema_default_walker_2019_09, validation_type) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("type", VOCABULARIES_2019_09_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/validation"); @@ -353,7 +353,7 @@ TEST(JSONSchema_default_walker_2019_09, validation_enum) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("enum", VOCABULARIES_2019_09_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/validation"); @@ -364,7 +364,7 @@ TEST(JSONSchema_default_walker_2019_09, validation_const) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("const", VOCABULARIES_2019_09_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/validation"); @@ -375,7 +375,7 @@ TEST(JSONSchema_default_walker_2019_09, validation_multipleOf) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("multipleOf", VOCABULARIES_2019_09_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/validation"); @@ -386,7 +386,7 @@ TEST(JSONSchema_default_walker_2019_09, validation_maximum) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maximum", VOCABULARIES_2019_09_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/validation"); @@ -398,7 +398,7 @@ TEST(JSONSchema_default_walker_2019_09, validation_minimum) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minimum", VOCABULARIES_2019_09_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/validation"); @@ -410,7 +410,7 @@ TEST(JSONSchema_default_walker_2019_09, validation_exclusiveMaximum) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("exclusiveMaximum", VOCABULARIES_2019_09_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/validation"); @@ -421,7 +421,7 @@ TEST(JSONSchema_default_walker_2019_09, validation_exclusiveMinimum) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("exclusiveMinimum", VOCABULARIES_2019_09_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/validation"); @@ -432,7 +432,7 @@ TEST(JSONSchema_default_walker_2019_09, validation_maxLength) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maxLength", VOCABULARIES_2019_09_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/validation"); @@ -443,7 +443,7 @@ TEST(JSONSchema_default_walker_2019_09, validation_minLength) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minLength", VOCABULARIES_2019_09_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/validation"); @@ -454,7 +454,7 @@ TEST(JSONSchema_default_walker_2019_09, validation_pattern) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("pattern", VOCABULARIES_2019_09_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/validation"); @@ -465,7 +465,7 @@ TEST(JSONSchema_default_walker_2019_09, validation_maxItems) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maxItems", VOCABULARIES_2019_09_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/validation"); @@ -476,7 +476,7 @@ TEST(JSONSchema_default_walker_2019_09, validation_minItems) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minItems", VOCABULARIES_2019_09_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/validation"); @@ -487,7 +487,7 @@ TEST(JSONSchema_default_walker_2019_09, validation_uniqueItems) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("uniqueItems", VOCABULARIES_2019_09_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/validation"); @@ -498,7 +498,7 @@ TEST(JSONSchema_default_walker_2019_09, validation_maxContains) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maxContains", VOCABULARIES_2019_09_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/validation"); @@ -509,7 +509,7 @@ TEST(JSONSchema_default_walker_2019_09, validation_minContains) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minContains", VOCABULARIES_2019_09_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/validation"); @@ -520,7 +520,7 @@ TEST(JSONSchema_default_walker_2019_09, validation_maxProperties) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maxProperties", VOCABULARIES_2019_09_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/validation"); @@ -531,7 +531,7 @@ TEST(JSONSchema_default_walker_2019_09, validation_minProperties) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minProperties", VOCABULARIES_2019_09_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/validation"); @@ -542,7 +542,7 @@ TEST(JSONSchema_default_walker_2019_09, validation_required) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("required", VOCABULARIES_2019_09_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/validation"); @@ -553,7 +553,7 @@ TEST(JSONSchema_default_walker_2019_09, validation_dependentRequired) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("dependentRequired", VOCABULARIES_2019_09_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/validation"); @@ -564,7 +564,7 @@ TEST(JSONSchema_default_walker_2019_09, format_format) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("format", VOCABULARIES_2019_09_FORMAT)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Annotation); + EXPECT_EQ(result.type, KeywordType::Annotation); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/format"); @@ -575,7 +575,7 @@ TEST(JSONSchema_default_walker_2019_09, content_contentEncoding) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("contentEncoding", VOCABULARIES_2019_09_CONTENT)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Annotation); + EXPECT_EQ(result.type, KeywordType::Annotation); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/content"); @@ -586,7 +586,7 @@ TEST(JSONSchema_default_walker_2019_09, content_contentMediaType) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("contentMediaType", VOCABULARIES_2019_09_CONTENT)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Annotation); + EXPECT_EQ(result.type, KeywordType::Annotation); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/content"); @@ -597,7 +597,7 @@ TEST(JSONSchema_default_walker_2019_09, content_contentSchema) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("contentSchema", VOCABULARIES_2019_09_CONTENT)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueOther); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueOther); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/content"); @@ -608,7 +608,7 @@ TEST(JSONSchema_default_walker_2019_09, metadata_title) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("title", VOCABULARIES_2019_09_METADATA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Annotation); + EXPECT_EQ(result.type, KeywordType::Annotation); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/meta-data"); @@ -619,7 +619,7 @@ TEST(JSONSchema_default_walker_2019_09, metadata_description) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("description", VOCABULARIES_2019_09_METADATA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Annotation); + EXPECT_EQ(result.type, KeywordType::Annotation); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/meta-data"); @@ -630,7 +630,7 @@ TEST(JSONSchema_default_walker_2019_09, metadata_default) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("default", VOCABULARIES_2019_09_METADATA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Annotation); + EXPECT_EQ(result.type, KeywordType::Annotation); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/meta-data"); @@ -641,7 +641,7 @@ TEST(JSONSchema_default_walker_2019_09, metadata_deprecated) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("deprecated", VOCABULARIES_2019_09_METADATA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Annotation); + EXPECT_EQ(result.type, KeywordType::Annotation); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/meta-data"); @@ -652,7 +652,7 @@ TEST(JSONSchema_default_walker_2019_09, metadata_readOnly) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("readOnly", VOCABULARIES_2019_09_METADATA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Annotation); + EXPECT_EQ(result.type, KeywordType::Annotation); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/meta-data"); @@ -663,7 +663,7 @@ TEST(JSONSchema_default_walker_2019_09, metadata_writeOnly) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("writeOnly", VOCABULARIES_2019_09_METADATA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Annotation); + EXPECT_EQ(result.type, KeywordType::Annotation); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/meta-data"); @@ -674,7 +674,7 @@ TEST(JSONSchema_default_walker_2019_09, metadata_examples) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("examples", VOCABULARIES_2019_09_METADATA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Annotation); + EXPECT_EQ(result.type, KeywordType::Annotation); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/meta-data"); @@ -685,7 +685,7 @@ TEST(JSONSchema_default_walker_2019_09, hyperschema_base) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("base", VOCABULARIES_2019_09_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -694,7 +694,7 @@ TEST(JSONSchema_default_walker_2019_09, hyperschema_links) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("links", VOCABULARIES_2019_09_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -703,7 +703,7 @@ TEST(JSONSchema_default_walker_2019_09, hyperschema_ref) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("ref", VOCABULARIES_2019_09_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -712,7 +712,7 @@ TEST(JSONSchema_default_walker_2019_09, hyperschema_href) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("href", VOCABULARIES_2019_09_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -721,7 +721,7 @@ TEST(JSONSchema_default_walker_2019_09, hyperschema_anchor) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("anchor", VOCABULARIES_2019_09_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -730,7 +730,7 @@ TEST(JSONSchema_default_walker_2019_09, hyperschema_anchorPointer) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("anchorPointer", VOCABULARIES_2019_09_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -739,7 +739,7 @@ TEST(JSONSchema_default_walker_2019_09, hyperschema_rel) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("rel", VOCABULARIES_2019_09_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -748,7 +748,7 @@ TEST(JSONSchema_default_walker_2019_09, hyperschema_templatePointers) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("templatePointers", VOCABULARIES_2019_09_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -757,7 +757,7 @@ TEST(JSONSchema_default_walker_2019_09, hyperschema_templateRequired) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("templateRequired", VOCABULARIES_2019_09_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -766,7 +766,7 @@ TEST(JSONSchema_default_walker_2019_09, hyperschema_targetMediaType) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("targetMediaType", VOCABULARIES_2019_09_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -775,7 +775,7 @@ TEST(JSONSchema_default_walker_2019_09, hyperschema_targetHints) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("targetHints", VOCABULARIES_2019_09_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -784,7 +784,7 @@ TEST(JSONSchema_default_walker_2019_09, hyperschema_submissionMediaType) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("submissionMediaType", VOCABULARIES_2019_09_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -793,7 +793,7 @@ TEST(JSONSchema_default_walker_2019_09, hyperschema_hrefSchema) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("hrefSchema", VOCABULARIES_2019_09_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/hyper-schema"); @@ -804,7 +804,7 @@ TEST(JSONSchema_default_walker_2019_09, hyperschema_targetSchema) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("targetSchema", VOCABULARIES_2019_09_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/hyper-schema"); @@ -815,7 +815,7 @@ TEST(JSONSchema_default_walker_2019_09, hyperschema_headerSchema) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("headerSchema", VOCABULARIES_2019_09_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/hyper-schema"); @@ -826,7 +826,7 @@ TEST(JSONSchema_default_walker_2019_09, hyperschema_submissionSchema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("submissionSchema", VOCABULARIES_2019_09_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/hyper-schema"); @@ -836,7 +836,7 @@ TEST(JSONSchema_default_walker_2019_09, hyperschema_submissionSchema) { TEST(JSONSchema_default_walker_2019_09, applicator_allOf_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("allOf", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -844,7 +844,7 @@ TEST(JSONSchema_default_walker_2019_09, applicator_allOf_without_vocabulary) { TEST(JSONSchema_default_walker_2019_09, applicator_anyOf_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("anyOf", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -852,7 +852,7 @@ TEST(JSONSchema_default_walker_2019_09, applicator_anyOf_without_vocabulary) { TEST(JSONSchema_default_walker_2019_09, applicator_oneOf_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("oneOf", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -860,7 +860,7 @@ TEST(JSONSchema_default_walker_2019_09, applicator_oneOf_without_vocabulary) { TEST(JSONSchema_default_walker_2019_09, applicator_not_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("not", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -868,7 +868,7 @@ TEST(JSONSchema_default_walker_2019_09, applicator_not_without_vocabulary) { TEST(JSONSchema_default_walker_2019_09, applicator_if_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("if", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -876,7 +876,7 @@ TEST(JSONSchema_default_walker_2019_09, applicator_if_without_vocabulary) { TEST(JSONSchema_default_walker_2019_09, applicator_then_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("then", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -884,7 +884,7 @@ TEST(JSONSchema_default_walker_2019_09, applicator_then_without_vocabulary) { TEST(JSONSchema_default_walker_2019_09, applicator_else_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("else", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -894,7 +894,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("dependentSchemas", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -904,7 +904,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("additionalItems", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -912,7 +912,7 @@ TEST(JSONSchema_default_walker_2019_09, TEST(JSONSchema_default_walker_2019_09, applicator_items_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("items", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -922,7 +922,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("contains", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -932,7 +932,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("properties", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -942,7 +942,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("patternProperties", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -952,7 +952,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("additionalProperties", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -962,7 +962,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("propertyNames", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -972,7 +972,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("unevaluatedItems", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -982,7 +982,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("unevaluatedProperties", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -990,7 +990,7 @@ TEST(JSONSchema_default_walker_2019_09, TEST(JSONSchema_default_walker_2019_09, validation_type_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("type", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -998,7 +998,7 @@ TEST(JSONSchema_default_walker_2019_09, validation_type_without_vocabulary) { TEST(JSONSchema_default_walker_2019_09, validation_enum_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("enum", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1006,7 +1006,7 @@ TEST(JSONSchema_default_walker_2019_09, validation_enum_without_vocabulary) { TEST(JSONSchema_default_walker_2019_09, validation_const_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("const", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1016,7 +1016,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("multipleOf", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1025,7 +1025,7 @@ TEST(JSONSchema_default_walker_2019_09, validation_maximum_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maximum", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1034,7 +1034,7 @@ TEST(JSONSchema_default_walker_2019_09, validation_minimum_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minimum", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1044,7 +1044,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("exclusiveMaximum", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1054,7 +1054,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("exclusiveMinimum", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1064,7 +1064,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maxLength", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1074,7 +1074,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minLength", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1083,7 +1083,7 @@ TEST(JSONSchema_default_walker_2019_09, validation_pattern_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("pattern", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1093,7 +1093,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maxItems", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1103,7 +1103,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minItems", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1113,7 +1113,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("uniqueItems", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1123,7 +1123,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maxContains", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1133,7 +1133,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minContains", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1143,7 +1143,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maxProperties", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1153,7 +1153,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minProperties", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1163,7 +1163,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("required", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1173,7 +1173,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("dependentRequired", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1181,7 +1181,7 @@ TEST(JSONSchema_default_walker_2019_09, TEST(JSONSchema_default_walker_2019_09, format_format_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("format", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1191,7 +1191,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("contentEncoding", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1201,7 +1201,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("contentMediaType", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1211,7 +1211,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("contentSchema", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1219,7 +1219,7 @@ TEST(JSONSchema_default_walker_2019_09, TEST(JSONSchema_default_walker_2019_09, metadata_title_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("title", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1229,7 +1229,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("description", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1238,7 +1238,7 @@ TEST(JSONSchema_default_walker_2019_09, metadata_default_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("default", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1248,7 +1248,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("deprecated", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1257,7 +1257,7 @@ TEST(JSONSchema_default_walker_2019_09, metadata_readOnly_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("readOnly", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1266,7 +1266,7 @@ TEST(JSONSchema_default_walker_2019_09, metadata_writeOnly_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("writeOnly", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1275,7 +1275,7 @@ TEST(JSONSchema_default_walker_2019_09, metadata_examples_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("examples", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1283,7 +1283,7 @@ TEST(JSONSchema_default_walker_2019_09, metadata_examples_without_vocabulary) { TEST(JSONSchema_default_walker_2019_09, hyperschema_base_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("base", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1291,7 +1291,7 @@ TEST(JSONSchema_default_walker_2019_09, hyperschema_base_without_vocabulary) { TEST(JSONSchema_default_walker_2019_09, hyperschema_links_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("links", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1299,7 +1299,7 @@ TEST(JSONSchema_default_walker_2019_09, hyperschema_links_without_vocabulary) { TEST(JSONSchema_default_walker_2019_09, hyperschema_ref_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("ref", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1307,7 +1307,7 @@ TEST(JSONSchema_default_walker_2019_09, hyperschema_ref_without_vocabulary) { TEST(JSONSchema_default_walker_2019_09, hyperschema_href_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("href", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1315,7 +1315,7 @@ TEST(JSONSchema_default_walker_2019_09, hyperschema_href_without_vocabulary) { TEST(JSONSchema_default_walker_2019_09, hyperschema_anchor_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("anchor", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1325,7 +1325,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("anchorPointer", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1333,7 +1333,7 @@ TEST(JSONSchema_default_walker_2019_09, TEST(JSONSchema_default_walker_2019_09, hyperschema_rel_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("rel", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1343,7 +1343,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("templatePointers", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1353,7 +1353,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("templateRequired", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1363,7 +1363,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("targetMediaType", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1373,7 +1373,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("targetHints", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1383,7 +1383,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("submissionMediaType", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1393,7 +1393,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("hrefSchema", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1403,7 +1403,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("targetSchema", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1413,7 +1413,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("headerSchema", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1423,7 +1423,7 @@ TEST(JSONSchema_default_walker_2019_09, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("submissionSchema", VOCABULARIES_2019_09_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } diff --git a/test/jsonschema/jsonschema_default_walker_2020_12_test.cc b/test/jsonschema/jsonschema_default_walker_2020_12_test.cc index f1b03bc93..45cb3a1ba 100644 --- a/test/jsonschema/jsonschema_default_walker_2020_12_test.cc +++ b/test/jsonschema/jsonschema_default_walker_2020_12_test.cc @@ -42,7 +42,7 @@ TEST(JSONSchema_default_walker_2020_12, core_schema) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("$schema", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/core"); @@ -53,7 +53,7 @@ TEST(JSONSchema_default_walker_2020_12, core_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("$vocabulary", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/core"); @@ -63,7 +63,7 @@ TEST(JSONSchema_default_walker_2020_12, core_vocabulary) { TEST(JSONSchema_default_walker_2020_12, core_id) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("$id", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/core"); @@ -74,7 +74,7 @@ TEST(JSONSchema_default_walker_2020_12, core_anchor) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("$anchor", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/core"); @@ -85,7 +85,7 @@ TEST(JSONSchema_default_walker_2020_12, core_dynamicAnchor) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("$dynamicAnchor", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/core"); @@ -95,7 +95,7 @@ TEST(JSONSchema_default_walker_2020_12, core_dynamicAnchor) { TEST(JSONSchema_default_walker_2020_12, core_ref) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("$ref", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Reference); + EXPECT_EQ(result.type, KeywordType::Reference); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/core"); @@ -106,7 +106,7 @@ TEST(JSONSchema_default_walker_2020_12, core_dynamicRef) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("$dynamicRef", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Reference); + EXPECT_EQ(result.type, KeywordType::Reference); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/core"); @@ -116,7 +116,7 @@ TEST(JSONSchema_default_walker_2020_12, core_dynamicRef) { TEST(JSONSchema_default_walker_2020_12, core_defs) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("$defs", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::LocationMembers); + EXPECT_EQ(result.type, KeywordType::LocationMembers); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/core"); @@ -127,7 +127,7 @@ TEST(JSONSchema_default_walker_2020_12, core_comment) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("$comment", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/core"); @@ -138,7 +138,7 @@ TEST(JSONSchema_default_walker_2020_12, applicator_allOf) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("allOf", VOCABULARIES_2020_12_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorElementsInline); + EXPECT_EQ(result.type, KeywordType::ApplicatorElementsInline); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/applicator"); @@ -149,7 +149,7 @@ TEST(JSONSchema_default_walker_2020_12, applicator_anyOf) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("anyOf", VOCABULARIES_2020_12_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorElementsInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorElementsInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/applicator"); @@ -160,7 +160,7 @@ TEST(JSONSchema_default_walker_2020_12, applicator_oneOf) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("oneOf", VOCABULARIES_2020_12_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorElementsInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorElementsInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/applicator"); @@ -171,7 +171,7 @@ TEST(JSONSchema_default_walker_2020_12, applicator_not) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("not", VOCABULARIES_2020_12_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueOther); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueOther); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/applicator"); @@ -182,7 +182,7 @@ TEST(JSONSchema_default_walker_2020_12, applicator_if) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("if", VOCABULARIES_2020_12_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/applicator"); @@ -193,7 +193,7 @@ TEST(JSONSchema_default_walker_2020_12, applicator_then) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("then", VOCABULARIES_2020_12_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/applicator"); @@ -205,7 +205,7 @@ TEST(JSONSchema_default_walker_2020_12, applicator_else) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("else", VOCABULARIES_2020_12_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/applicator"); @@ -217,7 +217,7 @@ TEST(JSONSchema_default_walker_2020_12, applicator_dependentSchemas) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("dependentSchemas", VOCABULARIES_2020_12_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorMembersInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorMembersInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/applicator"); @@ -228,7 +228,7 @@ TEST(JSONSchema_default_walker_2020_12, applicator_prefixItems) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("prefixItems", VOCABULARIES_2020_12_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorElements); + EXPECT_EQ(result.type, KeywordType::ApplicatorElements); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/applicator"); @@ -239,7 +239,7 @@ TEST(JSONSchema_default_walker_2020_12, applicator_items) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("items", VOCABULARIES_2020_12_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/applicator"); @@ -251,7 +251,7 @@ TEST(JSONSchema_default_walker_2020_12, applicator_contains_only) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("contains", VOCABULARIES_2020_12_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/applicator"); @@ -268,7 +268,7 @@ TEST(JSONSchema_default_walker_2020_12, applicator_contains_with_validation) { VOCABULARIES_2020_12_VALIDATION.cend(), std::inserter(vocabularies, vocabularies.end())); const auto result{default_schema_walker("contains", vocabularies)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/applicator"); @@ -280,7 +280,7 @@ TEST(JSONSchema_default_walker_2020_12, applicator_properties) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("properties", VOCABULARIES_2020_12_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorMembers); + EXPECT_EQ(result.type, KeywordType::ApplicatorMembers); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/applicator"); @@ -291,7 +291,7 @@ TEST(JSONSchema_default_walker_2020_12, applicator_patternProperties) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("patternProperties", VOCABULARIES_2020_12_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorMembers); + EXPECT_EQ(result.type, KeywordType::ApplicatorMembers); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/applicator"); @@ -302,7 +302,7 @@ TEST(JSONSchema_default_walker_2020_12, applicator_additionalProperties) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("additionalProperties", VOCABULARIES_2020_12_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/applicator"); @@ -314,7 +314,7 @@ TEST(JSONSchema_default_walker_2020_12, applicator_propertyNames) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("propertyNames", VOCABULARIES_2020_12_APPLICATOR)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/applicator"); @@ -325,7 +325,7 @@ TEST(JSONSchema_default_walker_2020_12, unevaluated_unevaluatedItems_only) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("unevaluatedItems", VOCABULARIES_2020_12_UNEVALUATED)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/unevaluated"); @@ -343,7 +343,7 @@ TEST(JSONSchema_default_walker_2020_12, VOCABULARIES_2020_12_APPLICATOR.cend(), std::inserter(vocabularies, vocabularies.end())); const auto result{default_schema_walker("unevaluatedItems", vocabularies)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/unevaluated"); @@ -356,7 +356,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("unevaluatedProperties", VOCABULARIES_2020_12_UNEVALUATED)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/unevaluated"); @@ -375,7 +375,7 @@ TEST(JSONSchema_default_walker_2020_12, std::inserter(vocabularies, vocabularies.end())); const auto result{ default_schema_walker("unevaluatedProperties", vocabularies)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/unevaluated"); @@ -388,7 +388,7 @@ TEST(JSONSchema_default_walker_2020_12, validation_type) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("type", VOCABULARIES_2020_12_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/validation"); @@ -399,7 +399,7 @@ TEST(JSONSchema_default_walker_2020_12, validation_enum) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("enum", VOCABULARIES_2020_12_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/validation"); @@ -410,7 +410,7 @@ TEST(JSONSchema_default_walker_2020_12, validation_const) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("const", VOCABULARIES_2020_12_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/validation"); @@ -421,7 +421,7 @@ TEST(JSONSchema_default_walker_2020_12, validation_multipleOf) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("multipleOf", VOCABULARIES_2020_12_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/validation"); @@ -432,7 +432,7 @@ TEST(JSONSchema_default_walker_2020_12, validation_maximum) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maximum", VOCABULARIES_2020_12_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/validation"); @@ -444,7 +444,7 @@ TEST(JSONSchema_default_walker_2020_12, validation_minimum) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minimum", VOCABULARIES_2020_12_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/validation"); @@ -456,7 +456,7 @@ TEST(JSONSchema_default_walker_2020_12, validation_exclusiveMaximum) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("exclusiveMaximum", VOCABULARIES_2020_12_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/validation"); @@ -467,7 +467,7 @@ TEST(JSONSchema_default_walker_2020_12, validation_exclusiveMinimum) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("exclusiveMinimum", VOCABULARIES_2020_12_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/validation"); @@ -478,7 +478,7 @@ TEST(JSONSchema_default_walker_2020_12, validation_maxLength) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maxLength", VOCABULARIES_2020_12_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/validation"); @@ -489,7 +489,7 @@ TEST(JSONSchema_default_walker_2020_12, validation_minLength) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minLength", VOCABULARIES_2020_12_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/validation"); @@ -500,7 +500,7 @@ TEST(JSONSchema_default_walker_2020_12, validation_pattern) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("pattern", VOCABULARIES_2020_12_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/validation"); @@ -511,7 +511,7 @@ TEST(JSONSchema_default_walker_2020_12, validation_maxItems) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maxItems", VOCABULARIES_2020_12_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/validation"); @@ -522,7 +522,7 @@ TEST(JSONSchema_default_walker_2020_12, validation_minItems) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minItems", VOCABULARIES_2020_12_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/validation"); @@ -533,7 +533,7 @@ TEST(JSONSchema_default_walker_2020_12, validation_uniqueItems) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("uniqueItems", VOCABULARIES_2020_12_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/validation"); @@ -544,7 +544,7 @@ TEST(JSONSchema_default_walker_2020_12, validation_maxContains) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maxContains", VOCABULARIES_2020_12_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/validation"); @@ -555,7 +555,7 @@ TEST(JSONSchema_default_walker_2020_12, validation_minContains) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minContains", VOCABULARIES_2020_12_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/validation"); @@ -566,7 +566,7 @@ TEST(JSONSchema_default_walker_2020_12, validation_maxProperties) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maxProperties", VOCABULARIES_2020_12_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/validation"); @@ -577,7 +577,7 @@ TEST(JSONSchema_default_walker_2020_12, validation_minProperties) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minProperties", VOCABULARIES_2020_12_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/validation"); @@ -588,7 +588,7 @@ TEST(JSONSchema_default_walker_2020_12, validation_required) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("required", VOCABULARIES_2020_12_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/validation"); @@ -599,7 +599,7 @@ TEST(JSONSchema_default_walker_2020_12, validation_dependentRequired) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("dependentRequired", VOCABULARIES_2020_12_VALIDATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/validation"); @@ -610,7 +610,7 @@ TEST(JSONSchema_default_walker_2020_12, format_annotation_format) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("format", VOCABULARIES_2020_12_FORMAT_ANNOTATION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Annotation); + EXPECT_EQ(result.type, KeywordType::Annotation); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/format-annotation"); @@ -621,7 +621,7 @@ TEST(JSONSchema_default_walker_2020_12, format_assertion_format) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("format", VOCABULARIES_2020_12_FORMAT_ASSERTION)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/format-assertion"); @@ -632,7 +632,7 @@ TEST(JSONSchema_default_walker_2020_12, content_contentEncoding) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("contentEncoding", VOCABULARIES_2020_12_CONTENT)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Annotation); + EXPECT_EQ(result.type, KeywordType::Annotation); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/content"); @@ -643,7 +643,7 @@ TEST(JSONSchema_default_walker_2020_12, content_contentMediaType) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("contentMediaType", VOCABULARIES_2020_12_CONTENT)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Annotation); + EXPECT_EQ(result.type, KeywordType::Annotation); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/content"); @@ -654,7 +654,7 @@ TEST(JSONSchema_default_walker_2020_12, content_contentSchema) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("contentSchema", VOCABULARIES_2020_12_CONTENT)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueOther); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueOther); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/content"); @@ -665,7 +665,7 @@ TEST(JSONSchema_default_walker_2020_12, metadata_title) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("title", VOCABULARIES_2020_12_METADATA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Annotation); + EXPECT_EQ(result.type, KeywordType::Annotation); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/meta-data"); @@ -676,7 +676,7 @@ TEST(JSONSchema_default_walker_2020_12, metadata_description) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("description", VOCABULARIES_2020_12_METADATA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Annotation); + EXPECT_EQ(result.type, KeywordType::Annotation); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/meta-data"); @@ -687,7 +687,7 @@ TEST(JSONSchema_default_walker_2020_12, metadata_default) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("default", VOCABULARIES_2020_12_METADATA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Annotation); + EXPECT_EQ(result.type, KeywordType::Annotation); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/meta-data"); @@ -698,7 +698,7 @@ TEST(JSONSchema_default_walker_2020_12, metadata_deprecated) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("deprecated", VOCABULARIES_2020_12_METADATA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Annotation); + EXPECT_EQ(result.type, KeywordType::Annotation); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/meta-data"); @@ -709,7 +709,7 @@ TEST(JSONSchema_default_walker_2020_12, metadata_readOnly) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("readOnly", VOCABULARIES_2020_12_METADATA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Annotation); + EXPECT_EQ(result.type, KeywordType::Annotation); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/meta-data"); @@ -720,7 +720,7 @@ TEST(JSONSchema_default_walker_2020_12, metadata_writeOnly) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("writeOnly", VOCABULARIES_2020_12_METADATA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Annotation); + EXPECT_EQ(result.type, KeywordType::Annotation); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/meta-data"); @@ -731,7 +731,7 @@ TEST(JSONSchema_default_walker_2020_12, metadata_examples) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("examples", VOCABULARIES_2020_12_METADATA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Annotation); + EXPECT_EQ(result.type, KeywordType::Annotation); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2020-12/vocab/meta-data"); @@ -742,7 +742,7 @@ TEST(JSONSchema_default_walker_2020_12, hyperschema_base) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("base", VOCABULARIES_2020_12_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -751,7 +751,7 @@ TEST(JSONSchema_default_walker_2020_12, hyperschema_links) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("links", VOCABULARIES_2020_12_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -760,7 +760,7 @@ TEST(JSONSchema_default_walker_2020_12, hyperschema_ref) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("ref", VOCABULARIES_2020_12_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -769,7 +769,7 @@ TEST(JSONSchema_default_walker_2020_12, hyperschema_href) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("href", VOCABULARIES_2020_12_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -778,7 +778,7 @@ TEST(JSONSchema_default_walker_2020_12, hyperschema_anchor) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("anchor", VOCABULARIES_2020_12_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -787,7 +787,7 @@ TEST(JSONSchema_default_walker_2020_12, hyperschema_anchorPointer) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("anchorPointer", VOCABULARIES_2020_12_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -796,7 +796,7 @@ TEST(JSONSchema_default_walker_2020_12, hyperschema_rel) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("rel", VOCABULARIES_2020_12_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -805,7 +805,7 @@ TEST(JSONSchema_default_walker_2020_12, hyperschema_templatePointers) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("templatePointers", VOCABULARIES_2020_12_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -814,7 +814,7 @@ TEST(JSONSchema_default_walker_2020_12, hyperschema_templateRequired) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("templateRequired", VOCABULARIES_2020_12_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -823,7 +823,7 @@ TEST(JSONSchema_default_walker_2020_12, hyperschema_targetMediaType) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("targetMediaType", VOCABULARIES_2020_12_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -832,7 +832,7 @@ TEST(JSONSchema_default_walker_2020_12, hyperschema_targetHints) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("targetHints", VOCABULARIES_2020_12_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -841,7 +841,7 @@ TEST(JSONSchema_default_walker_2020_12, hyperschema_submissionMediaType) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("submissionMediaType", VOCABULARIES_2020_12_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -850,7 +850,7 @@ TEST(JSONSchema_default_walker_2020_12, hyperschema_hrefSchema) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("hrefSchema", VOCABULARIES_2020_12_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/hyper-schema"); @@ -861,7 +861,7 @@ TEST(JSONSchema_default_walker_2020_12, hyperschema_targetSchema) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("targetSchema", VOCABULARIES_2020_12_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/hyper-schema"); @@ -872,7 +872,7 @@ TEST(JSONSchema_default_walker_2020_12, hyperschema_headerSchema) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("headerSchema", VOCABULARIES_2020_12_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/hyper-schema"); @@ -883,7 +883,7 @@ TEST(JSONSchema_default_walker_2020_12, hyperschema_submissionSchema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("submissionSchema", VOCABULARIES_2020_12_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "https://json-schema.org/draft/2019-09/vocab/hyper-schema"); @@ -893,7 +893,7 @@ TEST(JSONSchema_default_walker_2020_12, hyperschema_submissionSchema) { TEST(JSONSchema_default_walker_2020_12, applicator_allOf_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("allOf", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -901,7 +901,7 @@ TEST(JSONSchema_default_walker_2020_12, applicator_allOf_without_vocabulary) { TEST(JSONSchema_default_walker_2020_12, applicator_anyOf_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("anyOf", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -909,7 +909,7 @@ TEST(JSONSchema_default_walker_2020_12, applicator_anyOf_without_vocabulary) { TEST(JSONSchema_default_walker_2020_12, applicator_oneOf_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("oneOf", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -917,7 +917,7 @@ TEST(JSONSchema_default_walker_2020_12, applicator_oneOf_without_vocabulary) { TEST(JSONSchema_default_walker_2020_12, applicator_not_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("not", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -925,7 +925,7 @@ TEST(JSONSchema_default_walker_2020_12, applicator_not_without_vocabulary) { TEST(JSONSchema_default_walker_2020_12, applicator_if_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("if", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -933,7 +933,7 @@ TEST(JSONSchema_default_walker_2020_12, applicator_if_without_vocabulary) { TEST(JSONSchema_default_walker_2020_12, applicator_then_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("then", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -941,7 +941,7 @@ TEST(JSONSchema_default_walker_2020_12, applicator_then_without_vocabulary) { TEST(JSONSchema_default_walker_2020_12, applicator_else_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("else", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -951,7 +951,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("dependentSchemas", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -961,7 +961,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("prefixItems", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -969,7 +969,7 @@ TEST(JSONSchema_default_walker_2020_12, TEST(JSONSchema_default_walker_2020_12, applicator_items_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("items", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -979,7 +979,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("contains", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -989,7 +989,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("properties", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -999,7 +999,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("patternProperties", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1009,7 +1009,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("additionalProperties", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1019,7 +1019,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("propertyNames", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1029,7 +1029,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("unevaluatedItems", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1039,7 +1039,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("unevaluatedProperties", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1047,7 +1047,7 @@ TEST(JSONSchema_default_walker_2020_12, TEST(JSONSchema_default_walker_2020_12, validation_type_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("type", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1055,7 +1055,7 @@ TEST(JSONSchema_default_walker_2020_12, validation_type_without_vocabulary) { TEST(JSONSchema_default_walker_2020_12, validation_enum_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("enum", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1063,7 +1063,7 @@ TEST(JSONSchema_default_walker_2020_12, validation_enum_without_vocabulary) { TEST(JSONSchema_default_walker_2020_12, validation_const_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("const", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1073,7 +1073,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("multipleOf", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1082,7 +1082,7 @@ TEST(JSONSchema_default_walker_2020_12, validation_maximum_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maximum", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1091,7 +1091,7 @@ TEST(JSONSchema_default_walker_2020_12, validation_minimum_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minimum", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1101,7 +1101,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("exclusiveMaximum", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1111,7 +1111,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("exclusiveMinimum", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1121,7 +1121,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maxLength", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1131,7 +1131,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minLength", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1140,7 +1140,7 @@ TEST(JSONSchema_default_walker_2020_12, validation_pattern_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("pattern", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1150,7 +1150,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maxItems", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1160,7 +1160,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minItems", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1170,7 +1170,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("uniqueItems", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1180,7 +1180,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maxContains", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1190,7 +1190,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minContains", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1200,7 +1200,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maxProperties", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1210,7 +1210,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minProperties", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1220,7 +1220,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("required", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1230,7 +1230,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("dependentRequired", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1239,7 +1239,7 @@ TEST(JSONSchema_default_walker_2020_12, format_annotation_format_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("format", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1248,7 +1248,7 @@ TEST(JSONSchema_default_walker_2020_12, format_assertion_format_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("format", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1258,7 +1258,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("contentEncoding", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1268,7 +1268,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("contentMediaType", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1278,7 +1278,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("contentSchema", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1286,7 +1286,7 @@ TEST(JSONSchema_default_walker_2020_12, TEST(JSONSchema_default_walker_2020_12, metadata_title_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("title", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1296,7 +1296,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("description", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1305,7 +1305,7 @@ TEST(JSONSchema_default_walker_2020_12, metadata_default_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("default", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1315,7 +1315,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("deprecated", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1324,7 +1324,7 @@ TEST(JSONSchema_default_walker_2020_12, metadata_readOnly_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("readOnly", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1333,7 +1333,7 @@ TEST(JSONSchema_default_walker_2020_12, metadata_writeOnly_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("writeOnly", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1342,7 +1342,7 @@ TEST(JSONSchema_default_walker_2020_12, metadata_examples_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("examples", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1350,7 +1350,7 @@ TEST(JSONSchema_default_walker_2020_12, metadata_examples_without_vocabulary) { TEST(JSONSchema_default_walker_2020_12, hyperschema_base_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("base", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1358,7 +1358,7 @@ TEST(JSONSchema_default_walker_2020_12, hyperschema_base_without_vocabulary) { TEST(JSONSchema_default_walker_2020_12, hyperschema_links_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("links", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1366,7 +1366,7 @@ TEST(JSONSchema_default_walker_2020_12, hyperschema_links_without_vocabulary) { TEST(JSONSchema_default_walker_2020_12, hyperschema_ref_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("ref", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1374,7 +1374,7 @@ TEST(JSONSchema_default_walker_2020_12, hyperschema_ref_without_vocabulary) { TEST(JSONSchema_default_walker_2020_12, hyperschema_href_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("href", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1382,7 +1382,7 @@ TEST(JSONSchema_default_walker_2020_12, hyperschema_href_without_vocabulary) { TEST(JSONSchema_default_walker_2020_12, hyperschema_anchor_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("anchor", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1392,7 +1392,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("anchorPointer", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1400,7 +1400,7 @@ TEST(JSONSchema_default_walker_2020_12, TEST(JSONSchema_default_walker_2020_12, hyperschema_rel_without_vocabulary) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("rel", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1410,7 +1410,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("templatePointers", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1420,7 +1420,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("templateRequired", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1430,7 +1430,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("targetMediaType", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1440,7 +1440,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("targetHints", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1450,7 +1450,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("submissionMediaType", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1460,7 +1460,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("hrefSchema", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1470,7 +1470,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("targetSchema", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1480,7 +1480,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("headerSchema", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -1490,7 +1490,7 @@ TEST(JSONSchema_default_walker_2020_12, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("submissionSchema", VOCABULARIES_2020_12_CORE)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } diff --git a/test/jsonschema/jsonschema_default_walker_draft0_test.cc b/test/jsonschema/jsonschema_default_walker_draft0_test.cc index 22b42ac7a..7607fe18c 100644 --- a/test/jsonschema/jsonschema_default_walker_draft0_test.cc +++ b/test/jsonschema/jsonschema_default_walker_draft0_test.cc @@ -10,7 +10,7 @@ static const std::map VOCABULARIES_DRAFT0_HYPERSCHEMA{ TEST(JSONSchema_default_walker_draft0, schema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("$schema", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/schema#"); @@ -20,7 +20,7 @@ TEST(JSONSchema_default_walker_draft0, schema) { TEST(JSONSchema_default_walker_draft0, id) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("id", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/schema#"); @@ -30,7 +30,7 @@ TEST(JSONSchema_default_walker_draft0, id) { TEST(JSONSchema_default_walker_draft0, ref) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("$ref", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Reference); + EXPECT_EQ(result.type, KeywordType::Reference); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/schema#"); @@ -40,7 +40,7 @@ TEST(JSONSchema_default_walker_draft0, ref) { TEST(JSONSchema_default_walker_draft0, items) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("items", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueOrElements); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueOrElements); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/schema#"); @@ -50,7 +50,7 @@ TEST(JSONSchema_default_walker_draft0, items) { TEST(JSONSchema_default_walker_draft0, properties) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("properties", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorMembers); + EXPECT_EQ(result.type, KeywordType::ApplicatorMembers); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/schema#"); @@ -61,7 +61,7 @@ TEST(JSONSchema_default_walker_draft0, additionalProperties) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("additionalProperties", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/schema#"); @@ -72,7 +72,7 @@ TEST(JSONSchema_default_walker_draft0, additionalProperties) { TEST(JSONSchema_default_walker_draft0, type) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("type", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorElements); + EXPECT_EQ(result.type, KeywordType::ApplicatorElements); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/schema#"); @@ -82,7 +82,7 @@ TEST(JSONSchema_default_walker_draft0, type) { TEST(JSONSchema_default_walker_draft0, enum) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("enum", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/schema#"); @@ -92,7 +92,7 @@ TEST(JSONSchema_default_walker_draft0, enum) { TEST(JSONSchema_default_walker_draft0, maximum) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("maximum", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/schema#"); @@ -102,7 +102,7 @@ TEST(JSONSchema_default_walker_draft0, maximum) { TEST(JSONSchema_default_walker_draft0, minimum) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("minimum", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/schema#"); @@ -113,7 +113,7 @@ TEST(JSONSchema_default_walker_draft0, maximumCanEqual) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maximumCanEqual", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/schema#"); @@ -124,7 +124,7 @@ TEST(JSONSchema_default_walker_draft0, minimumCanEqual) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minimumCanEqual", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/schema#"); @@ -134,7 +134,7 @@ TEST(JSONSchema_default_walker_draft0, minimumCanEqual) { TEST(JSONSchema_default_walker_draft0, maxLength) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("maxLength", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/schema#"); @@ -144,7 +144,7 @@ TEST(JSONSchema_default_walker_draft0, maxLength) { TEST(JSONSchema_default_walker_draft0, minLength) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("minLength", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/schema#"); @@ -154,7 +154,7 @@ TEST(JSONSchema_default_walker_draft0, minLength) { TEST(JSONSchema_default_walker_draft0, pattern) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("pattern", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/schema#"); @@ -164,7 +164,7 @@ TEST(JSONSchema_default_walker_draft0, pattern) { TEST(JSONSchema_default_walker_draft0, maxItems) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("maxItems", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/schema#"); @@ -174,7 +174,7 @@ TEST(JSONSchema_default_walker_draft0, maxItems) { TEST(JSONSchema_default_walker_draft0, minItems) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("minItems", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/schema#"); @@ -184,7 +184,7 @@ TEST(JSONSchema_default_walker_draft0, minItems) { TEST(JSONSchema_default_walker_draft0, requires) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("requires", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/schema#"); @@ -194,7 +194,7 @@ TEST(JSONSchema_default_walker_draft0, requires) { TEST(JSONSchema_default_walker_draft0, format) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("format", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/schema#"); @@ -204,7 +204,7 @@ TEST(JSONSchema_default_walker_draft0, format) { TEST(JSONSchema_default_walker_draft0, title) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("title", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/schema#"); @@ -214,7 +214,7 @@ TEST(JSONSchema_default_walker_draft0, title) { TEST(JSONSchema_default_walker_draft0, description) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("description", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/schema#"); @@ -224,7 +224,7 @@ TEST(JSONSchema_default_walker_draft0, description) { TEST(JSONSchema_default_walker_draft0, default) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("default", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/schema#"); @@ -234,7 +234,7 @@ TEST(JSONSchema_default_walker_draft0, default) { TEST(JSONSchema_default_walker_draft0, disallow) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("disallow", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/schema#"); @@ -244,8 +244,7 @@ TEST(JSONSchema_default_walker_draft0, disallow) { TEST(JSONSchema_default_walker_draft0, extends) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("extends", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, - SchemaWalkerStrategy::ApplicatorValueOrElementsInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueOrElementsInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/schema#"); @@ -256,7 +255,7 @@ TEST(JSONSchema_default_walker_draft0, contentEncoding) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("contentEncoding", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/schema#"); @@ -266,7 +265,7 @@ TEST(JSONSchema_default_walker_draft0, contentEncoding) { TEST(JSONSchema_default_walker_draft0, optional) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("optional", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/schema#"); @@ -276,7 +275,7 @@ TEST(JSONSchema_default_walker_draft0, optional) { TEST(JSONSchema_default_walker_draft0, maxDecimal) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("maxDecimal", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/schema#"); @@ -287,7 +286,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_links) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("links", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -296,7 +295,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_fragmentResolution) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("fragmentResolution", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -305,7 +304,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_root) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("root", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -314,7 +313,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_readonly) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("readonly", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -323,7 +322,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_pathStart) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("pathStart", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -332,7 +331,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_mediaType) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("mediaType", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -341,7 +340,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_alternate) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("alternate", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -350,7 +349,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_href) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("href", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -359,7 +358,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_rel) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("rel", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -368,7 +367,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_method) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("method", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -377,7 +376,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_enctype) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("enctype", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -386,7 +385,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_schema) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("$schema", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -395,7 +394,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_id) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("id", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -404,7 +403,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_ref) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("$ref", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -413,7 +412,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_items) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("items", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueOrElements); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueOrElements); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/hyper-schema#"); @@ -424,7 +423,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_properties) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("properties", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorMembers); + EXPECT_EQ(result.type, KeywordType::ApplicatorMembers); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/hyper-schema#"); @@ -435,7 +434,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_additionalProperties) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("additionalProperties", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/hyper-schema#"); @@ -447,7 +446,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_type) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("type", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorElements); + EXPECT_EQ(result.type, KeywordType::ApplicatorElements); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/hyper-schema#"); @@ -458,7 +457,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_enum) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("enum", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -467,7 +466,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_maximum) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maximum", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -476,7 +475,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_minimum) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minimum", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -485,7 +484,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_maximumCanEqual) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("maximumCanEqual", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -494,7 +493,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_minimumCanEqual) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("minimumCanEqual", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -503,7 +502,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_maxLength) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maxLength", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -512,7 +511,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_minLength) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minLength", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -521,7 +520,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_pattern) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("pattern", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -530,7 +529,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_maxItems) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maxItems", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -539,7 +538,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_minItems) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minItems", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -548,7 +547,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_requires) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("requires", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/hyper-schema#"); @@ -559,7 +558,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_format) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("format", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -568,7 +567,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_title) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("title", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -577,7 +576,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_description) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("description", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -586,7 +585,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_default) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("default", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -595,7 +594,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_disallow) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("disallow", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -604,8 +603,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_extends) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("extends", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, - SchemaWalkerStrategy::ApplicatorValueOrElementsInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueOrElementsInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-00/hyper-schema#"); @@ -616,7 +614,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_contentEncoding) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("contentEncoding", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -625,7 +623,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_optional) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("optional", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -634,7 +632,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_maxDecimal) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maxDecimal", VOCABULARIES_DRAFT0_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -642,7 +640,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_maxDecimal) { TEST(JSONSchema_default_walker_draft0, hyperschema_links_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("links", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -652,7 +650,7 @@ TEST(JSONSchema_default_walker_draft0, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("fragmentResolution", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -660,7 +658,7 @@ TEST(JSONSchema_default_walker_draft0, TEST(JSONSchema_default_walker_draft0, hyperschema_root_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("root", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -669,7 +667,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_readonly_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("readonly", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -678,7 +676,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_pathStart_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("pathStart", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -687,7 +685,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_mediaType_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("mediaType", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -696,7 +694,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_alternate_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("alternate", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -704,7 +702,7 @@ TEST(JSONSchema_default_walker_draft0, TEST(JSONSchema_default_walker_draft0, hyperschema_href_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("href", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -712,7 +710,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_href_without_hyperschema) { TEST(JSONSchema_default_walker_draft0, hyperschema_rel_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("rel", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -720,7 +718,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_rel_without_hyperschema) { TEST(JSONSchema_default_walker_draft0, hyperschema_method_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("method", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -729,7 +727,7 @@ TEST(JSONSchema_default_walker_draft0, hyperschema_enctype_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("enctype", VOCABULARIES_DRAFT0)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } diff --git a/test/jsonschema/jsonschema_default_walker_draft1_test.cc b/test/jsonschema/jsonschema_default_walker_draft1_test.cc index 2fe18ff1a..762da2589 100644 --- a/test/jsonschema/jsonschema_default_walker_draft1_test.cc +++ b/test/jsonschema/jsonschema_default_walker_draft1_test.cc @@ -10,7 +10,7 @@ static const std::map VOCABULARIES_DRAFT1_HYPERSCHEMA{ TEST(JSONSchema_default_walker_draft1, schema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("$schema", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/schema#"); @@ -20,7 +20,7 @@ TEST(JSONSchema_default_walker_draft1, schema) { TEST(JSONSchema_default_walker_draft1, id) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("id", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/schema#"); @@ -30,7 +30,7 @@ TEST(JSONSchema_default_walker_draft1, id) { TEST(JSONSchema_default_walker_draft1, ref) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("$ref", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Reference); + EXPECT_EQ(result.type, KeywordType::Reference); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/schema#"); @@ -40,7 +40,7 @@ TEST(JSONSchema_default_walker_draft1, ref) { TEST(JSONSchema_default_walker_draft1, items) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("items", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueOrElements); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueOrElements); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/schema#"); @@ -50,7 +50,7 @@ TEST(JSONSchema_default_walker_draft1, items) { TEST(JSONSchema_default_walker_draft1, properties) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("properties", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorMembers); + EXPECT_EQ(result.type, KeywordType::ApplicatorMembers); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/schema#"); @@ -61,7 +61,7 @@ TEST(JSONSchema_default_walker_draft1, additionalProperties) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("additionalProperties", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/schema#"); @@ -72,7 +72,7 @@ TEST(JSONSchema_default_walker_draft1, additionalProperties) { TEST(JSONSchema_default_walker_draft1, type) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("type", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorElements); + EXPECT_EQ(result.type, KeywordType::ApplicatorElements); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/schema#"); @@ -82,7 +82,7 @@ TEST(JSONSchema_default_walker_draft1, type) { TEST(JSONSchema_default_walker_draft1, enum) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("enum", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/schema#"); @@ -92,7 +92,7 @@ TEST(JSONSchema_default_walker_draft1, enum) { TEST(JSONSchema_default_walker_draft1, maximum) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("maximum", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/schema#"); @@ -102,7 +102,7 @@ TEST(JSONSchema_default_walker_draft1, maximum) { TEST(JSONSchema_default_walker_draft1, minimum) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("minimum", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/schema#"); @@ -113,7 +113,7 @@ TEST(JSONSchema_default_walker_draft1, maximumCanEqual) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maximumCanEqual", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/schema#"); @@ -124,7 +124,7 @@ TEST(JSONSchema_default_walker_draft1, minimumCanEqual) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minimumCanEqual", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/schema#"); @@ -134,7 +134,7 @@ TEST(JSONSchema_default_walker_draft1, minimumCanEqual) { TEST(JSONSchema_default_walker_draft1, maxLength) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("maxLength", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/schema#"); @@ -144,7 +144,7 @@ TEST(JSONSchema_default_walker_draft1, maxLength) { TEST(JSONSchema_default_walker_draft1, minLength) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("minLength", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/schema#"); @@ -154,7 +154,7 @@ TEST(JSONSchema_default_walker_draft1, minLength) { TEST(JSONSchema_default_walker_draft1, pattern) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("pattern", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/schema#"); @@ -164,7 +164,7 @@ TEST(JSONSchema_default_walker_draft1, pattern) { TEST(JSONSchema_default_walker_draft1, maxItems) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("maxItems", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/schema#"); @@ -174,7 +174,7 @@ TEST(JSONSchema_default_walker_draft1, maxItems) { TEST(JSONSchema_default_walker_draft1, minItems) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("minItems", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/schema#"); @@ -184,7 +184,7 @@ TEST(JSONSchema_default_walker_draft1, minItems) { TEST(JSONSchema_default_walker_draft1, requires) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("requires", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/schema#"); @@ -194,7 +194,7 @@ TEST(JSONSchema_default_walker_draft1, requires) { TEST(JSONSchema_default_walker_draft1, format) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("format", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/schema#"); @@ -204,7 +204,7 @@ TEST(JSONSchema_default_walker_draft1, format) { TEST(JSONSchema_default_walker_draft1, title) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("title", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/schema#"); @@ -214,7 +214,7 @@ TEST(JSONSchema_default_walker_draft1, title) { TEST(JSONSchema_default_walker_draft1, description) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("description", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/schema#"); @@ -224,7 +224,7 @@ TEST(JSONSchema_default_walker_draft1, description) { TEST(JSONSchema_default_walker_draft1, default) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("default", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/schema#"); @@ -234,7 +234,7 @@ TEST(JSONSchema_default_walker_draft1, default) { TEST(JSONSchema_default_walker_draft1, disallow) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("disallow", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/schema#"); @@ -244,8 +244,7 @@ TEST(JSONSchema_default_walker_draft1, disallow) { TEST(JSONSchema_default_walker_draft1, extends) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("extends", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, - SchemaWalkerStrategy::ApplicatorValueOrElementsInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueOrElementsInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/schema#"); @@ -256,7 +255,7 @@ TEST(JSONSchema_default_walker_draft1, contentEncoding) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("contentEncoding", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/schema#"); @@ -266,7 +265,7 @@ TEST(JSONSchema_default_walker_draft1, contentEncoding) { TEST(JSONSchema_default_walker_draft1, optional) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("optional", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/schema#"); @@ -276,7 +275,7 @@ TEST(JSONSchema_default_walker_draft1, optional) { TEST(JSONSchema_default_walker_draft1, maxDecimal) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("maxDecimal", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/schema#"); @@ -287,7 +286,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_links) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("links", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -296,7 +295,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_fragmentResolution) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("fragmentResolution", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -305,7 +304,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_root) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("root", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -314,7 +313,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_readonly) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("readonly", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -323,7 +322,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_pathStart) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("pathStart", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -332,7 +331,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_mediaType) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("mediaType", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -341,7 +340,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_alternate) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("alternate", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -350,7 +349,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_href) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("href", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -359,7 +358,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_rel) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("rel", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -368,7 +367,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_method) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("method", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -377,7 +376,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_enctype) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("enctype", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -386,7 +385,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_schema) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("$schema", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -395,7 +394,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_id) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("id", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -404,7 +403,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_ref) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("$ref", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -413,7 +412,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_items) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("items", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueOrElements); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueOrElements); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/hyper-schema#"); @@ -424,7 +423,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_properties) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("properties", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorMembers); + EXPECT_EQ(result.type, KeywordType::ApplicatorMembers); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/hyper-schema#"); @@ -435,7 +434,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_additionalProperties) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("additionalProperties", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/hyper-schema#"); @@ -447,7 +446,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_type) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("type", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorElements); + EXPECT_EQ(result.type, KeywordType::ApplicatorElements); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/hyper-schema#"); @@ -458,7 +457,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_enum) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("enum", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -467,7 +466,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_maximum) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maximum", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -476,7 +475,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_minimum) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minimum", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -485,7 +484,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_maximumCanEqual) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("maximumCanEqual", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -494,7 +493,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_minimumCanEqual) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("minimumCanEqual", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -503,7 +502,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_maxLength) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maxLength", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -512,7 +511,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_minLength) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minLength", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -521,7 +520,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_pattern) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("pattern", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -530,7 +529,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_maxItems) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maxItems", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -539,7 +538,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_minItems) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minItems", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -548,7 +547,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_requires) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("requires", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/hyper-schema#"); @@ -559,7 +558,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_format) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("format", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -568,7 +567,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_title) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("title", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -577,7 +576,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_description) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("description", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -586,7 +585,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_default) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("default", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -595,7 +594,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_disallow) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("disallow", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -604,8 +603,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_extends) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("extends", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, - SchemaWalkerStrategy::ApplicatorValueOrElementsInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueOrElementsInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-01/hyper-schema#"); @@ -616,7 +614,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_contentEncoding) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("contentEncoding", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -625,7 +623,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_optional) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("optional", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -634,7 +632,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_maxDecimal) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maxDecimal", VOCABULARIES_DRAFT1_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -642,7 +640,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_maxDecimal) { TEST(JSONSchema_default_walker_draft1, hyperschema_links_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("links", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -652,7 +650,7 @@ TEST(JSONSchema_default_walker_draft1, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("fragmentResolution", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -660,7 +658,7 @@ TEST(JSONSchema_default_walker_draft1, TEST(JSONSchema_default_walker_draft1, hyperschema_root_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("root", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -669,7 +667,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_readonly_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("readonly", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -678,7 +676,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_pathStart_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("pathStart", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -687,7 +685,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_mediaType_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("mediaType", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -696,7 +694,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_alternate_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("alternate", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -704,7 +702,7 @@ TEST(JSONSchema_default_walker_draft1, TEST(JSONSchema_default_walker_draft1, hyperschema_href_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("href", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -712,7 +710,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_href_without_hyperschema) { TEST(JSONSchema_default_walker_draft1, hyperschema_rel_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("rel", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -720,7 +718,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_rel_without_hyperschema) { TEST(JSONSchema_default_walker_draft1, hyperschema_method_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("method", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -729,7 +727,7 @@ TEST(JSONSchema_default_walker_draft1, hyperschema_enctype_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("enctype", VOCABULARIES_DRAFT1)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } diff --git a/test/jsonschema/jsonschema_default_walker_draft2_test.cc b/test/jsonschema/jsonschema_default_walker_draft2_test.cc index 9d6e0156f..d2fb90fb7 100644 --- a/test/jsonschema/jsonschema_default_walker_draft2_test.cc +++ b/test/jsonschema/jsonschema_default_walker_draft2_test.cc @@ -10,7 +10,7 @@ static const std::map VOCABULARIES_DRAFT2_HYPERSCHEMA{ TEST(JSONSchema_default_walker_draft2, schema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("$schema", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/schema#"); @@ -20,7 +20,7 @@ TEST(JSONSchema_default_walker_draft2, schema) { TEST(JSONSchema_default_walker_draft2, id) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("id", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/schema#"); @@ -30,7 +30,7 @@ TEST(JSONSchema_default_walker_draft2, id) { TEST(JSONSchema_default_walker_draft2, ref) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("$ref", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Reference); + EXPECT_EQ(result.type, KeywordType::Reference); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/schema#"); @@ -40,7 +40,7 @@ TEST(JSONSchema_default_walker_draft2, ref) { TEST(JSONSchema_default_walker_draft2, items) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("items", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueOrElements); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueOrElements); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/schema#"); @@ -50,7 +50,7 @@ TEST(JSONSchema_default_walker_draft2, items) { TEST(JSONSchema_default_walker_draft2, properties) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("properties", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorMembers); + EXPECT_EQ(result.type, KeywordType::ApplicatorMembers); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/schema#"); @@ -61,7 +61,7 @@ TEST(JSONSchema_default_walker_draft2, additionalProperties) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("additionalProperties", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/schema#"); @@ -72,7 +72,7 @@ TEST(JSONSchema_default_walker_draft2, additionalProperties) { TEST(JSONSchema_default_walker_draft2, type) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("type", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorElements); + EXPECT_EQ(result.type, KeywordType::ApplicatorElements); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/schema#"); @@ -82,7 +82,7 @@ TEST(JSONSchema_default_walker_draft2, type) { TEST(JSONSchema_default_walker_draft2, enum) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("enum", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/schema#"); @@ -92,7 +92,7 @@ TEST(JSONSchema_default_walker_draft2, enum) { TEST(JSONSchema_default_walker_draft2, maximum) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("maximum", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/schema#"); @@ -102,7 +102,7 @@ TEST(JSONSchema_default_walker_draft2, maximum) { TEST(JSONSchema_default_walker_draft2, minimum) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("minimum", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/schema#"); @@ -113,7 +113,7 @@ TEST(JSONSchema_default_walker_draft2, maximumCanEqual) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maximumCanEqual", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/schema#"); @@ -124,7 +124,7 @@ TEST(JSONSchema_default_walker_draft2, minimumCanEqual) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minimumCanEqual", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/schema#"); @@ -134,7 +134,7 @@ TEST(JSONSchema_default_walker_draft2, minimumCanEqual) { TEST(JSONSchema_default_walker_draft2, maxLength) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("maxLength", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/schema#"); @@ -144,7 +144,7 @@ TEST(JSONSchema_default_walker_draft2, maxLength) { TEST(JSONSchema_default_walker_draft2, minLength) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("minLength", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/schema#"); @@ -154,7 +154,7 @@ TEST(JSONSchema_default_walker_draft2, minLength) { TEST(JSONSchema_default_walker_draft2, pattern) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("pattern", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/schema#"); @@ -164,7 +164,7 @@ TEST(JSONSchema_default_walker_draft2, pattern) { TEST(JSONSchema_default_walker_draft2, maxItems) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("maxItems", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/schema#"); @@ -174,7 +174,7 @@ TEST(JSONSchema_default_walker_draft2, maxItems) { TEST(JSONSchema_default_walker_draft2, minItems) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("minItems", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/schema#"); @@ -184,7 +184,7 @@ TEST(JSONSchema_default_walker_draft2, minItems) { TEST(JSONSchema_default_walker_draft2, uniqueItems) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("uniqueItems", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/schema#"); @@ -194,7 +194,7 @@ TEST(JSONSchema_default_walker_draft2, uniqueItems) { TEST(JSONSchema_default_walker_draft2, requires) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("requires", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/schema#"); @@ -204,7 +204,7 @@ TEST(JSONSchema_default_walker_draft2, requires) { TEST(JSONSchema_default_walker_draft2, format) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("format", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/schema#"); @@ -214,7 +214,7 @@ TEST(JSONSchema_default_walker_draft2, format) { TEST(JSONSchema_default_walker_draft2, title) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("title", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/schema#"); @@ -224,7 +224,7 @@ TEST(JSONSchema_default_walker_draft2, title) { TEST(JSONSchema_default_walker_draft2, description) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("description", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/schema#"); @@ -234,7 +234,7 @@ TEST(JSONSchema_default_walker_draft2, description) { TEST(JSONSchema_default_walker_draft2, default) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("default", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/schema#"); @@ -244,7 +244,7 @@ TEST(JSONSchema_default_walker_draft2, default) { TEST(JSONSchema_default_walker_draft2, divisibleBy) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("divisibleBy", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/schema#"); @@ -254,7 +254,7 @@ TEST(JSONSchema_default_walker_draft2, divisibleBy) { TEST(JSONSchema_default_walker_draft2, disallow) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("disallow", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/schema#"); @@ -264,8 +264,7 @@ TEST(JSONSchema_default_walker_draft2, disallow) { TEST(JSONSchema_default_walker_draft2, extends) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("extends", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, - SchemaWalkerStrategy::ApplicatorValueOrElementsInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueOrElementsInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/schema#"); @@ -276,7 +275,7 @@ TEST(JSONSchema_default_walker_draft2, contentEncoding) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("contentEncoding", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/schema#"); @@ -287,7 +286,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_links) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("links", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -296,7 +295,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_fragmentResolution) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("fragmentResolution", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -305,7 +304,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_root) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("root", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -314,7 +313,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_readonly) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("readonly", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -323,7 +322,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_pathStart) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("pathStart", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -332,7 +331,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_mediaType) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("mediaType", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -341,7 +340,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_alternate) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("alternate", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -350,7 +349,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_href) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("href", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -359,7 +358,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_rel) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("rel", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -368,7 +367,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_method) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("method", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -377,7 +376,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_enctype) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("enctype", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -386,7 +385,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_targetSchema) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("targetSchema", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/hyper-schema#"); @@ -396,7 +395,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_targetSchema) { TEST(JSONSchema_default_walker_draft2, hyperschema_links_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("links", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -405,7 +404,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_schema) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("$schema", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -414,7 +413,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_id) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("id", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -423,7 +422,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_ref) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("$ref", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -432,7 +431,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_items) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("items", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueOrElements); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueOrElements); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/hyper-schema#"); @@ -443,7 +442,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_properties) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("properties", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorMembers); + EXPECT_EQ(result.type, KeywordType::ApplicatorMembers); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/hyper-schema#"); @@ -454,7 +453,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_additionalProperties) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("additionalProperties", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/hyper-schema#"); @@ -466,7 +465,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_type) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("type", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorElements); + EXPECT_EQ(result.type, KeywordType::ApplicatorElements); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/hyper-schema#"); @@ -477,7 +476,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_enum) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("enum", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -486,7 +485,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_maximum) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maximum", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -495,7 +494,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_minimum) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minimum", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -504,7 +503,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_maximumCanEqual) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("maximumCanEqual", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -513,7 +512,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_minimumCanEqual) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("minimumCanEqual", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -522,7 +521,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_maxLength) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maxLength", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -531,7 +530,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_minLength) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minLength", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -540,7 +539,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_pattern) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("pattern", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -549,7 +548,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_maxItems) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maxItems", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -558,7 +557,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_minItems) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minItems", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -567,7 +566,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_uniqueItems) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("uniqueItems", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -576,7 +575,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_requires) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("requires", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/hyper-schema#"); @@ -587,7 +586,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_format) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("format", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -596,7 +595,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_title) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("title", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -605,7 +604,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_description) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("description", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -614,7 +613,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_default) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("default", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -623,7 +622,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_divisibleBy) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("divisibleBy", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -632,7 +631,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_disallow) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("disallow", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -641,8 +640,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_extends) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("extends", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, - SchemaWalkerStrategy::ApplicatorValueOrElementsInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueOrElementsInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-02/hyper-schema#"); @@ -653,7 +651,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_contentEncoding) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("contentEncoding", VOCABULARIES_DRAFT2_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -663,7 +661,7 @@ TEST(JSONSchema_default_walker_draft2, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("fragmentResolution", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -671,7 +669,7 @@ TEST(JSONSchema_default_walker_draft2, TEST(JSONSchema_default_walker_draft2, hyperschema_root_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("root", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -680,7 +678,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_readonly_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("readonly", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -689,7 +687,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_pathStart_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("pathStart", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -698,7 +696,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_mediaType_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("mediaType", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -707,7 +705,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_alternate_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("alternate", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -715,7 +713,7 @@ TEST(JSONSchema_default_walker_draft2, TEST(JSONSchema_default_walker_draft2, hyperschema_href_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("href", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -723,7 +721,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_href_without_hyperschema) { TEST(JSONSchema_default_walker_draft2, hyperschema_rel_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("rel", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -731,7 +729,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_rel_without_hyperschema) { TEST(JSONSchema_default_walker_draft2, hyperschema_method_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("method", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -740,7 +738,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_enctype_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("enctype", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -749,7 +747,7 @@ TEST(JSONSchema_default_walker_draft2, hyperschema_targetSchema_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("targetSchema", VOCABULARIES_DRAFT2)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } diff --git a/test/jsonschema/jsonschema_default_walker_draft3_test.cc b/test/jsonschema/jsonschema_default_walker_draft3_test.cc index 6a8e57fe2..e5ab4359e 100644 --- a/test/jsonschema/jsonschema_default_walker_draft3_test.cc +++ b/test/jsonschema/jsonschema_default_walker_draft3_test.cc @@ -10,7 +10,7 @@ static const std::map VOCABULARIES_DRAFT3_HYPERSCHEMA{ TEST(JSONSchema_default_walker_draft3, schema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("$schema", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/schema#"); @@ -21,7 +21,7 @@ TEST(JSONSchema_default_walker_draft3, schema) { TEST(JSONSchema_default_walker_draft3, id) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("id", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/schema#"); @@ -32,7 +32,7 @@ TEST(JSONSchema_default_walker_draft3, id) { TEST(JSONSchema_default_walker_draft3, ref) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("$ref", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Reference); + EXPECT_EQ(result.type, KeywordType::Reference); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/schema#"); @@ -42,7 +42,7 @@ TEST(JSONSchema_default_walker_draft3, ref) { TEST(JSONSchema_default_walker_draft3, items) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("items", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueOrElements); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueOrElements); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/schema#"); @@ -54,7 +54,7 @@ TEST(JSONSchema_default_walker_draft3, additionalItems) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("additionalItems", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/schema#"); @@ -65,7 +65,7 @@ TEST(JSONSchema_default_walker_draft3, additionalItems) { TEST(JSONSchema_default_walker_draft3, properties) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("properties", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorMembers); + EXPECT_EQ(result.type, KeywordType::ApplicatorMembers); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/schema#"); @@ -77,7 +77,7 @@ TEST(JSONSchema_default_walker_draft3, patternProperties) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("patternProperties", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorMembers); + EXPECT_EQ(result.type, KeywordType::ApplicatorMembers); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/schema#"); @@ -88,7 +88,7 @@ TEST(JSONSchema_default_walker_draft3, patternProperties) { TEST(JSONSchema_default_walker_draft3, dependencies) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("dependencies", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorMembers); + EXPECT_EQ(result.type, KeywordType::ApplicatorMembers); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/schema#"); @@ -100,7 +100,7 @@ TEST(JSONSchema_default_walker_draft3, additionalProperties) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("additionalProperties", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/schema#"); @@ -111,7 +111,7 @@ TEST(JSONSchema_default_walker_draft3, additionalProperties) { TEST(JSONSchema_default_walker_draft3, type) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("type", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorElements); + EXPECT_EQ(result.type, KeywordType::ApplicatorElements); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/schema#"); @@ -122,7 +122,7 @@ TEST(JSONSchema_default_walker_draft3, type) { TEST(JSONSchema_default_walker_draft3, enum) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("enum", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/schema#"); @@ -133,7 +133,7 @@ TEST(JSONSchema_default_walker_draft3, enum) { TEST(JSONSchema_default_walker_draft3, maximum) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("maximum", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/schema#"); @@ -144,7 +144,7 @@ TEST(JSONSchema_default_walker_draft3, maximum) { TEST(JSONSchema_default_walker_draft3, minimum) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("minimum", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/schema#"); @@ -156,7 +156,7 @@ TEST(JSONSchema_default_walker_draft3, exclusiveMaximum) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("exclusiveMaximum", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/schema#"); @@ -168,7 +168,7 @@ TEST(JSONSchema_default_walker_draft3, exclusiveMinimum) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("exclusiveMinimum", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/schema#"); @@ -179,7 +179,7 @@ TEST(JSONSchema_default_walker_draft3, exclusiveMinimum) { TEST(JSONSchema_default_walker_draft3, maxLength) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("maxLength", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/schema#"); @@ -190,7 +190,7 @@ TEST(JSONSchema_default_walker_draft3, maxLength) { TEST(JSONSchema_default_walker_draft3, minLength) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("minLength", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/schema#"); @@ -201,7 +201,7 @@ TEST(JSONSchema_default_walker_draft3, minLength) { TEST(JSONSchema_default_walker_draft3, pattern) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("pattern", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/schema#"); @@ -212,7 +212,7 @@ TEST(JSONSchema_default_walker_draft3, pattern) { TEST(JSONSchema_default_walker_draft3, maxItems) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("maxItems", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/schema#"); @@ -223,7 +223,7 @@ TEST(JSONSchema_default_walker_draft3, maxItems) { TEST(JSONSchema_default_walker_draft3, minItems) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("minItems", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/schema#"); @@ -234,7 +234,7 @@ TEST(JSONSchema_default_walker_draft3, minItems) { TEST(JSONSchema_default_walker_draft3, uniqueItems) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("uniqueItems", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/schema#"); @@ -245,7 +245,7 @@ TEST(JSONSchema_default_walker_draft3, uniqueItems) { TEST(JSONSchema_default_walker_draft3, required) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("required", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/schema#"); @@ -256,7 +256,7 @@ TEST(JSONSchema_default_walker_draft3, required) { TEST(JSONSchema_default_walker_draft3, format) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("format", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/schema#"); @@ -267,7 +267,7 @@ TEST(JSONSchema_default_walker_draft3, format) { TEST(JSONSchema_default_walker_draft3, title) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("title", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/schema#"); @@ -278,7 +278,7 @@ TEST(JSONSchema_default_walker_draft3, title) { TEST(JSONSchema_default_walker_draft3, description) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("description", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/schema#"); @@ -289,7 +289,7 @@ TEST(JSONSchema_default_walker_draft3, description) { TEST(JSONSchema_default_walker_draft3, default) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("default", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/schema#"); @@ -300,7 +300,7 @@ TEST(JSONSchema_default_walker_draft3, default) { TEST(JSONSchema_default_walker_draft3, divisibleBy) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("divisibleBy", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/schema#"); @@ -311,7 +311,7 @@ TEST(JSONSchema_default_walker_draft3, divisibleBy) { TEST(JSONSchema_default_walker_draft3, disallow) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("disallow", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorElementsInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorElementsInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/schema#"); @@ -322,8 +322,7 @@ TEST(JSONSchema_default_walker_draft3, disallow) { TEST(JSONSchema_default_walker_draft3, extends) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("extends", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, - SchemaWalkerStrategy::ApplicatorValueOrElementsInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueOrElementsInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/schema#"); @@ -335,7 +334,7 @@ TEST(JSONSchema_default_walker_draft3, hyperschema_links) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("links", VOCABULARIES_DRAFT3_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -344,7 +343,7 @@ TEST(JSONSchema_default_walker_draft3, hyperschema_fragmentResolution) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("fragmentResolution", VOCABULARIES_DRAFT3_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -353,7 +352,7 @@ TEST(JSONSchema_default_walker_draft3, hyperschema_root) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("root", VOCABULARIES_DRAFT3_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -362,7 +361,7 @@ TEST(JSONSchema_default_walker_draft3, hyperschema_readonly) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("readonly", VOCABULARIES_DRAFT3_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -371,7 +370,7 @@ TEST(JSONSchema_default_walker_draft3, hyperschema_contentEncoding) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("contentEncoding", VOCABULARIES_DRAFT3_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -380,7 +379,7 @@ TEST(JSONSchema_default_walker_draft3, hyperschema_pathStart) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("pathStart", VOCABULARIES_DRAFT3_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -389,7 +388,7 @@ TEST(JSONSchema_default_walker_draft3, hyperschema_mediaType) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("mediaType", VOCABULARIES_DRAFT3_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -398,7 +397,7 @@ TEST(JSONSchema_default_walker_draft3, hyperschema_alternate) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("alternate", VOCABULARIES_DRAFT3_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -407,7 +406,7 @@ TEST(JSONSchema_default_walker_draft3, hyperschema_href) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("href", VOCABULARIES_DRAFT3_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -416,7 +415,7 @@ TEST(JSONSchema_default_walker_draft3, hyperschema_rel) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("rel", VOCABULARIES_DRAFT3_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -425,7 +424,7 @@ TEST(JSONSchema_default_walker_draft3, hyperschema_method) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("method", VOCABULARIES_DRAFT3_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -434,7 +433,7 @@ TEST(JSONSchema_default_walker_draft3, hyperschema_enctype) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("enctype", VOCABULARIES_DRAFT3_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -443,7 +442,7 @@ TEST(JSONSchema_default_walker_draft3, hyperschema_targetSchema) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("targetSchema", VOCABULARIES_DRAFT3_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-03/hyper-schema#"); @@ -453,7 +452,7 @@ TEST(JSONSchema_default_walker_draft3, hyperschema_targetSchema) { TEST(JSONSchema_default_walker_draft3, hyperschema_links_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("links", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -464,7 +463,7 @@ TEST(JSONSchema_default_walker_draft3, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("fragmentResolution", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -473,7 +472,7 @@ TEST(JSONSchema_default_walker_draft3, TEST(JSONSchema_default_walker_draft3, hyperschema_root_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("root", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -483,7 +482,7 @@ TEST(JSONSchema_default_walker_draft3, hyperschema_readonly_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("readonly", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -494,7 +493,7 @@ TEST(JSONSchema_default_walker_draft3, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("contentEncoding", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -504,7 +503,7 @@ TEST(JSONSchema_default_walker_draft3, hyperschema_pathStart_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("pathStart", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -514,7 +513,7 @@ TEST(JSONSchema_default_walker_draft3, hyperschema_mediaType_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("mediaType", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -524,7 +523,7 @@ TEST(JSONSchema_default_walker_draft3, hyperschema_alternate_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("alternate", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -533,7 +532,7 @@ TEST(JSONSchema_default_walker_draft3, TEST(JSONSchema_default_walker_draft3, hyperschema_href_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("href", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -542,7 +541,7 @@ TEST(JSONSchema_default_walker_draft3, hyperschema_href_without_hyperschema) { TEST(JSONSchema_default_walker_draft3, hyperschema_rel_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("rel", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -551,7 +550,7 @@ TEST(JSONSchema_default_walker_draft3, hyperschema_rel_without_hyperschema) { TEST(JSONSchema_default_walker_draft3, hyperschema_method_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("method", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -561,7 +560,7 @@ TEST(JSONSchema_default_walker_draft3, hyperschema_enctype_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("enctype", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -571,7 +570,7 @@ TEST(JSONSchema_default_walker_draft3, hyperschema_targetSchema_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("targetSchema", VOCABULARIES_DRAFT3)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); diff --git a/test/jsonschema/jsonschema_default_walker_draft4_test.cc b/test/jsonschema/jsonschema_default_walker_draft4_test.cc index d4b2babcb..d081cff7e 100644 --- a/test/jsonschema/jsonschema_default_walker_draft4_test.cc +++ b/test/jsonschema/jsonschema_default_walker_draft4_test.cc @@ -10,7 +10,7 @@ static const std::map VOCABULARIES_DRAFT4_HYPERSCHEMA{ TEST(JSONSchema_default_walker_draft4, schema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("$schema", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -21,7 +21,7 @@ TEST(JSONSchema_default_walker_draft4, schema) { TEST(JSONSchema_default_walker_draft4, id) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("id", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -32,7 +32,7 @@ TEST(JSONSchema_default_walker_draft4, id) { TEST(JSONSchema_default_walker_draft4, ref) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("$ref", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Reference); + EXPECT_EQ(result.type, KeywordType::Reference); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -42,7 +42,7 @@ TEST(JSONSchema_default_walker_draft4, ref) { TEST(JSONSchema_default_walker_draft4, definitions) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("definitions", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::LocationMembers); + EXPECT_EQ(result.type, KeywordType::LocationMembers); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -53,7 +53,7 @@ TEST(JSONSchema_default_walker_draft4, definitions) { TEST(JSONSchema_default_walker_draft4, allOf) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("allOf", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorElementsInline); + EXPECT_EQ(result.type, KeywordType::ApplicatorElementsInline); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -64,7 +64,7 @@ TEST(JSONSchema_default_walker_draft4, allOf) { TEST(JSONSchema_default_walker_draft4, anyOf) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("anyOf", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorElementsInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorElementsInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -75,7 +75,7 @@ TEST(JSONSchema_default_walker_draft4, anyOf) { TEST(JSONSchema_default_walker_draft4, oneOf) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("oneOf", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorElementsInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorElementsInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -86,7 +86,7 @@ TEST(JSONSchema_default_walker_draft4, oneOf) { TEST(JSONSchema_default_walker_draft4, not) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("not", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueOther); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueOther); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -97,7 +97,7 @@ TEST(JSONSchema_default_walker_draft4, not) { TEST(JSONSchema_default_walker_draft4, items) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("items", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueOrElements); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueOrElements); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -109,7 +109,7 @@ TEST(JSONSchema_default_walker_draft4, additionalItems) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("additionalItems", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -120,7 +120,7 @@ TEST(JSONSchema_default_walker_draft4, additionalItems) { TEST(JSONSchema_default_walker_draft4, properties) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("properties", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorMembers); + EXPECT_EQ(result.type, KeywordType::ApplicatorMembers); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -132,7 +132,7 @@ TEST(JSONSchema_default_walker_draft4, patternProperties) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("patternProperties", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorMembers); + EXPECT_EQ(result.type, KeywordType::ApplicatorMembers); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -143,7 +143,7 @@ TEST(JSONSchema_default_walker_draft4, patternProperties) { TEST(JSONSchema_default_walker_draft4, dependencies) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("dependencies", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorMembers); + EXPECT_EQ(result.type, KeywordType::ApplicatorMembers); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -155,7 +155,7 @@ TEST(JSONSchema_default_walker_draft4, additionalProperties) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("additionalProperties", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -166,7 +166,7 @@ TEST(JSONSchema_default_walker_draft4, additionalProperties) { TEST(JSONSchema_default_walker_draft4, type) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("type", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -177,7 +177,7 @@ TEST(JSONSchema_default_walker_draft4, type) { TEST(JSONSchema_default_walker_draft4, enum) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("enum", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -188,7 +188,7 @@ TEST(JSONSchema_default_walker_draft4, enum) { TEST(JSONSchema_default_walker_draft4, multipleOf) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("multipleOf", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -199,7 +199,7 @@ TEST(JSONSchema_default_walker_draft4, multipleOf) { TEST(JSONSchema_default_walker_draft4, maximum) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("maximum", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -210,7 +210,7 @@ TEST(JSONSchema_default_walker_draft4, maximum) { TEST(JSONSchema_default_walker_draft4, minimum) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("minimum", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -222,7 +222,7 @@ TEST(JSONSchema_default_walker_draft4, exclusiveMaximum) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("exclusiveMaximum", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -234,7 +234,7 @@ TEST(JSONSchema_default_walker_draft4, exclusiveMinimum) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("exclusiveMinimum", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -245,7 +245,7 @@ TEST(JSONSchema_default_walker_draft4, exclusiveMinimum) { TEST(JSONSchema_default_walker_draft4, maxLength) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("maxLength", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -256,7 +256,7 @@ TEST(JSONSchema_default_walker_draft4, maxLength) { TEST(JSONSchema_default_walker_draft4, minLength) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("minLength", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -267,7 +267,7 @@ TEST(JSONSchema_default_walker_draft4, minLength) { TEST(JSONSchema_default_walker_draft4, pattern) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("pattern", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -278,7 +278,7 @@ TEST(JSONSchema_default_walker_draft4, pattern) { TEST(JSONSchema_default_walker_draft4, maxItems) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("maxItems", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -289,7 +289,7 @@ TEST(JSONSchema_default_walker_draft4, maxItems) { TEST(JSONSchema_default_walker_draft4, minItems) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("minItems", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -300,7 +300,7 @@ TEST(JSONSchema_default_walker_draft4, minItems) { TEST(JSONSchema_default_walker_draft4, uniqueItems) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("uniqueItems", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -312,7 +312,7 @@ TEST(JSONSchema_default_walker_draft4, maxProperties) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maxProperties", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -324,7 +324,7 @@ TEST(JSONSchema_default_walker_draft4, minProperties) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minProperties", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -335,7 +335,7 @@ TEST(JSONSchema_default_walker_draft4, minProperties) { TEST(JSONSchema_default_walker_draft4, required) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("required", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -346,7 +346,7 @@ TEST(JSONSchema_default_walker_draft4, required) { TEST(JSONSchema_default_walker_draft4, format) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("format", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -357,7 +357,7 @@ TEST(JSONSchema_default_walker_draft4, format) { TEST(JSONSchema_default_walker_draft4, title) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("title", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -368,7 +368,7 @@ TEST(JSONSchema_default_walker_draft4, title) { TEST(JSONSchema_default_walker_draft4, description) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("description", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -379,7 +379,7 @@ TEST(JSONSchema_default_walker_draft4, description) { TEST(JSONSchema_default_walker_draft4, default) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("default", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/schema#"); @@ -391,7 +391,7 @@ TEST(JSONSchema_default_walker_draft4, hyperschema_links) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("links", VOCABULARIES_DRAFT4_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -400,7 +400,7 @@ TEST(JSONSchema_default_walker_draft4, hyperschema_media) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("media", VOCABULARIES_DRAFT4_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -409,7 +409,7 @@ TEST(JSONSchema_default_walker_draft4, hyperschema_pathStart) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("pathStart", VOCABULARIES_DRAFT4_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -418,7 +418,7 @@ TEST(JSONSchema_default_walker_draft4, hyperschema_href) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("href", VOCABULARIES_DRAFT4_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -427,7 +427,7 @@ TEST(JSONSchema_default_walker_draft4, hyperschema_rel) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("rel", VOCABULARIES_DRAFT4_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -436,7 +436,7 @@ TEST(JSONSchema_default_walker_draft4, hyperschema_mediaType) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("mediaType", VOCABULARIES_DRAFT4_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -445,7 +445,7 @@ TEST(JSONSchema_default_walker_draft4, hyperschema_method) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("method", VOCABULARIES_DRAFT4_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -454,7 +454,7 @@ TEST(JSONSchema_default_walker_draft4, hyperschema_encType) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("encType", VOCABULARIES_DRAFT4_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -463,7 +463,7 @@ TEST(JSONSchema_default_walker_draft4, hyperschema_readOnly) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("readOnly", VOCABULARIES_DRAFT4_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -472,7 +472,7 @@ TEST(JSONSchema_default_walker_draft4, hyperschema_targetSchema) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("targetSchema", VOCABULARIES_DRAFT4_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/hyper-schema#"); @@ -483,7 +483,7 @@ TEST(JSONSchema_default_walker_draft4, hyperschema_schema) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("schema", VOCABULARIES_DRAFT4_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-04/hyper-schema#"); @@ -493,7 +493,7 @@ TEST(JSONSchema_default_walker_draft4, hyperschema_schema) { TEST(JSONSchema_default_walker_draft4, hyperschema_links_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("links", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -502,7 +502,7 @@ TEST(JSONSchema_default_walker_draft4, hyperschema_links_without_hyperschema) { TEST(JSONSchema_default_walker_draft4, hyperschema_media_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("media", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -512,7 +512,7 @@ TEST(JSONSchema_default_walker_draft4, hyperschema_pathStart_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("pathStart", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -521,7 +521,7 @@ TEST(JSONSchema_default_walker_draft4, TEST(JSONSchema_default_walker_draft4, hyperschema_href_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("href", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -530,7 +530,7 @@ TEST(JSONSchema_default_walker_draft4, hyperschema_href_without_hyperschema) { TEST(JSONSchema_default_walker_draft4, hyperschema_rel_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("rel", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -540,7 +540,7 @@ TEST(JSONSchema_default_walker_draft4, hyperschema_mediaType_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("mediaType", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -549,7 +549,7 @@ TEST(JSONSchema_default_walker_draft4, TEST(JSONSchema_default_walker_draft4, hyperschema_method_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("method", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -559,7 +559,7 @@ TEST(JSONSchema_default_walker_draft4, hyperschema_encType_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("encType", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -569,7 +569,7 @@ TEST(JSONSchema_default_walker_draft4, hyperschema_readOnly_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("readOnly", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -579,7 +579,7 @@ TEST(JSONSchema_default_walker_draft4, hyperschema_targetSchema_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("targetSchema", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -588,7 +588,7 @@ TEST(JSONSchema_default_walker_draft4, TEST(JSONSchema_default_walker_draft4, hyperschema_schema_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("schema", VOCABULARIES_DRAFT4)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); diff --git a/test/jsonschema/jsonschema_default_walker_draft6_test.cc b/test/jsonschema/jsonschema_default_walker_draft6_test.cc index bc453de59..d08d95fa1 100644 --- a/test/jsonschema/jsonschema_default_walker_draft6_test.cc +++ b/test/jsonschema/jsonschema_default_walker_draft6_test.cc @@ -10,7 +10,7 @@ static const std::map VOCABULARIES_DRAFT6_HYPERSCHEMA{ TEST(JSONSchema_default_walker_draft6, schema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("$schema", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -21,7 +21,7 @@ TEST(JSONSchema_default_walker_draft6, schema) { TEST(JSONSchema_default_walker_draft6, id) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("$id", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -32,7 +32,7 @@ TEST(JSONSchema_default_walker_draft6, id) { TEST(JSONSchema_default_walker_draft6, ref) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("$ref", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Reference); + EXPECT_EQ(result.type, KeywordType::Reference); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -42,7 +42,7 @@ TEST(JSONSchema_default_walker_draft6, ref) { TEST(JSONSchema_default_walker_draft6, definitions) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("definitions", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::LocationMembers); + EXPECT_EQ(result.type, KeywordType::LocationMembers); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -53,7 +53,7 @@ TEST(JSONSchema_default_walker_draft6, definitions) { TEST(JSONSchema_default_walker_draft6, allOf) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("allOf", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorElementsInline); + EXPECT_EQ(result.type, KeywordType::ApplicatorElementsInline); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -64,7 +64,7 @@ TEST(JSONSchema_default_walker_draft6, allOf) { TEST(JSONSchema_default_walker_draft6, anyOf) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("anyOf", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorElementsInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorElementsInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -75,7 +75,7 @@ TEST(JSONSchema_default_walker_draft6, anyOf) { TEST(JSONSchema_default_walker_draft6, oneOf) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("oneOf", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorElementsInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorElementsInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -86,7 +86,7 @@ TEST(JSONSchema_default_walker_draft6, oneOf) { TEST(JSONSchema_default_walker_draft6, not) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("not", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueOther); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueOther); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -97,7 +97,7 @@ TEST(JSONSchema_default_walker_draft6, not) { TEST(JSONSchema_default_walker_draft6, items) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("items", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueOrElements); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueOrElements); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -109,7 +109,7 @@ TEST(JSONSchema_default_walker_draft6, additionalItems) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("additionalItems", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -120,7 +120,7 @@ TEST(JSONSchema_default_walker_draft6, additionalItems) { TEST(JSONSchema_default_walker_draft6, contains) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("contains", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -131,7 +131,7 @@ TEST(JSONSchema_default_walker_draft6, contains) { TEST(JSONSchema_default_walker_draft6, properties) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("properties", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorMembers); + EXPECT_EQ(result.type, KeywordType::ApplicatorMembers); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -143,7 +143,7 @@ TEST(JSONSchema_default_walker_draft6, patternProperties) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("patternProperties", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorMembers); + EXPECT_EQ(result.type, KeywordType::ApplicatorMembers); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -154,7 +154,7 @@ TEST(JSONSchema_default_walker_draft6, patternProperties) { TEST(JSONSchema_default_walker_draft6, dependencies) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("dependencies", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorMembers); + EXPECT_EQ(result.type, KeywordType::ApplicatorMembers); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -166,7 +166,7 @@ TEST(JSONSchema_default_walker_draft6, additionalProperties) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("additionalProperties", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -178,7 +178,7 @@ TEST(JSONSchema_default_walker_draft6, propertyNames) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("propertyNames", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -189,7 +189,7 @@ TEST(JSONSchema_default_walker_draft6, propertyNames) { TEST(JSONSchema_default_walker_draft6, type) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("type", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -200,7 +200,7 @@ TEST(JSONSchema_default_walker_draft6, type) { TEST(JSONSchema_default_walker_draft6, enum) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("enum", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -211,7 +211,7 @@ TEST(JSONSchema_default_walker_draft6, enum) { TEST(JSONSchema_default_walker_draft6, const) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("const", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -222,7 +222,7 @@ TEST(JSONSchema_default_walker_draft6, const) { TEST(JSONSchema_default_walker_draft6, multipleOf) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("multipleOf", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -233,7 +233,7 @@ TEST(JSONSchema_default_walker_draft6, multipleOf) { TEST(JSONSchema_default_walker_draft6, maximum) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("maximum", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -244,7 +244,7 @@ TEST(JSONSchema_default_walker_draft6, maximum) { TEST(JSONSchema_default_walker_draft6, minimum) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("minimum", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -256,7 +256,7 @@ TEST(JSONSchema_default_walker_draft6, exclusiveMaximum) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("exclusiveMaximum", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -268,7 +268,7 @@ TEST(JSONSchema_default_walker_draft6, exclusiveMinimum) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("exclusiveMinimum", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -279,7 +279,7 @@ TEST(JSONSchema_default_walker_draft6, exclusiveMinimum) { TEST(JSONSchema_default_walker_draft6, maxLength) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("maxLength", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -290,7 +290,7 @@ TEST(JSONSchema_default_walker_draft6, maxLength) { TEST(JSONSchema_default_walker_draft6, minLength) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("minLength", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -301,7 +301,7 @@ TEST(JSONSchema_default_walker_draft6, minLength) { TEST(JSONSchema_default_walker_draft6, pattern) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("pattern", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -312,7 +312,7 @@ TEST(JSONSchema_default_walker_draft6, pattern) { TEST(JSONSchema_default_walker_draft6, maxItems) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("maxItems", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -323,7 +323,7 @@ TEST(JSONSchema_default_walker_draft6, maxItems) { TEST(JSONSchema_default_walker_draft6, minItems) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("minItems", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -334,7 +334,7 @@ TEST(JSONSchema_default_walker_draft6, minItems) { TEST(JSONSchema_default_walker_draft6, uniqueItems) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("uniqueItems", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -346,7 +346,7 @@ TEST(JSONSchema_default_walker_draft6, maxProperties) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maxProperties", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -358,7 +358,7 @@ TEST(JSONSchema_default_walker_draft6, minProperties) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minProperties", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -369,7 +369,7 @@ TEST(JSONSchema_default_walker_draft6, minProperties) { TEST(JSONSchema_default_walker_draft6, required) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("required", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -380,7 +380,7 @@ TEST(JSONSchema_default_walker_draft6, required) { TEST(JSONSchema_default_walker_draft6, format) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("format", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -391,7 +391,7 @@ TEST(JSONSchema_default_walker_draft6, format) { TEST(JSONSchema_default_walker_draft6, title) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("title", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -402,7 +402,7 @@ TEST(JSONSchema_default_walker_draft6, title) { TEST(JSONSchema_default_walker_draft6, description) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("description", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -413,7 +413,7 @@ TEST(JSONSchema_default_walker_draft6, description) { TEST(JSONSchema_default_walker_draft6, default) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("default", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -424,7 +424,7 @@ TEST(JSONSchema_default_walker_draft6, default) { TEST(JSONSchema_default_walker_draft6, examples) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("examples", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -436,7 +436,7 @@ TEST(JSONSchema_default_walker_draft6, hyperschema_links) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("links", VOCABULARIES_DRAFT6_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -445,7 +445,7 @@ TEST(JSONSchema_default_walker_draft6, hyperschema_href) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("href", VOCABULARIES_DRAFT6_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -454,7 +454,7 @@ TEST(JSONSchema_default_walker_draft6, hyperschema_rel) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("rel", VOCABULARIES_DRAFT6_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -463,7 +463,7 @@ TEST(JSONSchema_default_walker_draft6, hyperschema_mediaType) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("mediaType", VOCABULARIES_DRAFT6_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -472,7 +472,7 @@ TEST(JSONSchema_default_walker_draft6, hyperschema_submissionEncType) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("submissionEncType", VOCABULARIES_DRAFT6_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -481,7 +481,7 @@ TEST(JSONSchema_default_walker_draft6, hyperschema_base) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("base", VOCABULARIES_DRAFT6_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -490,7 +490,7 @@ TEST(JSONSchema_default_walker_draft6, hyperschema_media) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("media", VOCABULARIES_DRAFT6_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -499,7 +499,7 @@ TEST(JSONSchema_default_walker_draft6, hyperschema_readOnly) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("readOnly", VOCABULARIES_DRAFT6_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -508,7 +508,7 @@ TEST(JSONSchema_default_walker_draft6, hyperschema_hrefSchema) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("hrefSchema", VOCABULARIES_DRAFT6_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/hyper-schema#"); @@ -519,7 +519,7 @@ TEST(JSONSchema_default_walker_draft6, hyperschema_targetSchema) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("targetSchema", VOCABULARIES_DRAFT6_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/hyper-schema#"); @@ -530,7 +530,7 @@ TEST(JSONSchema_default_walker_draft6, hyperschema_submissionSchema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("submissionSchema", VOCABULARIES_DRAFT6_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/hyper-schema#"); @@ -540,7 +540,7 @@ TEST(JSONSchema_default_walker_draft6, hyperschema_submissionSchema) { TEST(JSONSchema_default_walker_draft6, hyperschema_links_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("links", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -549,7 +549,7 @@ TEST(JSONSchema_default_walker_draft6, hyperschema_links_without_hyperschema) { TEST(JSONSchema_default_walker_draft6, hyperschema_href_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("href", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -558,7 +558,7 @@ TEST(JSONSchema_default_walker_draft6, hyperschema_href_without_hyperschema) { TEST(JSONSchema_default_walker_draft6, hyperschema_rel_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("rel", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -568,7 +568,7 @@ TEST(JSONSchema_default_walker_draft6, hyperschema_mediaType_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("mediaType", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -579,7 +579,7 @@ TEST(JSONSchema_default_walker_draft6, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("submissionEncType", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -588,7 +588,7 @@ TEST(JSONSchema_default_walker_draft6, TEST(JSONSchema_default_walker_draft6, hyperschema_base_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("base", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -597,7 +597,7 @@ TEST(JSONSchema_default_walker_draft6, hyperschema_base_without_hyperschema) { TEST(JSONSchema_default_walker_draft6, hyperschema_media_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("media", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -607,7 +607,7 @@ TEST(JSONSchema_default_walker_draft6, hyperschema_readOnly_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("readOnly", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-06/schema#"); @@ -619,7 +619,7 @@ TEST(JSONSchema_default_walker_draft6, hyperschema_hrefSchema_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("hrefSchema", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -629,7 +629,7 @@ TEST(JSONSchema_default_walker_draft6, hyperschema_targetSchema_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("targetSchema", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -640,7 +640,7 @@ TEST(JSONSchema_default_walker_draft6, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("submissionSchema", VOCABULARIES_DRAFT6)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); diff --git a/test/jsonschema/jsonschema_default_walker_draft7_test.cc b/test/jsonschema/jsonschema_default_walker_draft7_test.cc index a9aff4c3b..170769151 100644 --- a/test/jsonschema/jsonschema_default_walker_draft7_test.cc +++ b/test/jsonschema/jsonschema_default_walker_draft7_test.cc @@ -10,7 +10,7 @@ static const std::map VOCABULARIES_DRAFT7_HYPERSCHEMA{ TEST(JSONSchema_default_walker_draft7, schema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("$schema", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -21,7 +21,7 @@ TEST(JSONSchema_default_walker_draft7, schema) { TEST(JSONSchema_default_walker_draft7, id) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("$id", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -32,7 +32,7 @@ TEST(JSONSchema_default_walker_draft7, id) { TEST(JSONSchema_default_walker_draft7, ref) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("$ref", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Reference); + EXPECT_EQ(result.type, KeywordType::Reference); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -42,7 +42,7 @@ TEST(JSONSchema_default_walker_draft7, ref) { TEST(JSONSchema_default_walker_draft7, definitions) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("definitions", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::LocationMembers); + EXPECT_EQ(result.type, KeywordType::LocationMembers); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -53,7 +53,7 @@ TEST(JSONSchema_default_walker_draft7, definitions) { TEST(JSONSchema_default_walker_draft7, comment) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("$comment", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -64,7 +64,7 @@ TEST(JSONSchema_default_walker_draft7, comment) { TEST(JSONSchema_default_walker_draft7, allOf) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("allOf", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorElementsInline); + EXPECT_EQ(result.type, KeywordType::ApplicatorElementsInline); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -75,7 +75,7 @@ TEST(JSONSchema_default_walker_draft7, allOf) { TEST(JSONSchema_default_walker_draft7, anyOf) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("anyOf", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorElementsInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorElementsInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -86,7 +86,7 @@ TEST(JSONSchema_default_walker_draft7, anyOf) { TEST(JSONSchema_default_walker_draft7, oneOf) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("oneOf", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorElementsInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorElementsInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -97,7 +97,7 @@ TEST(JSONSchema_default_walker_draft7, oneOf) { TEST(JSONSchema_default_walker_draft7, not) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("not", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueOther); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueOther); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -108,7 +108,7 @@ TEST(JSONSchema_default_walker_draft7, not) { TEST(JSONSchema_default_walker_draft7, if) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("if", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -119,7 +119,7 @@ TEST(JSONSchema_default_walker_draft7, if) { TEST(JSONSchema_default_walker_draft7, then) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("then", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -130,7 +130,7 @@ TEST(JSONSchema_default_walker_draft7, then) { TEST(JSONSchema_default_walker_draft7, else) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("else", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -141,7 +141,7 @@ TEST(JSONSchema_default_walker_draft7, else) { TEST(JSONSchema_default_walker_draft7, items) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("items", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueOrElements); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueOrElements); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -153,7 +153,7 @@ TEST(JSONSchema_default_walker_draft7, additionalItems) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("additionalItems", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -164,7 +164,7 @@ TEST(JSONSchema_default_walker_draft7, additionalItems) { TEST(JSONSchema_default_walker_draft7, contains) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("contains", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -175,7 +175,7 @@ TEST(JSONSchema_default_walker_draft7, contains) { TEST(JSONSchema_default_walker_draft7, properties) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("properties", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorMembers); + EXPECT_EQ(result.type, KeywordType::ApplicatorMembers); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -187,7 +187,7 @@ TEST(JSONSchema_default_walker_draft7, patternProperties) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("patternProperties", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorMembers); + EXPECT_EQ(result.type, KeywordType::ApplicatorMembers); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -198,7 +198,7 @@ TEST(JSONSchema_default_walker_draft7, patternProperties) { TEST(JSONSchema_default_walker_draft7, dependencies) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("dependencies", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorMembers); + EXPECT_EQ(result.type, KeywordType::ApplicatorMembers); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -210,7 +210,7 @@ TEST(JSONSchema_default_walker_draft7, additionalProperties) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("additionalProperties", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -222,7 +222,7 @@ TEST(JSONSchema_default_walker_draft7, propertyNames) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("propertyNames", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValueInPlace); + EXPECT_EQ(result.type, KeywordType::ApplicatorValueInPlace); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -233,7 +233,7 @@ TEST(JSONSchema_default_walker_draft7, propertyNames) { TEST(JSONSchema_default_walker_draft7, type) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("type", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -244,7 +244,7 @@ TEST(JSONSchema_default_walker_draft7, type) { TEST(JSONSchema_default_walker_draft7, enum) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("enum", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -255,7 +255,7 @@ TEST(JSONSchema_default_walker_draft7, enum) { TEST(JSONSchema_default_walker_draft7, const) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("const", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -266,7 +266,7 @@ TEST(JSONSchema_default_walker_draft7, const) { TEST(JSONSchema_default_walker_draft7, multipleOf) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("multipleOf", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -277,7 +277,7 @@ TEST(JSONSchema_default_walker_draft7, multipleOf) { TEST(JSONSchema_default_walker_draft7, maximum) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("maximum", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -288,7 +288,7 @@ TEST(JSONSchema_default_walker_draft7, maximum) { TEST(JSONSchema_default_walker_draft7, minimum) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("minimum", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -300,7 +300,7 @@ TEST(JSONSchema_default_walker_draft7, exclusiveMaximum) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("exclusiveMaximum", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -312,7 +312,7 @@ TEST(JSONSchema_default_walker_draft7, exclusiveMinimum) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("exclusiveMinimum", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -323,7 +323,7 @@ TEST(JSONSchema_default_walker_draft7, exclusiveMinimum) { TEST(JSONSchema_default_walker_draft7, maxLength) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("maxLength", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -334,7 +334,7 @@ TEST(JSONSchema_default_walker_draft7, maxLength) { TEST(JSONSchema_default_walker_draft7, minLength) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("minLength", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -345,7 +345,7 @@ TEST(JSONSchema_default_walker_draft7, minLength) { TEST(JSONSchema_default_walker_draft7, pattern) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("pattern", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -356,7 +356,7 @@ TEST(JSONSchema_default_walker_draft7, pattern) { TEST(JSONSchema_default_walker_draft7, maxItems) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("maxItems", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -367,7 +367,7 @@ TEST(JSONSchema_default_walker_draft7, maxItems) { TEST(JSONSchema_default_walker_draft7, minItems) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("minItems", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -378,7 +378,7 @@ TEST(JSONSchema_default_walker_draft7, minItems) { TEST(JSONSchema_default_walker_draft7, uniqueItems) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("uniqueItems", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -390,7 +390,7 @@ TEST(JSONSchema_default_walker_draft7, maxProperties) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("maxProperties", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -402,7 +402,7 @@ TEST(JSONSchema_default_walker_draft7, minProperties) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("minProperties", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -413,7 +413,7 @@ TEST(JSONSchema_default_walker_draft7, minProperties) { TEST(JSONSchema_default_walker_draft7, required) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("required", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Assertion); + EXPECT_EQ(result.type, KeywordType::Assertion); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -424,7 +424,7 @@ TEST(JSONSchema_default_walker_draft7, required) { TEST(JSONSchema_default_walker_draft7, format) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("format", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -436,7 +436,7 @@ TEST(JSONSchema_default_walker_draft7, contentEncoding) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("contentEncoding", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -448,7 +448,7 @@ TEST(JSONSchema_default_walker_draft7, contentMediaType) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("contentMediaType", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -459,7 +459,7 @@ TEST(JSONSchema_default_walker_draft7, contentMediaType) { TEST(JSONSchema_default_walker_draft7, title) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("title", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -470,7 +470,7 @@ TEST(JSONSchema_default_walker_draft7, title) { TEST(JSONSchema_default_walker_draft7, description) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("description", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -481,7 +481,7 @@ TEST(JSONSchema_default_walker_draft7, description) { TEST(JSONSchema_default_walker_draft7, default) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("default", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -492,7 +492,7 @@ TEST(JSONSchema_default_walker_draft7, default) { TEST(JSONSchema_default_walker_draft7, readOnly) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("readOnly", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -503,7 +503,7 @@ TEST(JSONSchema_default_walker_draft7, readOnly) { TEST(JSONSchema_default_walker_draft7, writeOnly) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("writeOnly", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -514,7 +514,7 @@ TEST(JSONSchema_default_walker_draft7, writeOnly) { TEST(JSONSchema_default_walker_draft7, examples) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("examples", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Other); + EXPECT_EQ(result.type, KeywordType::Other); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/schema#"); @@ -526,7 +526,7 @@ TEST(JSONSchema_default_walker_draft7, hyperschema_links) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("links", VOCABULARIES_DRAFT7_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -535,7 +535,7 @@ TEST(JSONSchema_default_walker_draft7, hyperschema_base) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("base", VOCABULARIES_DRAFT7_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -544,7 +544,7 @@ TEST(JSONSchema_default_walker_draft7, hyperschema_anchor) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("anchor", VOCABULARIES_DRAFT7_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -553,7 +553,7 @@ TEST(JSONSchema_default_walker_draft7, hyperschema_anchorPointer) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("anchorPointer", VOCABULARIES_DRAFT7_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -562,7 +562,7 @@ TEST(JSONSchema_default_walker_draft7, hyperschema_rel) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("rel", VOCABULARIES_DRAFT7_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -571,7 +571,7 @@ TEST(JSONSchema_default_walker_draft7, hyperschema_href) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("href", VOCABULARIES_DRAFT7_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -580,7 +580,7 @@ TEST(JSONSchema_default_walker_draft7, hyperschema_templatePointers) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("templatePointers", VOCABULARIES_DRAFT7_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -589,7 +589,7 @@ TEST(JSONSchema_default_walker_draft7, hyperschema_templateRequired) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("templateRequired", VOCABULARIES_DRAFT7_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -598,7 +598,7 @@ TEST(JSONSchema_default_walker_draft7, hyperschema_targetMediaType) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("targetMediaType", VOCABULARIES_DRAFT7_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -607,7 +607,7 @@ TEST(JSONSchema_default_walker_draft7, hyperschema_targetHints) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("targetHints", VOCABULARIES_DRAFT7_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -616,7 +616,7 @@ TEST(JSONSchema_default_walker_draft7, hyperschema_submissionMediaType) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("submissionMediaType", VOCABULARIES_DRAFT7_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); EXPECT_TRUE(result.dependencies.empty()); } @@ -625,7 +625,7 @@ TEST(JSONSchema_default_walker_draft7, hyperschema_hrefSchema) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("hrefSchema", VOCABULARIES_DRAFT7_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/hyper-schema#"); @@ -636,7 +636,7 @@ TEST(JSONSchema_default_walker_draft7, hyperschema_targetSchema) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("targetSchema", VOCABULARIES_DRAFT7_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/hyper-schema#"); @@ -647,7 +647,7 @@ TEST(JSONSchema_default_walker_draft7, hyperschema_headerSchema) { using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("headerSchema", VOCABULARIES_DRAFT7_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/hyper-schema#"); @@ -658,7 +658,7 @@ TEST(JSONSchema_default_walker_draft7, hyperschema_submissionSchema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("submissionSchema", VOCABULARIES_DRAFT7_HYPERSCHEMA)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::ApplicatorValue); + EXPECT_EQ(result.type, KeywordType::ApplicatorValue); EXPECT_TRUE(result.vocabulary.has_value()); EXPECT_EQ(result.vocabulary.value(), "http://json-schema.org/draft-07/hyper-schema#"); @@ -668,7 +668,7 @@ TEST(JSONSchema_default_walker_draft7, hyperschema_submissionSchema) { TEST(JSONSchema_default_walker_draft7, hyperschema_links_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("links", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -677,7 +677,7 @@ TEST(JSONSchema_default_walker_draft7, hyperschema_links_without_hyperschema) { TEST(JSONSchema_default_walker_draft7, hyperschema_base_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("base", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -686,7 +686,7 @@ TEST(JSONSchema_default_walker_draft7, hyperschema_base_without_hyperschema) { TEST(JSONSchema_default_walker_draft7, hyperschema_anchor_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("anchor", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -697,7 +697,7 @@ TEST(JSONSchema_default_walker_draft7, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("anchorPointer", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -706,7 +706,7 @@ TEST(JSONSchema_default_walker_draft7, TEST(JSONSchema_default_walker_draft7, hyperschema_rel_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("rel", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -715,7 +715,7 @@ TEST(JSONSchema_default_walker_draft7, hyperschema_rel_without_hyperschema) { TEST(JSONSchema_default_walker_draft7, hyperschema_href_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("href", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -726,7 +726,7 @@ TEST(JSONSchema_default_walker_draft7, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("templatePointers", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -737,7 +737,7 @@ TEST(JSONSchema_default_walker_draft7, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("templateRequired", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -748,7 +748,7 @@ TEST(JSONSchema_default_walker_draft7, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("targetMediaType", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -758,7 +758,7 @@ TEST(JSONSchema_default_walker_draft7, hyperschema_targetHints_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("targetHints", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -769,7 +769,7 @@ TEST(JSONSchema_default_walker_draft7, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("submissionMediaType", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -779,7 +779,7 @@ TEST(JSONSchema_default_walker_draft7, hyperschema_hrefSchema_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("hrefSchema", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -789,7 +789,7 @@ TEST(JSONSchema_default_walker_draft7, hyperschema_targetSchema_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("targetSchema", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -799,7 +799,7 @@ TEST(JSONSchema_default_walker_draft7, hyperschema_headerSchema_without_hyperschema) { using namespace sourcemeta::jsontoolkit; const auto result{default_schema_walker("headerSchema", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); @@ -810,7 +810,7 @@ TEST(JSONSchema_default_walker_draft7, using namespace sourcemeta::jsontoolkit; const auto result{ default_schema_walker("submissionSchema", VOCABULARIES_DRAFT7)}; - EXPECT_EQ(result.strategy, SchemaWalkerStrategy::Unknown); + EXPECT_EQ(result.type, KeywordType::Unknown); EXPECT_FALSE(result.vocabulary.has_value()); const std::set expected{"$ref"}; EXPECT_EQ(result.dependencies, expected); diff --git a/test/jsonschema/jsonschema_walker_test.cc b/test/jsonschema/jsonschema_walker_test.cc index 077b379d7..d81f048ea 100644 --- a/test/jsonschema/jsonschema_walker_test.cc +++ b/test/jsonschema/jsonschema_walker_test.cc @@ -37,33 +37,31 @@ static auto test_walker(std::string_view keyword, if (vocabularies.find("https://sourcemeta.com/vocab/test-1") != vocabularies.end()) { if (keyword == "schema") { - return {sourcemeta::jsontoolkit::SchemaWalkerStrategy::ApplicatorValue, + return {sourcemeta::jsontoolkit::KeywordType::ApplicatorValue, "https://sourcemeta.com/vocab/test-1", {}}; } if (keyword == "schemas") { - return {sourcemeta::jsontoolkit::SchemaWalkerStrategy::ApplicatorElements, + return {sourcemeta::jsontoolkit::KeywordType::ApplicatorElements, "https://sourcemeta.com/vocab/test-1", {}}; } if (keyword == "schemaMap") { - return {sourcemeta::jsontoolkit::SchemaWalkerStrategy::ApplicatorMembers, + return {sourcemeta::jsontoolkit::KeywordType::ApplicatorMembers, "https://sourcemeta.com/vocab/test-1", {}}; } if (keyword == "schemaOrSchemas") { - return {sourcemeta::jsontoolkit::SchemaWalkerStrategy:: - ApplicatorValueOrElements, + return {sourcemeta::jsontoolkit::KeywordType::ApplicatorValueOrElements, "https://sourcemeta.com/vocab/test-1", {}}; } if (keyword == "schemasOrMap") { - return {sourcemeta::jsontoolkit::SchemaWalkerStrategy:: - ApplicatorElementsOrMembers, + return {sourcemeta::jsontoolkit::KeywordType::ApplicatorElementsOrMembers, "https://sourcemeta.com/vocab/test-1", {}}; } @@ -72,14 +70,13 @@ static auto test_walker(std::string_view keyword, if (vocabularies.find("https://sourcemeta.com/vocab/test-2") != vocabularies.end()) { if (keyword == "custom") { - return {sourcemeta::jsontoolkit::SchemaWalkerStrategy::ApplicatorValue, + return {sourcemeta::jsontoolkit::KeywordType::ApplicatorValue, "https://sourcemeta.com/vocab/test-2", {}}; } } - return { - sourcemeta::jsontoolkit::SchemaWalkerStrategy::Unknown, std::nullopt, {}}; + return {sourcemeta::jsontoolkit::KeywordType::Unknown, std::nullopt, {}}; } TEST(JSONSchema_walker, true) {