From 305128667aed099256501e60d1b0d9c2f8a9f378 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Wed, 21 Jan 2026 12:47:57 -0400 Subject: [PATCH] Extend `SchemaFrame::Location` with a `property_name` member Signed-off-by: Juan Cruz Viotti --- src/core/jsonschema/frame.cc | 48 +- .../sourcemeta/core/jsonschema_frame.h | 1 + .../sourcemeta/core/jsonschema_types.h | 1 + src/core/jsonschema/walker.cc | 65 +- .../jsonschema_frame_2019_09_test.cc | 739 ++++++++++------ .../jsonschema_frame_2020_12_test.cc | 812 ++++++++++-------- .../jsonschema_frame_draft0_test.cc | 152 ++-- .../jsonschema_frame_draft1_test.cc | 152 ++-- .../jsonschema_frame_draft2_test.cc | 152 ++-- .../jsonschema_frame_draft3_test.cc | 188 ++-- .../jsonschema_frame_draft4_test.cc | 297 ++++--- .../jsonschema_frame_draft6_test.cc | 368 +++++--- .../jsonschema_frame_draft7_test.cc | 303 ++++--- test/jsonschema/jsonschema_frame_test.cc | 605 +++++++------ test/jsonschema/jsonschema_test_utils.h | 140 +-- .../jsonschema_walker_draft6_test.cc | 42 +- 16 files changed, 2340 insertions(+), 1725 deletions(-) diff --git a/src/core/jsonschema/frame.cc b/src/core/jsonschema/frame.cc index 82e5cdfe0..ad2772590 100644 --- a/src/core/jsonschema/frame.cc +++ b/src/core/jsonschema/frame.cc @@ -296,7 +296,7 @@ auto store(sourcemeta::core::SchemaFrame::Locations &frame, const std::string_view dialect, const sourcemeta::core::SchemaBaseDialect base_dialect, const std::optional &parent, - const bool ignore_if_present = false, + const bool property_name, const bool ignore_if_present = false, const bool already_canonical = false) -> void { auto canonical{already_canonical ? std::move(uri) : sourcemeta::core::URI::canonicalize(uri)}; @@ -308,7 +308,8 @@ auto store(sourcemeta::core::SchemaFrame::Locations &frame, .pointer = pointer_from_root, .relative_pointer = relative_pointer_offset, .dialect = dialect, - .base_dialect = base_dialect}}); + .base_dialect = base_dialect, + .property_name = property_name}}); if (!ignore_if_present && !inserted) { throw_already_exists(iterator->first.second); } @@ -329,6 +330,7 @@ struct InternalEntry { // NOLINTNEXTLINE(bugprone-exception-escape) struct CacheSubschema { bool orphan{}; + bool property_name{}; std::optional parent{}; }; @@ -391,6 +393,8 @@ auto SchemaFrame::to_json( entry.assign_assume_new( "baseDialect", JSON{JSON::String{to_string(location.second.base_dialect)}}); + entry.assign_assume_new("propertyName", + JSON{location.second.property_name}); switch (location.first.first) { case SchemaReferenceType::Static: @@ -498,7 +502,7 @@ auto SchemaFrame::analyse(const JSON &root, const SchemaWalker &walker, store(this->locations_, SchemaReferenceType::Static, SchemaFrame::LocationType::Resource, default_id_canonical, this->root_, path, path.size(), root_dialect, - root_base_dialect.value(), std::nullopt); + root_base_dialect.value(), std::nullopt, false); base_uris.insert({path, {root_id.value(), default_id_canonical}}); } @@ -535,8 +539,10 @@ auto SchemaFrame::analyse(const JSON &root, const SchemaWalker &walker, : std::nullopt}; // Store information - subschemas.emplace(entry.pointer, CacheSubschema{.orphan = entry.orphan, - .parent = entry.parent}); + subschemas.emplace(entry.pointer, + CacheSubschema{.orphan = entry.orphan, + .property_name = entry.property_name, + .parent = entry.parent}); subschema_entries.emplace_back( InternalEntry{.common = std::move(entry), .id = std::move(id)}); current_subschema_entries.emplace_back(subschema_entries.size() - 1); @@ -602,7 +608,7 @@ auto SchemaFrame::analyse(const JSON &root, const SchemaWalker &walker, SchemaFrame::LocationType::Resource, new_id, new_id, common_pointer_weak, common_pointer_weak.size(), entry.common.dialect, entry.common.base_dialect.value(), - common_parent); + common_parent, entry.common.property_name); } auto base_uri_match{base_uris.find(common_pointer_weak)}; @@ -665,7 +671,7 @@ auto SchemaFrame::analyse(const JSON &root, const SchemaWalker &walker, SchemaFrame::LocationType::Anchor, relative_anchor_uri, "", common_pointer_weak, bases.second.size(), entry.common.dialect, entry.common.base_dialect.value(), - common_parent); + common_parent, entry.common.property_name); } if (type == AnchorType::Dynamic || type == AnchorType::All) { @@ -673,7 +679,7 @@ auto SchemaFrame::analyse(const JSON &root, const SchemaWalker &walker, SchemaFrame::LocationType::Anchor, relative_anchor_uri, "", common_pointer_weak, bases.second.size(), entry.common.dialect, entry.common.base_dialect.value(), - common_parent); + common_parent, entry.common.property_name); // Register a dynamic anchor as a static anchor if possible too if (entry.common.vocabularies.contains( @@ -682,7 +688,7 @@ auto SchemaFrame::analyse(const JSON &root, const SchemaWalker &walker, SchemaFrame::LocationType::Anchor, relative_anchor_uri, "", common_pointer_weak, bases.second.size(), entry.common.dialect, entry.common.base_dialect.value(), - common_parent, true); + common_parent, entry.common.property_name, true); } } } else { @@ -712,7 +718,7 @@ auto SchemaFrame::analyse(const JSON &root, const SchemaWalker &walker, SchemaFrame::LocationType::Anchor, anchor_uri, base_view, common_pointer_weak, bases.second.size(), entry.common.dialect, entry.common.base_dialect.value(), - common_parent); + common_parent, entry.common.property_name); } if (type == AnchorType::Dynamic || type == AnchorType::All) { @@ -721,7 +727,7 @@ auto SchemaFrame::analyse(const JSON &root, const SchemaWalker &walker, SchemaFrame::LocationType::Anchor, anchor_uri, base_view, common_pointer_weak, bases.second.size(), entry.common.dialect, entry.common.base_dialect.value(), - common_parent); + common_parent, entry.common.property_name); // Register a dynamic anchor as a static anchor if possible too if (entry.common.vocabularies.contains( @@ -731,7 +737,7 @@ auto SchemaFrame::analyse(const JSON &root, const SchemaWalker &walker, SchemaFrame::LocationType::Anchor, anchor_uri, base_view, common_pointer_weak, bases.second.size(), entry.common.dialect, entry.common.base_dialect.value(), - common_parent, true); + common_parent, entry.common.property_name, true); } } @@ -833,16 +839,22 @@ auto SchemaFrame::analyse(const JSON &root, const SchemaWalker &walker, SchemaFrame::LocationType::Subschema, std::move(result), base_view, pointer_weak, nearest_base_depth, dialect_for_pointer, current_base_dialect, - subschema_it->second.parent, false, true); + subschema_it->second.parent, + subschema_it->second.property_name, false, true); } else { + const auto &parent_pointer{combined.dialect_match.has_value() + ? combined.dialect_match->second + : empty_weak_pointer}; + const auto parent_subschema_it{subschemas.find(parent_pointer)}; + const bool parent_property_name{ + parent_subschema_it != subschemas.cend() && + parent_subschema_it->second.property_name}; + store(this->locations_, SchemaReferenceType::Static, SchemaFrame::LocationType::Pointer, std::move(result), base_view, pointer_weak, nearest_base_depth, - dialect_for_pointer, current_base_dialect, - combined.dialect_match.has_value() - ? combined.dialect_match->second - : empty_weak_pointer, - false, true); + dialect_for_pointer, current_base_dialect, parent_pointer, + parent_property_name, false, true); } } } diff --git a/src/core/jsonschema/include/sourcemeta/core/jsonschema_frame.h b/src/core/jsonschema/include/sourcemeta/core/jsonschema_frame.h index 9f95dbe86..50dffa540 100644 --- a/src/core/jsonschema/include/sourcemeta/core/jsonschema_frame.h +++ b/src/core/jsonschema/include/sourcemeta/core/jsonschema_frame.h @@ -113,6 +113,7 @@ class SOURCEMETA_CORE_JSONSCHEMA_EXPORT SchemaFrame { std::size_t relative_pointer; std::string_view dialect; SchemaBaseDialect base_dialect; + bool property_name; }; /// A JSON Schema reference frame is a mapping of URIs to schema identifiers, diff --git a/src/core/jsonschema/include/sourcemeta/core/jsonschema_types.h b/src/core/jsonschema/include/sourcemeta/core/jsonschema_types.h index 1413d9640..30f0ddfcc 100644 --- a/src/core/jsonschema/include/sourcemeta/core/jsonschema_types.h +++ b/src/core/jsonschema/include/sourcemeta/core/jsonschema_types.h @@ -226,6 +226,7 @@ struct SchemaIteratorEntry { std::optional base_dialect; std::reference_wrapper subschema; bool orphan; + bool property_name; }; } // namespace sourcemeta::core diff --git a/src/core/jsonschema/walker.cc b/src/core/jsonschema/walker.cc index 1ae0b3722..4618d1e2b 100644 --- a/src/core/jsonschema/walker.cc +++ b/src/core/jsonschema/walker.cc @@ -37,7 +37,7 @@ auto walk(const std::optional &parent, const std::string_view dialect, const sourcemeta::core::SchemaBaseDialect base_dialect, const SchemaWalkerType_t type, const std::size_t level, - const bool orphan) -> void { + const bool orphan, const bool property_name) -> void { if (!is_schema(subschema)) { return; } @@ -92,7 +92,8 @@ auto walk(const std::optional &parent, .base_dialect = current_base_dialect, .subschema = subschema, - .orphan = orphan}; + .orphan = orphan, + .property_name = property_name}; subschemas.push_back(std::move(entry)); } @@ -123,7 +124,8 @@ auto walk(const std::optional &parent, sourcemeta::core::WeakPointer new_pointer{pointer}; new_pointer.push_back(std::cref(pair.first)); walk(pointer, new_pointer, subschemas, pair.second, walker, resolver, - current_dialect, current_base_dialect, type, level + 1, orphan); + current_dialect, current_base_dialect, type, level + 1, orphan, + false); } break; case sourcemeta::core::SchemaKeywordType:: @@ -131,7 +133,8 @@ auto walk(const std::optional &parent, sourcemeta::core::WeakPointer new_pointer{pointer}; new_pointer.push_back(std::cref(pair.first)); walk(pointer, new_pointer, subschemas, pair.second, walker, resolver, - current_dialect, current_base_dialect, type, level + 1, orphan); + current_dialect, current_base_dialect, type, level + 1, orphan, + true); } break; case sourcemeta::core::SchemaKeywordType:: @@ -139,7 +142,8 @@ auto walk(const std::optional &parent, sourcemeta::core::WeakPointer new_pointer{pointer}; new_pointer.push_back(std::cref(pair.first)); walk(pointer, new_pointer, subschemas, pair.second, walker, resolver, - current_dialect, current_base_dialect, type, level + 1, orphan); + current_dialect, current_base_dialect, type, level + 1, orphan, + false); } break; case sourcemeta::core::SchemaKeywordType:: @@ -147,35 +151,40 @@ auto walk(const std::optional &parent, sourcemeta::core::WeakPointer new_pointer{pointer}; new_pointer.push_back(std::cref(pair.first)); walk(pointer, new_pointer, subschemas, pair.second, walker, resolver, - current_dialect, current_base_dialect, type, level + 1, orphan); + current_dialect, current_base_dialect, type, level + 1, orphan, + false); } break; case sourcemeta::core::SchemaKeywordType::ApplicatorValueTraverseParent: { sourcemeta::core::WeakPointer new_pointer{pointer}; new_pointer.push_back(std::cref(pair.first)); walk(pointer, new_pointer, subschemas, pair.second, walker, resolver, - current_dialect, current_base_dialect, type, level + 1, orphan); + current_dialect, current_base_dialect, type, level + 1, orphan, + false); } break; case sourcemeta::core::SchemaKeywordType::ApplicatorValueInPlaceOther: { sourcemeta::core::WeakPointer new_pointer{pointer}; new_pointer.push_back(std::cref(pair.first)); walk(pointer, new_pointer, subschemas, pair.second, walker, resolver, - current_dialect, current_base_dialect, type, level + 1, orphan); + current_dialect, current_base_dialect, type, level + 1, orphan, + property_name); } break; case sourcemeta::core::SchemaKeywordType::ApplicatorValueInPlaceNegate: { sourcemeta::core::WeakPointer new_pointer{pointer}; new_pointer.push_back(std::cref(pair.first)); walk(pointer, new_pointer, subschemas, pair.second, walker, resolver, - current_dialect, current_base_dialect, type, level + 1, orphan); + current_dialect, current_base_dialect, type, level + 1, orphan, + property_name); } break; case sourcemeta::core::SchemaKeywordType::ApplicatorValueInPlaceMaybe: { sourcemeta::core::WeakPointer new_pointer{pointer}; new_pointer.push_back(std::cref(pair.first)); walk(pointer, new_pointer, subschemas, pair.second, walker, resolver, - current_dialect, current_base_dialect, type, level + 1, orphan); + current_dialect, current_base_dialect, type, level + 1, orphan, + property_name); } break; case sourcemeta::core::SchemaKeywordType::ApplicatorElementsTraverseItem: @@ -186,7 +195,7 @@ auto walk(const std::optional &parent, new_pointer.emplace_back(index); walk(pointer, new_pointer, subschemas, pair.second.at(index), walker, resolver, current_dialect, current_base_dialect, type, - level + 1, orphan); + level + 1, orphan, false); } } @@ -200,7 +209,7 @@ auto walk(const std::optional &parent, new_pointer.emplace_back(index); walk(pointer, new_pointer, subschemas, pair.second.at(index), walker, resolver, current_dialect, current_base_dialect, type, - level + 1, orphan); + level + 1, orphan, property_name); } } @@ -214,7 +223,7 @@ auto walk(const std::optional &parent, new_pointer.emplace_back(index); walk(pointer, new_pointer, subschemas, pair.second.at(index), walker, resolver, current_dialect, current_base_dialect, type, - level + 1, orphan); + level + 1, orphan, property_name); } } @@ -229,7 +238,7 @@ auto walk(const std::optional &parent, new_pointer.emplace_back(index); walk(pointer, new_pointer, subschemas, pair.second.at(index), walker, resolver, current_dialect, current_base_dialect, type, - level + 1, orphan); + level + 1, orphan, property_name); } } @@ -244,7 +253,7 @@ auto walk(const std::optional &parent, new_pointer.push_back(std::cref(subpair.first)); walk(pointer, new_pointer, subschemas, subpair.second, walker, resolver, current_dialect, current_base_dialect, type, - level + 1, orphan); + level + 1, orphan, false); } } @@ -259,7 +268,7 @@ auto walk(const std::optional &parent, new_pointer.push_back(std::cref(subpair.first)); walk(pointer, new_pointer, subschemas, subpair.second, walker, resolver, current_dialect, current_base_dialect, type, - level + 1, orphan); + level + 1, orphan, false); } } @@ -273,7 +282,7 @@ auto walk(const std::optional &parent, new_pointer.push_back(std::cref(subpair.first)); walk(pointer, new_pointer, subschemas, subpair.second, walker, resolver, current_dialect, current_base_dialect, type, - level + 1, orphan); + level + 1, orphan, property_name); } } @@ -287,7 +296,7 @@ auto walk(const std::optional &parent, new_pointer.push_back(std::cref(subpair.first)); walk(pointer, new_pointer, subschemas, subpair.second, walker, resolver, current_dialect, current_base_dialect, type, - level + 1, true); + level + 1, true, false); } } @@ -302,13 +311,14 @@ auto walk(const std::optional &parent, new_pointer.emplace_back(index); walk(pointer, new_pointer, subschemas, pair.second.at(index), walker, resolver, current_dialect, current_base_dialect, type, - level + 1, orphan); + level + 1, orphan, false); } } else { sourcemeta::core::WeakPointer new_pointer{pointer}; new_pointer.push_back(std::cref(pair.first)); walk(pointer, new_pointer, subschemas, pair.second, walker, resolver, - current_dialect, current_base_dialect, type, level + 1, orphan); + current_dialect, current_base_dialect, type, level + 1, orphan, + false); } break; @@ -322,13 +332,14 @@ auto walk(const std::optional &parent, new_pointer.emplace_back(index); walk(pointer, new_pointer, subschemas, pair.second.at(index), walker, resolver, current_dialect, current_base_dialect, type, - level + 1, orphan); + level + 1, orphan, property_name); } } else { sourcemeta::core::WeakPointer new_pointer{pointer}; new_pointer.push_back(std::cref(pair.first)); walk(pointer, new_pointer, subschemas, pair.second, walker, resolver, - current_dialect, current_base_dialect, type, level + 1, orphan); + current_dialect, current_base_dialect, type, level + 1, orphan, + property_name); } break; @@ -366,7 +377,8 @@ sourcemeta::core::SchemaIterator::SchemaIterator( .vocabularies = {}, .base_dialect = std::nullopt, .subschema = schema, - .orphan = false}; + .orphan = false, + .property_name = false}; this->subschemas.push_back(std::move(entry)); } else { const auto resolved_base_dialect{ @@ -374,7 +386,7 @@ sourcemeta::core::SchemaIterator::SchemaIterator( assert(resolved_base_dialect.has_value()); walk(std::nullopt, pointer, this->subschemas, schema, walker, resolver, resolved_dialect, resolved_base_dialect.value(), - SchemaWalkerType_t::Deep, 0, false); + SchemaWalkerType_t::Deep, 0, false, false); } } @@ -392,7 +404,7 @@ sourcemeta::core::SchemaIteratorFlat::SchemaIteratorFlat( assert(resolved_base_dialect.has_value()); walk(std::nullopt, pointer, this->subschemas, schema, walker, resolver, resolved_dialect, resolved_base_dialect.value(), - SchemaWalkerType_t::Flat, 0, false); + SchemaWalkerType_t::Flat, 0, false, false); } } @@ -427,7 +439,8 @@ sourcemeta::core::SchemaKeywordIterator::SchemaKeywordIterator( .vocabularies = vocabularies, .base_dialect = maybe_base_dialect, .subschema = entry.second, - .orphan = false}; + .orphan = false, + .property_name = false}; this->entries.push_back(std::move(subschema_entry)); } diff --git a/test/jsonschema/jsonschema_frame_2019_09_test.cc b/test/jsonschema/jsonschema_frame_2019_09_test.cc index 4ed1141a1..86b798ea0 100644 --- a/test/jsonschema/jsonschema_frame_2019_09_test.cc +++ b/test/jsonschema/jsonschema_frame_2019_09_test.cc @@ -8,43 +8,48 @@ #define EXPECT_FRAME_STATIC_2019_09_POINTER( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_POINTER(frame, reference, root_id, expected_pointer, \ "https://json-schema.org/draft/2019-09/schema", \ JSON_Schema_2019_09, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); #define EXPECT_FRAME_STATIC_2019_09_RESOURCE( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_RESOURCE(frame, reference, root_id, expected_pointer, \ "https://json-schema.org/draft/2019-09/schema", \ JSON_Schema_2019_09, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); #define EXPECT_FRAME_STATIC_2019_09_ANCHOR( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_ANCHOR(frame, reference, root_id, expected_pointer, \ "https://json-schema.org/draft/2019-09/schema", \ JSON_Schema_2019_09, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); #define EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_SUBSCHEMA( \ frame, reference, root_id, expected_pointer, \ "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, \ - expected_base, expected_relative_pointer, expected_parent); + expected_base, expected_relative_pointer, expected_parent, \ + expected_property_name); #define EXPECT_FRAME_DYNAMIC_2019_09_ANCHOR( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_DYNAMIC_ANCHOR(frame, reference, root_id, expected_pointer, \ "https://json-schema.org/draft/2019-09/schema", \ JSON_Schema_2019_09, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); TEST(JSONSchema_frame_2019_09, anonymous_with_nested_schema_resource) { const sourcemeta::core::JSON document = sourcemeta::core::parse_json(R"JSON({ @@ -61,27 +66,30 @@ TEST(JSONSchema_frame_2019_09, anonymous_with_nested_schema_resource) { EXPECT_ANONYMOUS_FRAME_STATIC_RESOURCE( frame, "https://example.com", "/additionalProperties", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); // JSON Pointers EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/$id", "/additionalProperties/$id", "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, - "/additionalProperties"); + "/additionalProperties", false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "https://json-schema.org/draft/2019-09/schema", - JSON_Schema_2019_09, std::nullopt); + JSON_Schema_2019_09, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalProperties", "/additionalProperties", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalProperties/$id", "/additionalProperties/$id", "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, - "/additionalProperties"); + "/additionalProperties", false); // References @@ -108,18 +116,18 @@ TEST(JSONSchema_frame_2019_09, empty_schema) { EXPECT_FRAME_STATIC_2019_09_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); // References @@ -146,18 +154,18 @@ TEST(JSONSchema_frame_2019_09, empty_schema_trailing_hash) { EXPECT_FRAME_STATIC_2019_09_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); // References @@ -188,39 +196,39 @@ TEST(JSONSchema_frame_2019_09, one_level_applicators_without_identifiers) { EXPECT_FRAME_STATIC_2019_09_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", - "https://www.sourcemeta.com/schema", "/items", ""); + "https://www.sourcemeta.com/schema", "/items", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/items/type", "https://www.sourcemeta.com/schema", "/items/type", - "https://www.sourcemeta.com/schema", "/items/type", "/items"); + "https://www.sourcemeta.com/schema", "/items/type", "/items", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", ""); + "https://www.sourcemeta.com/schema", "/properties", "", false); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", - "https://www.sourcemeta.com/schema", "/properties/foo", ""); + "https://www.sourcemeta.com/schema", "/properties/foo", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/foo/type", "https://www.sourcemeta.com/schema", "/properties/foo/type", "https://www.sourcemeta.com/schema", "/properties/foo/type", - "/properties/foo"); + "/properties/foo", false); // References @@ -252,68 +260,68 @@ TEST(JSONSchema_frame_2019_09, one_level_applicators_with_identifiers) { EXPECT_FRAME_STATIC_2019_09_RESOURCE( frame, "https://www.sourcemeta.com/test/qux", "https://www.sourcemeta.com/test/qux", "", - "https://www.sourcemeta.com/test/qux", "", std::nullopt); + "https://www.sourcemeta.com/test/qux", "", std::nullopt, false); EXPECT_FRAME_STATIC_2019_09_RESOURCE( frame, "https://www.sourcemeta.com/foo", "https://www.sourcemeta.com/test/qux", "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); // Anchors EXPECT_FRAME_STATIC_2019_09_ANCHOR( frame, "https://www.sourcemeta.com/test/qux#test", "https://www.sourcemeta.com/test/qux", "/properties/foo", - "https://www.sourcemeta.com/test/qux", "/properties/foo", ""); + "https://www.sourcemeta.com/test/qux", "/properties/foo", "", false); // JSON Pointers EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/test/qux#/$id", "https://www.sourcemeta.com/test/qux", "/$id", - "https://www.sourcemeta.com/test/qux", "/$id", ""); + "https://www.sourcemeta.com/test/qux", "/$id", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/test/qux#/$schema", "https://www.sourcemeta.com/test/qux", "/$schema", - "https://www.sourcemeta.com/test/qux", "/$schema", ""); + "https://www.sourcemeta.com/test/qux", "/$schema", "", false); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/test/qux#/items", "https://www.sourcemeta.com/test/qux", "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/test/qux#/items/$id", "https://www.sourcemeta.com/test/qux", "/items/$id", - "https://www.sourcemeta.com/foo", "/$id", "/items"); + "https://www.sourcemeta.com/foo", "/$id", "/items", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/test/qux#/items/type", "https://www.sourcemeta.com/test/qux", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/test/qux#/properties", "https://www.sourcemeta.com/test/qux", "/properties", - "https://www.sourcemeta.com/test/qux", "/properties", ""); + "https://www.sourcemeta.com/test/qux", "/properties", "", false); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/test/qux#/properties/foo", "https://www.sourcemeta.com/test/qux", "/properties/foo", - "https://www.sourcemeta.com/test/qux", "/properties/foo", ""); + "https://www.sourcemeta.com/test/qux", "/properties/foo", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/test/qux#/properties/foo/$anchor", "https://www.sourcemeta.com/test/qux", "/properties/foo/$anchor", "https://www.sourcemeta.com/test/qux", "/properties/foo/$anchor", - "/properties/foo"); + "/properties/foo", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/test/qux#/properties/foo/type", "https://www.sourcemeta.com/test/qux", "/properties/foo/type", "https://www.sourcemeta.com/test/qux", "/properties/foo/type", - "/properties/foo"); + "/properties/foo", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/foo#/$id", "https://www.sourcemeta.com/test/qux", "/items/$id", - "https://www.sourcemeta.com/foo", "/$id", "/items"); + "https://www.sourcemeta.com/foo", "/$id", "/items", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/foo#/type", "https://www.sourcemeta.com/test/qux", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); // References @@ -344,42 +352,42 @@ TEST(JSONSchema_frame_2019_09, subschema_absolute_identifier) { EXPECT_FRAME_STATIC_2019_09_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_STATIC_2019_09_RESOURCE( frame, "https://www.sourcemeta.com/foo", "https://www.sourcemeta.com/schema", "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); // JSON Pointers EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/items/$id", "https://www.sourcemeta.com/schema", "/items/$id", - "https://www.sourcemeta.com/foo", "/$id", "/items"); + "https://www.sourcemeta.com/foo", "/$id", "/items", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/items/type", "https://www.sourcemeta.com/schema", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/foo#/$id", "https://www.sourcemeta.com/schema", "/items/$id", - "https://www.sourcemeta.com/foo", "/$id", "/items"); + "https://www.sourcemeta.com/foo", "/$id", "/items", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/foo#/type", "https://www.sourcemeta.com/schema", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); // References @@ -425,136 +433,136 @@ TEST(JSONSchema_frame_2019_09, nested_schemas) { EXPECT_FRAME_STATIC_2019_09_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_STATIC_2019_09_RESOURCE( frame, "https://www.sourcemeta.com/foo", "https://www.sourcemeta.com/schema", "/properties/foo", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); EXPECT_FRAME_STATIC_2019_09_ANCHOR( frame, "https://www.sourcemeta.com/foo#test", "https://www.sourcemeta.com/schema", "/properties/foo", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); EXPECT_FRAME_STATIC_2019_09_RESOURCE( frame, "https://www.sourcemeta.com/bar", "https://www.sourcemeta.com/schema", "/properties/bar", - "https://www.sourcemeta.com/bar", "", ""); + "https://www.sourcemeta.com/bar", "", "", false); EXPECT_FRAME_STATIC_2019_09_RESOURCE( frame, "https://www.sourcemeta.com/baz", "https://www.sourcemeta.com/schema", "/properties/baz", - "https://www.sourcemeta.com/baz", "", ""); + "https://www.sourcemeta.com/baz", "", "", false); EXPECT_FRAME_STATIC_2019_09_ANCHOR( frame, "https://www.sourcemeta.com/baz#extra", "https://www.sourcemeta.com/schema", "/properties/baz/items", - "https://www.sourcemeta.com/baz", "/items", "/properties/baz"); + "https://www.sourcemeta.com/baz", "/items", "/properties/baz", false); EXPECT_FRAME_STATIC_2019_09_RESOURCE( frame, "https://www.sourcemeta.com/qux", "https://www.sourcemeta.com/schema", "/properties/foo/items", - "https://www.sourcemeta.com/qux", "", "/properties/foo"); + "https://www.sourcemeta.com/qux", "", "/properties/foo", false); // JSON Pointers EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", ""); + "https://www.sourcemeta.com/schema", "/properties", "", false); // foo EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/foo/$id", "https://www.sourcemeta.com/schema", "/properties/foo/$id", - "https://www.sourcemeta.com/foo", "/$id", "/properties/foo"); + "https://www.sourcemeta.com/foo", "/$id", "/properties/foo", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/foo/$anchor", "https://www.sourcemeta.com/schema", "/properties/foo/$anchor", - "https://www.sourcemeta.com/foo", "/$anchor", "/properties/foo"); + "https://www.sourcemeta.com/foo", "/$anchor", "/properties/foo", false); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo/items", "https://www.sourcemeta.com/schema", "/properties/foo/items", - "https://www.sourcemeta.com/qux", "", "/properties/foo"); + "https://www.sourcemeta.com/qux", "", "/properties/foo", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/foo/items/$id", "https://www.sourcemeta.com/schema", "/properties/foo/items/$id", - "https://www.sourcemeta.com/qux", "/$id", "/properties/foo/items"); + "https://www.sourcemeta.com/qux", "/$id", "/properties/foo/items", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/foo#/$id", "https://www.sourcemeta.com/schema", "/properties/foo/$id", - "https://www.sourcemeta.com/foo", "/$id", "/properties/foo"); + "https://www.sourcemeta.com/foo", "/$id", "/properties/foo", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/foo#/$anchor", "https://www.sourcemeta.com/schema", "/properties/foo/$anchor", - "https://www.sourcemeta.com/foo", "/$anchor", "/properties/foo"); + "https://www.sourcemeta.com/foo", "/$anchor", "/properties/foo", false); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/foo#/items", "https://www.sourcemeta.com/schema", "/properties/foo/items", - "https://www.sourcemeta.com/qux", "", "/properties/foo"); + "https://www.sourcemeta.com/qux", "", "/properties/foo", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/foo#/items/$id", "https://www.sourcemeta.com/schema", "/properties/foo/items/$id", - "https://www.sourcemeta.com/qux", "/$id", "/properties/foo/items"); + "https://www.sourcemeta.com/qux", "/$id", "/properties/foo/items", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/qux#/$id", "https://www.sourcemeta.com/schema", "/properties/foo/items/$id", - "https://www.sourcemeta.com/qux", "/$id", "/properties/foo/items"); + "https://www.sourcemeta.com/qux", "/$id", "/properties/foo/items", false); // bar EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/bar", "https://www.sourcemeta.com/schema", "/properties/bar", - "https://www.sourcemeta.com/bar", "", ""); + "https://www.sourcemeta.com/bar", "", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/bar/$id", "https://www.sourcemeta.com/schema", "/properties/bar/$id", - "https://www.sourcemeta.com/bar", "/$id", "/properties/bar"); + "https://www.sourcemeta.com/bar", "/$id", "/properties/bar", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/bar#/$id", "https://www.sourcemeta.com/schema", "/properties/bar/$id", - "https://www.sourcemeta.com/bar", "/$id", "/properties/bar"); + "https://www.sourcemeta.com/bar", "/$id", "/properties/bar", false); // baz EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/baz", "https://www.sourcemeta.com/schema", "/properties/baz", - "https://www.sourcemeta.com/baz", "", ""); + "https://www.sourcemeta.com/baz", "", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/baz/$id", "https://www.sourcemeta.com/schema", "/properties/baz/$id", - "https://www.sourcemeta.com/baz", "/$id", "/properties/baz"); + "https://www.sourcemeta.com/baz", "/$id", "/properties/baz", false); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/baz/items", "https://www.sourcemeta.com/schema", "/properties/baz/items", - "https://www.sourcemeta.com/baz", "/items", "/properties/baz"); + "https://www.sourcemeta.com/baz", "/items", "/properties/baz", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/baz/items/$anchor", "https://www.sourcemeta.com/schema", "/properties/baz/items/$anchor", "https://www.sourcemeta.com/baz", "/items/$anchor", - "/properties/baz/items"); + "/properties/baz/items", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/baz#/$id", "https://www.sourcemeta.com/schema", "/properties/baz/$id", - "https://www.sourcemeta.com/baz", "/$id", "/properties/baz"); + "https://www.sourcemeta.com/baz", "/$id", "/properties/baz", false); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/baz#/items", "https://www.sourcemeta.com/schema", "/properties/baz/items", - "https://www.sourcemeta.com/baz", "/items", "/properties/baz"); + "https://www.sourcemeta.com/baz", "/items", "/properties/baz", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/baz#/items/$anchor", "https://www.sourcemeta.com/schema", "/properties/baz/items/$anchor", "https://www.sourcemeta.com/baz", "/items/$anchor", - "/properties/baz/items"); + "/properties/baz/items", false); // References @@ -612,18 +620,18 @@ TEST(JSONSchema_frame_2019_09, explicit_argument_id_same) { EXPECT_FRAME_STATIC_2019_09_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); // References @@ -652,26 +660,26 @@ TEST(JSONSchema_frame_2019_09, anchor_top_level) { EXPECT_FRAME_STATIC_2019_09_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$anchor", "https://www.sourcemeta.com/schema", "/$anchor", - "https://www.sourcemeta.com/schema", "/$anchor", ""); + "https://www.sourcemeta.com/schema", "/$anchor", "", false); // Anchors EXPECT_FRAME_STATIC_2019_09_ANCHOR( frame, "https://www.sourcemeta.com/schema#foo", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // References @@ -714,104 +722,105 @@ TEST(JSONSchema_frame_2019_09, explicit_argument_id_different) { EXPECT_FRAME_STATIC_2019_09_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_STATIC_2019_09_RESOURCE( frame, "https://www.sourcemeta.com/test", "https://www.sourcemeta.com/schema", "/properties/one", - "https://www.sourcemeta.com/test", "", ""); + "https://www.sourcemeta.com/test", "", "", false); EXPECT_FRAME_STATIC_2019_09_RESOURCE( frame, "https://www.example.com", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); - EXPECT_FRAME_STATIC_2019_09_RESOURCE(frame, "https://www.example.com/test", - "https://www.sourcemeta.com/schema", - "/properties/one", - "https://www.example.com/test", "", ""); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); + EXPECT_FRAME_STATIC_2019_09_RESOURCE( + frame, "https://www.example.com/test", + "https://www.sourcemeta.com/schema", "/properties/one", + "https://www.example.com/test", "", "", false); EXPECT_FRAME_STATIC_2019_09_RESOURCE( frame, "https://www.test.com", "https://www.sourcemeta.com/schema", - "/properties/two", "https://www.test.com", "", ""); + "/properties/two", "https://www.test.com", "", "", false); // Anchors EXPECT_FRAME_STATIC_2019_09_ANCHOR( frame, "https://www.sourcemeta.com/schema#foo", "https://www.sourcemeta.com/schema", "/items", - "https://www.sourcemeta.com/schema", "/items", ""); + "https://www.sourcemeta.com/schema", "/items", "", false); EXPECT_FRAME_STATIC_2019_09_ANCHOR( frame, "https://www.example.com#foo", "https://www.sourcemeta.com/schema", - "/items", "https://www.example.com", "/items", ""); + "/items", "https://www.example.com", "/items", "", false); EXPECT_FRAME_STATIC_2019_09_ANCHOR( frame, "https://www.sourcemeta.com/test#bar", "https://www.sourcemeta.com/schema", "/properties/one", - "https://www.sourcemeta.com/test", "", ""); - EXPECT_FRAME_STATIC_2019_09_ANCHOR(frame, "https://www.example.com/test#bar", - "https://www.sourcemeta.com/schema", - "/properties/one", - "https://www.example.com/test", "", ""); + "https://www.sourcemeta.com/test", "", "", false); + EXPECT_FRAME_STATIC_2019_09_ANCHOR( + frame, "https://www.example.com/test#bar", + "https://www.sourcemeta.com/schema", "/properties/one", + "https://www.example.com/test", "", "", false); EXPECT_FRAME_STATIC_2019_09_ANCHOR( frame, "https://www.test.com#baz", "https://www.sourcemeta.com/schema", - "/properties/two", "https://www.test.com", "", ""); + "/properties/two", "https://www.test.com", "", "", false); // JSON Pointers EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", - "https://www.sourcemeta.com/schema", "/items", ""); + "https://www.sourcemeta.com/schema", "/items", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/items/$anchor", "https://www.sourcemeta.com/schema", "/items/$anchor", - "https://www.sourcemeta.com/schema", "/items/$anchor", "/items"); + "https://www.sourcemeta.com/schema", "/items/$anchor", "/items", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", ""); + "https://www.sourcemeta.com/schema", "/properties", "", false); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/one", "https://www.sourcemeta.com/schema", "/properties/one", - "https://www.sourcemeta.com/test", "", ""); + "https://www.sourcemeta.com/test", "", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/one/$id", "https://www.sourcemeta.com/schema", "/properties/one/$id", - "https://www.sourcemeta.com/test", "/$id", "/properties/one"); + "https://www.sourcemeta.com/test", "/$id", "/properties/one", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/one/$anchor", "https://www.sourcemeta.com/schema", "/properties/one/$anchor", - "https://www.sourcemeta.com/test", "/$anchor", "/properties/one"); + "https://www.sourcemeta.com/test", "/$anchor", "/properties/one", false); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/two", "https://www.sourcemeta.com/schema", "/properties/two", - "https://www.test.com", "", ""); + "https://www.test.com", "", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/two/$id", "https://www.sourcemeta.com/schema", "/properties/two/$id", - "https://www.test.com", "/$id", "/properties/two"); + "https://www.test.com", "/$id", "/properties/two", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/two/$anchor", "https://www.sourcemeta.com/schema", "/properties/two/$anchor", - "https://www.test.com", "/$anchor", "/properties/two"); + "https://www.test.com", "/$anchor", "/properties/two", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/test#/$id", "https://www.sourcemeta.com/schema", "/properties/one/$id", - "https://www.sourcemeta.com/test", "/$id", "/properties/one"); + "https://www.sourcemeta.com/test", "/$id", "/properties/one", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/test#/$anchor", "https://www.sourcemeta.com/schema", "/properties/one/$anchor", - "https://www.sourcemeta.com/test", "/$anchor", "/properties/one"); + "https://www.sourcemeta.com/test", "/$anchor", "/properties/one", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.test.com#/$id", "https://www.sourcemeta.com/schema", - "/properties/two/$id", "https://www.test.com", "/$id", "/properties/two"); + "/properties/two/$id", "https://www.test.com", "/$id", "/properties/two", + false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.test.com#/$anchor", "https://www.sourcemeta.com/schema", "/properties/two/$anchor", - "https://www.test.com", "/$anchor", "/properties/two"); + "https://www.test.com", "/$anchor", "/properties/two", false); // References @@ -838,13 +847,14 @@ TEST(JSONSchema_frame_2019_09, ref_metaschema) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "https://json-schema.org/draft/2019-09/schema", - JSON_Schema_2019_09, std::nullopt); + JSON_Schema_2019_09, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "https://json-schema.org/draft/2019-09/schema", - JSON_Schema_2019_09, ""); + JSON_Schema_2019_09, "", false); // References @@ -900,29 +910,29 @@ TEST(JSONSchema_frame_2019_09, recursive_anchor_true_with_id) { EXPECT_FRAME_DYNAMIC_2019_09_ANCHOR( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // Static identifiers EXPECT_FRAME_STATIC_2019_09_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // Static pointers EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$recursiveAnchor", "https://www.sourcemeta.com/schema", "/$recursiveAnchor", - "https://www.sourcemeta.com/schema", "/$recursiveAnchor", ""); + "https://www.sourcemeta.com/schema", "/$recursiveAnchor", "", false); // References @@ -953,22 +963,22 @@ TEST(JSONSchema_frame_2019_09, recursive_anchor_false_with_id) { EXPECT_FRAME_STATIC_2019_09_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // Static pointers EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$recursiveAnchor", "https://www.sourcemeta.com/schema", "/$recursiveAnchor", - "https://www.sourcemeta.com/schema", "/$recursiveAnchor", ""); + "https://www.sourcemeta.com/schema", "/$recursiveAnchor", "", false); // References @@ -1001,27 +1011,31 @@ TEST(JSONSchema_frame_2019_09, recursive_anchor_true_without_id) { EXPECT_ANONYMOUS_FRAME_DYNAMIC_ANCHOR( frame, "", "/properties/foo", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); // Static frames EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "https://json-schema.org/draft/2019-09/schema", - JSON_Schema_2019_09, std::nullopt); + JSON_Schema_2019_09, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties", "/properties", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/properties/foo", "/properties/foo", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/$recursiveAnchor", "/properties/foo/$recursiveAnchor", "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, - "/properties/foo"); + "/properties/foo", false); // References @@ -1054,21 +1068,24 @@ TEST(JSONSchema_frame_2019_09, recursive_anchor_false_without_id) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "https://json-schema.org/draft/2019-09/schema", - JSON_Schema_2019_09, std::nullopt); + JSON_Schema_2019_09, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties", "/properties", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/properties/foo", "/properties/foo", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/$recursiveAnchor", "/properties/foo/$recursiveAnchor", "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, - "/properties/foo"); + "/properties/foo", false); // References @@ -1097,18 +1114,20 @@ TEST(JSONSchema_frame_2019_09, recursive_ref_no_recursive_anchor_anonymous) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "https://json-schema.org/draft/2019-09/schema", - JSON_Schema_2019_09, std::nullopt); + JSON_Schema_2019_09, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalItems", "/additionalItems", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalItems/$recursiveRef", "/additionalItems/$recursiveRef", "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, - "/additionalItems"); + "/additionalItems", false); // References @@ -1141,25 +1160,25 @@ TEST(JSONSchema_frame_2019_09, recursive_ref_no_recursive_anchor) { EXPECT_FRAME_STATIC_2019_09_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/additionalItems", "https://www.sourcemeta.com/schema", "/additionalItems", - "https://www.sourcemeta.com/schema", "/additionalItems", ""); + "https://www.sourcemeta.com/schema", "/additionalItems", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/additionalItems/$recursiveRef", "https://www.sourcemeta.com/schema", "/additionalItems/$recursiveRef", "https://www.sourcemeta.com/schema", "/additionalItems/$recursiveRef", - "/additionalItems"); + "/additionalItems", false); // References @@ -1193,21 +1212,24 @@ TEST(JSONSchema_frame_2019_09, recursive_ref_recursive_anchor_false_anonymous) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "https://json-schema.org/draft/2019-09/schema", - JSON_Schema_2019_09, std::nullopt); + JSON_Schema_2019_09, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$recursiveAnchor", "/$recursiveAnchor", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalItems", "/additionalItems", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalItems/$recursiveRef", "/additionalItems/$recursiveRef", "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, - "/additionalItems"); + "/additionalItems", false); // References @@ -1241,29 +1263,29 @@ TEST(JSONSchema_frame_2019_09, recursive_ref_recursive_anchor_false) { EXPECT_FRAME_STATIC_2019_09_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$recursiveAnchor", "https://www.sourcemeta.com/schema", "/$recursiveAnchor", - "https://www.sourcemeta.com/schema", "/$recursiveAnchor", ""); + "https://www.sourcemeta.com/schema", "/$recursiveAnchor", "", false); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/additionalItems", "https://www.sourcemeta.com/schema", "/additionalItems", - "https://www.sourcemeta.com/schema", "/additionalItems", ""); + "https://www.sourcemeta.com/schema", "/additionalItems", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/additionalItems/$recursiveRef", "https://www.sourcemeta.com/schema", "/additionalItems/$recursiveRef", "https://www.sourcemeta.com/schema", "/additionalItems/$recursiveRef", - "/additionalItems"); + "/additionalItems", false); // References @@ -1297,27 +1319,30 @@ TEST(JSONSchema_frame_2019_09, recursive_ref_recursive_anchor_true_anonymous) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "https://json-schema.org/draft/2019-09/schema", - JSON_Schema_2019_09, std::nullopt); + JSON_Schema_2019_09, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$recursiveAnchor", "/$recursiveAnchor", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalItems", "/additionalItems", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalItems/$recursiveRef", "/additionalItems/$recursiveRef", "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, - "/additionalItems"); + "/additionalItems", false); // Anchors EXPECT_ANONYMOUS_FRAME_DYNAMIC_ANCHOR( frame, "", "", "https://json-schema.org/draft/2019-09/schema", - JSON_Schema_2019_09, std::nullopt); + JSON_Schema_2019_09, std::nullopt, false); // References @@ -1351,36 +1376,36 @@ TEST(JSONSchema_frame_2019_09, recursive_ref_recursive_anchor_true) { EXPECT_FRAME_STATIC_2019_09_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$recursiveAnchor", "https://www.sourcemeta.com/schema", "/$recursiveAnchor", - "https://www.sourcemeta.com/schema", "/$recursiveAnchor", ""); + "https://www.sourcemeta.com/schema", "/$recursiveAnchor", "", false); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/additionalItems", "https://www.sourcemeta.com/schema", "/additionalItems", - "https://www.sourcemeta.com/schema", "/additionalItems", ""); + "https://www.sourcemeta.com/schema", "/additionalItems", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/additionalItems/$recursiveRef", "https://www.sourcemeta.com/schema", "/additionalItems/$recursiveRef", "https://www.sourcemeta.com/schema", "/additionalItems/$recursiveRef", - "/additionalItems"); + "/additionalItems", false); // Anchors EXPECT_FRAME_DYNAMIC_2019_09_ANCHOR( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // References @@ -1416,46 +1441,49 @@ TEST(JSONSchema_frame_2019_09, EXPECT_ANONYMOUS_FRAME_STATIC_RESOURCE( frame, "https://example.com", "/additionalItems", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "https://json-schema.org/draft/2019-09/schema", - JSON_Schema_2019_09, std::nullopt); + JSON_Schema_2019_09, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalItems", "/additionalItems", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalItems/$id", "/additionalItems/$id", "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, - "/additionalItems"); + "/additionalItems", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalItems/$recursiveAnchor", "/additionalItems/$recursiveAnchor", "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, - "/additionalItems"); + "/additionalItems", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalItems/$recursiveRef", "/additionalItems/$recursiveRef", "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, - "/additionalItems"); + "/additionalItems", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/$id", "/additionalItems/$id", "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, - "/additionalItems"); + "/additionalItems", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/$recursiveAnchor", "/additionalItems/$recursiveAnchor", "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, - "/additionalItems"); + "/additionalItems", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/$recursiveRef", "/additionalItems/$recursiveRef", "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, - "/additionalItems"); + "/additionalItems", false); // References @@ -1490,52 +1518,56 @@ TEST(JSONSchema_frame_2019_09, EXPECT_ANONYMOUS_FRAME_STATIC_RESOURCE( frame, "https://example.com", "/additionalItems", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "https://json-schema.org/draft/2019-09/schema", - JSON_Schema_2019_09, std::nullopt); + JSON_Schema_2019_09, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalItems", "/additionalItems", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalItems/$id", "/additionalItems/$id", "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, - "/additionalItems"); + "/additionalItems", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalItems/$recursiveAnchor", "/additionalItems/$recursiveAnchor", "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, - "/additionalItems"); + "/additionalItems", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalItems/$recursiveRef", "/additionalItems/$recursiveRef", "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, - "/additionalItems"); + "/additionalItems", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/$id", "/additionalItems/$id", "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, - "/additionalItems"); + "/additionalItems", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/$recursiveAnchor", "/additionalItems/$recursiveAnchor", "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, - "/additionalItems"); + "/additionalItems", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/$recursiveRef", "/additionalItems/$recursiveRef", "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, - "/additionalItems"); + "/additionalItems", false); // Anchors EXPECT_ANONYMOUS_FRAME_DYNAMIC_ANCHOR( frame, "https://example.com", "/additionalItems", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); // References @@ -1570,38 +1602,38 @@ TEST(JSONSchema_frame_2019_09, recursive_ref_nested_recursive_anchor_true) { EXPECT_FRAME_STATIC_2019_09_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/additionalItems/$recursiveAnchor", "https://www.sourcemeta.com/schema", "/additionalItems/$recursiveAnchor", "https://www.sourcemeta.com/schema", "/additionalItems/$recursiveAnchor", - "/additionalItems"); + "/additionalItems", false); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/additionalItems", "https://www.sourcemeta.com/schema", "/additionalItems", - "https://www.sourcemeta.com/schema", "/additionalItems", ""); + "https://www.sourcemeta.com/schema", "/additionalItems", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/additionalItems/$recursiveRef", "https://www.sourcemeta.com/schema", "/additionalItems/$recursiveRef", "https://www.sourcemeta.com/schema", "/additionalItems/$recursiveRef", - "/additionalItems"); + "/additionalItems", false); // Anchors EXPECT_FRAME_DYNAMIC_2019_09_ANCHOR( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "/additionalItems", - "https://www.sourcemeta.com/schema", "/additionalItems", ""); + "https://www.sourcemeta.com/schema", "/additionalItems", "", false); // References @@ -1639,69 +1671,69 @@ TEST(JSONSchema_frame_2019_09, recursive_ref_multiple_recursive_anchor_true) { EXPECT_FRAME_STATIC_2019_09_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_STATIC_2019_09_RESOURCE( frame, "https://www.sourcemeta.com/nested", "https://www.sourcemeta.com/schema", "/additionalItems", - "https://www.sourcemeta.com/nested", "", ""); + "https://www.sourcemeta.com/nested", "", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$recursiveAnchor", "https://www.sourcemeta.com/schema", "/$recursiveAnchor", - "https://www.sourcemeta.com/schema", "/$recursiveAnchor", ""); + "https://www.sourcemeta.com/schema", "/$recursiveAnchor", "", false); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/additionalItems", "https://www.sourcemeta.com/schema", "/additionalItems", - "https://www.sourcemeta.com/nested", "", ""); + "https://www.sourcemeta.com/nested", "", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/additionalItems/$id", "https://www.sourcemeta.com/schema", "/additionalItems/$id", - "https://www.sourcemeta.com/nested", "/$id", "/additionalItems"); + "https://www.sourcemeta.com/nested", "/$id", "/additionalItems", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/additionalItems/$recursiveAnchor", "https://www.sourcemeta.com/schema", "/additionalItems/$recursiveAnchor", "https://www.sourcemeta.com/nested", "/$recursiveAnchor", - "/additionalItems"); + "/additionalItems", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/additionalItems/$recursiveRef", "https://www.sourcemeta.com/schema", "/additionalItems/$recursiveRef", - "https://www.sourcemeta.com/nested", "/$recursiveRef", - "/additionalItems"); + "https://www.sourcemeta.com/nested", "/$recursiveRef", "/additionalItems", + false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/nested#/$id", "https://www.sourcemeta.com/schema", "/additionalItems/$id", - "https://www.sourcemeta.com/nested", "/$id", "/additionalItems"); + "https://www.sourcemeta.com/nested", "/$id", "/additionalItems", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/nested#/$recursiveAnchor", "https://www.sourcemeta.com/schema", "/additionalItems/$recursiveAnchor", "https://www.sourcemeta.com/nested", "/$recursiveAnchor", - "/additionalItems"); + "/additionalItems", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/nested#/$recursiveRef", "https://www.sourcemeta.com/schema", "/additionalItems/$recursiveRef", - "https://www.sourcemeta.com/nested", "/$recursiveRef", - "/additionalItems"); + "https://www.sourcemeta.com/nested", "/$recursiveRef", "/additionalItems", + false); // Anchors EXPECT_FRAME_DYNAMIC_2019_09_ANCHOR( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_DYNAMIC_2019_09_ANCHOR( frame, "https://www.sourcemeta.com/nested", "https://www.sourcemeta.com/schema", "/additionalItems", - "https://www.sourcemeta.com/nested", "", ""); + "https://www.sourcemeta.com/nested", "", "", false); // References @@ -1775,48 +1807,53 @@ TEST(JSONSchema_frame_2019_09, recursive_anchor_on_relative_id) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "https://json-schema.org/draft/2019-09/schema", - JSON_Schema_2019_09, std::nullopt); + JSON_Schema_2019_09, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_RESOURCE( frame, "middle", "/additionalItems", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); // JSON Pointers EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "https://json-schema.org/draft/2019-09/schema", - JSON_Schema_2019_09, std::nullopt); + JSON_Schema_2019_09, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$recursiveAnchor", "/$recursiveAnchor", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalItems", "/additionalItems", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalItems/$id", "/additionalItems/$id", "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, - "/additionalItems"); + "/additionalItems", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalItems/$recursiveAnchor", "/additionalItems/$recursiveAnchor", "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, - "/additionalItems"); + "/additionalItems", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "middle#/$recursiveAnchor", "/additionalItems/$recursiveAnchor", "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, - "/additionalItems"); + "/additionalItems", false); // Anchors EXPECT_ANONYMOUS_FRAME_DYNAMIC_ANCHOR( frame, "", "", "https://json-schema.org/draft/2019-09/schema", - JSON_Schema_2019_09, std::nullopt); + JSON_Schema_2019_09, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_DYNAMIC_ANCHOR( frame, "middle", "/additionalItems", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); // References @@ -1848,35 +1885,35 @@ TEST(JSONSchema_frame_2019_09, ref_with_id) { EXPECT_FRAME_STATIC_2019_09_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$ref", "https://www.sourcemeta.com/schema", "/$ref", - "https://www.sourcemeta.com/schema", "/$ref", ""); + "https://www.sourcemeta.com/schema", "/$ref", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$defs", "https://www.sourcemeta.com/schema", "/$defs", - "https://www.sourcemeta.com/schema", "/$defs", ""); + "https://www.sourcemeta.com/schema", "/$defs", "", false); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/$defs/string", "https://www.sourcemeta.com/schema", "/$defs/string", - "https://www.sourcemeta.com/schema", "/$defs/string", ""); + "https://www.sourcemeta.com/schema", "/$defs/string", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$defs/string/type", "https://www.sourcemeta.com/schema", "/$defs/string/type", "https://www.sourcemeta.com/schema", "/$defs/string/type", - "/$defs/string"); + "/$defs/string", false); // References @@ -1912,44 +1949,44 @@ TEST(JSONSchema_frame_2019_09, ref_from_definitions) { EXPECT_FRAME_STATIC_2019_09_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$ref", "https://www.sourcemeta.com/schema", "/$ref", - "https://www.sourcemeta.com/schema", "/$ref", ""); + "https://www.sourcemeta.com/schema", "/$ref", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/definitions", "https://www.sourcemeta.com/schema", "/definitions", - "https://www.sourcemeta.com/schema", "/definitions", ""); + "https://www.sourcemeta.com/schema", "/definitions", "", false); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/definitions/middle", "https://www.sourcemeta.com/schema", "/definitions/middle", - "https://www.sourcemeta.com/schema", "/definitions/middle", ""); + "https://www.sourcemeta.com/schema", "/definitions/middle", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/definitions/middle/$ref", "https://www.sourcemeta.com/schema", "/definitions/middle/$ref", "https://www.sourcemeta.com/schema", "/definitions/middle/$ref", - "/definitions/middle"); + "/definitions/middle", false); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/definitions/string", "https://www.sourcemeta.com/schema", "/definitions/string", - "https://www.sourcemeta.com/schema", "/definitions/string", ""); + "https://www.sourcemeta.com/schema", "/definitions/string", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/definitions/string/type", "https://www.sourcemeta.com/schema", "/definitions/string/type", "https://www.sourcemeta.com/schema", "/definitions/string/type", - "/definitions/string"); + "/definitions/string", false); // References @@ -1984,14 +2021,15 @@ TEST(JSONSchema_frame_2019_09, relative_base_uri_without_ref) { EXPECT_EQ(frame.locations().size(), 3); EXPECT_FRAME_STATIC_2019_09_RESOURCE(frame, "common", "common", "", "common", - "", std::nullopt); + "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_2019_09_POINTER(frame, "common#/$schema", "common", - "/$schema", "common", "/$schema", ""); + "/$schema", "common", "/$schema", "", + false); EXPECT_FRAME_STATIC_2019_09_POINTER(frame, "common#/$id", "common", "/$id", - "common", "/$id", ""); + "common", "/$id", "", false); // References @@ -2023,33 +2061,36 @@ TEST(JSONSchema_frame_2019_09, relative_base_uri_with_ref) { EXPECT_EQ(frame.locations().size(), 10); EXPECT_FRAME_STATIC_2019_09_RESOURCE(frame, "common", "common", "", "common", - "", std::nullopt); + "", std::nullopt, false); // Anchors EXPECT_FRAME_STATIC_2019_09_ANCHOR(frame, "common#foo", "common", - "/$defs/foo", "common", "/$defs/foo", ""); + "/$defs/foo", "common", "/$defs/foo", "", + false); // JSON Pointers EXPECT_FRAME_STATIC_2019_09_POINTER(frame, "common#/$schema", "common", - "/$schema", "common", "/$schema", ""); + "/$schema", "common", "/$schema", "", + false); EXPECT_FRAME_STATIC_2019_09_POINTER(frame, "common#/$id", "common", "/$id", - "common", "/$id", ""); + "common", "/$id", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER(frame, "common#/allOf", "common", - "/allOf", "common", "/allOf", ""); + "/allOf", "common", "/allOf", "", false); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA(frame, "common#/allOf/0", "common", - "/allOf/0", "common", "/allOf/0", ""); + "/allOf/0", "common", "/allOf/0", "", + false); EXPECT_FRAME_STATIC_2019_09_POINTER(frame, "common#/allOf/0/$ref", "common", "/allOf/0/$ref", "common", - "/allOf/0/$ref", "/allOf/0"); + "/allOf/0/$ref", "/allOf/0", false); EXPECT_FRAME_STATIC_2019_09_POINTER(frame, "common#/$defs", "common", - "/$defs", "common", "/$defs", ""); + "/$defs", "common", "/$defs", "", false); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA(frame, "common#/$defs/foo", "common", "/$defs/foo", "common", "/$defs/foo", - ""); - EXPECT_FRAME_STATIC_2019_09_POINTER(frame, "common#/$defs/foo/$anchor", - "common", "/$defs/foo/$anchor", "common", - "/$defs/foo/$anchor", "/$defs/foo"); + "", false); + EXPECT_FRAME_STATIC_2019_09_POINTER( + frame, "common#/$defs/foo/$anchor", "common", "/$defs/foo/$anchor", + "common", "/$defs/foo/$anchor", "/$defs/foo", false); // References @@ -2076,14 +2117,15 @@ TEST(JSONSchema_frame_2019_09, relative_id_leading_slash) { EXPECT_EQ(frame.locations().size(), 3); EXPECT_FRAME_STATIC_2019_09_RESOURCE(frame, "/base", "/base", "", "/base", "", - std::nullopt); + std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_2019_09_POINTER(frame, "/base#/$id", "/base", "/$id", - "/base", "/$id", ""); + "/base", "/$id", "", false); EXPECT_FRAME_STATIC_2019_09_POINTER(frame, "/base#/$schema", "/base", - "/$schema", "/base", "/$schema", ""); + "/$schema", "/base", "/$schema", "", + false); // References @@ -2123,44 +2165,47 @@ TEST(JSONSchema_frame_2019_09, EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "https://json-schema.org/draft/2019-09/schema", - JSON_Schema_2019_09, std::nullopt); + JSON_Schema_2019_09, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties", "/properties", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/properties/foo", "/properties/foo", - "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, ""); + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/$ref", "/properties/foo/$ref", "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, - "/properties/foo"); + "/properties/foo", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/properties", "/properties/foo/properties", "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, - "/properties/foo"); + "/properties/foo", false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/properties/foo/properties/bar", "/properties/foo/properties/bar", "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, - "/properties/foo"); + "/properties/foo", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/properties/bar/$ref", "/properties/foo/properties/bar/$ref", "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, - "/properties/foo/properties/bar"); + "/properties/foo/properties/bar", false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/properties/foo/properties/bar/additionalProperties", "/properties/foo/properties/bar/additionalProperties", "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, - "/properties/foo/properties/bar"); + "/properties/foo/properties/bar", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/properties/bar/additionalProperties/$ref", "/properties/foo/properties/bar/additionalProperties/$ref", "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, - "/properties/foo/properties/bar/additionalProperties"); + "/properties/foo/properties/bar/additionalProperties", false); EXPECT_EQ(frame.references().size(), 4); @@ -2179,3 +2224,143 @@ TEST(JSONSchema_frame_2019_09, "#/definitions/threshold", "", "/definitions/threshold", "#/definitions/threshold"); } + +TEST(JSONSchema_frame_2019_09, propertyNames_with_nested_applicators) { + const sourcemeta::core::JSON document = sourcemeta::core::parse_json(R"JSON({ + "$schema": "https://json-schema.org/draft/2019-09/schema", + "$anchor": "outer", + "propertyNames": { + "$anchor": "inner", + "anyOf": [ + { "minLength": 1 }, + { "maxLength": 10 }, + { "$anchor": "nested" } + ], + "additionalProperties": { + "$anchor": "other", + "type": "boolean" + }, + "$defs": { + "test": { + "type": "string" + } + } + } + })JSON"); + + sourcemeta::core::SchemaFrame frame{ + sourcemeta::core::SchemaFrame::Mode::References}; + frame.analyse(document, sourcemeta::core::schema_walker, + sourcemeta::core::schema_resolver); + + EXPECT_EQ(frame.locations().size(), 22); + + EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( + frame, "", "", "https://json-schema.org/draft/2019-09/schema", + JSON_Schema_2019_09, std::nullopt, false); + EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( + frame, "#/propertyNames", "/propertyNames", + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + true); + EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( + frame, "#/propertyNames/anyOf/0", "/propertyNames/anyOf/0", + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, + "/propertyNames", true); + EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( + frame, "#/propertyNames/anyOf/1", "/propertyNames/anyOf/1", + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, + "/propertyNames", true); + EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( + frame, "#/propertyNames/anyOf/2", "/propertyNames/anyOf/2", + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, + "/propertyNames", true); + EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( + frame, "#/propertyNames/additionalProperties", + "/propertyNames/additionalProperties", + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, + "/propertyNames", false); + EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( + frame, "#/propertyNames/$defs/test", "/propertyNames/$defs/test", + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, + "/propertyNames", false); + + // Anchors + + EXPECT_ANONYMOUS_FRAME_STATIC_ANCHOR( + frame, "#outer", "", "https://json-schema.org/draft/2019-09/schema", + JSON_Schema_2019_09, std::nullopt, false); + EXPECT_ANONYMOUS_FRAME_STATIC_ANCHOR( + frame, "#inner", "/propertyNames", + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + true); + EXPECT_ANONYMOUS_FRAME_STATIC_ANCHOR( + frame, "#nested", "/propertyNames/anyOf/2", + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, + "/propertyNames", true); + EXPECT_ANONYMOUS_FRAME_STATIC_ANCHOR( + frame, "#other", "/propertyNames/additionalProperties", + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, + "/propertyNames", false); + + // JSON Pointers + + EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( + frame, "#/$schema", "/$schema", + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); + EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( + frame, "#/$anchor", "/$anchor", + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, "", + false); + EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( + frame, "#/propertyNames/$anchor", "/propertyNames/$anchor", + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, + "/propertyNames", true); + EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( + frame, "#/propertyNames/anyOf", "/propertyNames/anyOf", + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, + "/propertyNames", true); + EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( + frame, "#/propertyNames/anyOf/0/minLength", + "/propertyNames/anyOf/0/minLength", + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, + "/propertyNames/anyOf/0", true); + EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( + frame, "#/propertyNames/anyOf/1/maxLength", + "/propertyNames/anyOf/1/maxLength", + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, + "/propertyNames/anyOf/1", true); + EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( + frame, "#/propertyNames/anyOf/2/$anchor", + "/propertyNames/anyOf/2/$anchor", + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, + "/propertyNames/anyOf/2", true); + EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( + frame, "#/propertyNames/additionalProperties/$anchor", + "/propertyNames/additionalProperties/$anchor", + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, + "/propertyNames/additionalProperties", false); + EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( + frame, "#/propertyNames/additionalProperties/type", + "/propertyNames/additionalProperties/type", + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, + "/propertyNames/additionalProperties", false); + EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( + frame, "#/propertyNames/$defs", "/propertyNames/$defs", + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, + "/propertyNames", true); + EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( + frame, "#/propertyNames/$defs/test/type", + "/propertyNames/$defs/test/type", + "https://json-schema.org/draft/2019-09/schema", JSON_Schema_2019_09, + "/propertyNames/$defs/test", false); + + // References + + EXPECT_EQ(frame.references().size(), 1); + + EXPECT_STATIC_REFERENCE( + frame, "/$schema", "https://json-schema.org/draft/2019-09/schema", + "https://json-schema.org/draft/2019-09/schema", std::nullopt, + "https://json-schema.org/draft/2019-09/schema"); +} diff --git a/test/jsonschema/jsonschema_frame_2020_12_test.cc b/test/jsonschema/jsonschema_frame_2020_12_test.cc index 3d0351956..272541dd7 100644 --- a/test/jsonschema/jsonschema_frame_2020_12_test.cc +++ b/test/jsonschema/jsonschema_frame_2020_12_test.cc @@ -8,43 +8,48 @@ #define EXPECT_FRAME_STATIC_2020_12_POINTER( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_POINTER(frame, reference, root_id, expected_pointer, \ "https://json-schema.org/draft/2020-12/schema", \ JSON_Schema_2020_12, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); #define EXPECT_FRAME_STATIC_2020_12_RESOURCE( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_RESOURCE(frame, reference, root_id, expected_pointer, \ "https://json-schema.org/draft/2020-12/schema", \ JSON_Schema_2020_12, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); #define EXPECT_FRAME_STATIC_2020_12_ANCHOR( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_ANCHOR(frame, reference, root_id, expected_pointer, \ "https://json-schema.org/draft/2020-12/schema", \ JSON_Schema_2020_12, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); #define EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_SUBSCHEMA( \ frame, reference, root_id, expected_pointer, \ "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, \ - expected_base, expected_relative_pointer, expected_parent); + expected_base, expected_relative_pointer, expected_parent, \ + expected_property_name); #define EXPECT_FRAME_DYNAMIC_2020_12_ANCHOR( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_DYNAMIC_ANCHOR(frame, reference, root_id, expected_pointer, \ "https://json-schema.org/draft/2020-12/schema", \ JSON_Schema_2020_12, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); TEST(JSONSchema_frame_2020_12, anonymous_with_nested_schema_resource) { const sourcemeta::core::JSON document = sourcemeta::core::parse_json(R"JSON({ @@ -61,27 +66,30 @@ TEST(JSONSchema_frame_2020_12, anonymous_with_nested_schema_resource) { EXPECT_ANONYMOUS_FRAME_STATIC_RESOURCE( frame, "https://example.com", "/additionalProperties", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/$id", "/additionalProperties/$id", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/additionalProperties"); + "/additionalProperties", false); // JSON Pointers EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, std::nullopt); + JSON_Schema_2020_12, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalProperties", "/additionalProperties", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalProperties/$id", "/additionalProperties/$id", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/additionalProperties"); + "/additionalProperties", false); // References @@ -108,18 +116,18 @@ TEST(JSONSchema_frame_2020_12, empty_schema) { EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); // References @@ -146,18 +154,18 @@ TEST(JSONSchema_frame_2020_12, empty_schema_trailing_hash) { EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); // References @@ -188,39 +196,39 @@ TEST(JSONSchema_frame_2020_12, one_level_applicators_without_identifiers) { EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", - "https://www.sourcemeta.com/schema", "/items", ""); + "https://www.sourcemeta.com/schema", "/items", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/items/type", "https://www.sourcemeta.com/schema", "/items/type", - "https://www.sourcemeta.com/schema", "/items/type", "/items"); + "https://www.sourcemeta.com/schema", "/items/type", "/items", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", ""); + "https://www.sourcemeta.com/schema", "/properties", "", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", - "https://www.sourcemeta.com/schema", "/properties/foo", ""); + "https://www.sourcemeta.com/schema", "/properties/foo", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/foo/type", "https://www.sourcemeta.com/schema", "/properties/foo/type", "https://www.sourcemeta.com/schema", "/properties/foo/type", - "/properties/foo"); + "/properties/foo", false); // References @@ -251,68 +259,68 @@ TEST(JSONSchema_frame_2020_12, one_level_applicators_with_identifiers) { EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/test/qux", "https://www.sourcemeta.com/test/qux", "", - "https://www.sourcemeta.com/test/qux", "", std::nullopt); + "https://www.sourcemeta.com/test/qux", "", std::nullopt, false); EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/foo", "https://www.sourcemeta.com/test/qux", "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); // Anchors EXPECT_FRAME_STATIC_2020_12_ANCHOR( frame, "https://www.sourcemeta.com/test/qux#test", "https://www.sourcemeta.com/test/qux", "/properties/foo", - "https://www.sourcemeta.com/test/qux", "/properties/foo", ""); + "https://www.sourcemeta.com/test/qux", "/properties/foo", "", false); // JSON Pointers EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/test/qux#/$id", "https://www.sourcemeta.com/test/qux", "/$id", - "https://www.sourcemeta.com/test/qux", "/$id", ""); + "https://www.sourcemeta.com/test/qux", "/$id", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/test/qux#/$schema", "https://www.sourcemeta.com/test/qux", "/$schema", - "https://www.sourcemeta.com/test/qux", "/$schema", ""); + "https://www.sourcemeta.com/test/qux", "/$schema", "", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/test/qux#/items", "https://www.sourcemeta.com/test/qux", "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/test/qux#/items/$id", "https://www.sourcemeta.com/test/qux", "/items/$id", - "https://www.sourcemeta.com/foo", "/$id", "/items"); + "https://www.sourcemeta.com/foo", "/$id", "/items", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/test/qux#/items/type", "https://www.sourcemeta.com/test/qux", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/test/qux#/properties", "https://www.sourcemeta.com/test/qux", "/properties", - "https://www.sourcemeta.com/test/qux", "/properties", ""); + "https://www.sourcemeta.com/test/qux", "/properties", "", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/test/qux#/properties/foo", "https://www.sourcemeta.com/test/qux", "/properties/foo", - "https://www.sourcemeta.com/test/qux", "/properties/foo", ""); + "https://www.sourcemeta.com/test/qux", "/properties/foo", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/test/qux#/properties/foo/$anchor", "https://www.sourcemeta.com/test/qux", "/properties/foo/$anchor", "https://www.sourcemeta.com/test/qux", "/properties/foo/$anchor", - "/properties/foo"); + "/properties/foo", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/test/qux#/properties/foo/type", "https://www.sourcemeta.com/test/qux", "/properties/foo/type", "https://www.sourcemeta.com/test/qux", "/properties/foo/type", - "/properties/foo"); + "/properties/foo", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/foo#/$id", "https://www.sourcemeta.com/test/qux", "/items/$id", - "https://www.sourcemeta.com/foo", "/$id", "/items"); + "https://www.sourcemeta.com/foo", "/$id", "/items", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/foo#/type", "https://www.sourcemeta.com/test/qux", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); // References @@ -343,34 +351,34 @@ TEST(JSONSchema_frame_2020_12, subschema_absolute_identifier) { EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/foo", "https://www.sourcemeta.com/schema", "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); // JSON Pointers EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/items/$id", "https://www.sourcemeta.com/schema", "/items/$id", - "https://www.sourcemeta.com/foo", "/$id", "/items"); + "https://www.sourcemeta.com/foo", "/$id", "/items", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/items/type", "https://www.sourcemeta.com/schema", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); // References @@ -416,136 +424,136 @@ TEST(JSONSchema_frame_2020_12, nested_schemas) { EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/foo", "https://www.sourcemeta.com/schema", "/properties/foo", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); EXPECT_FRAME_STATIC_2020_12_ANCHOR( frame, "https://www.sourcemeta.com/foo#test", "https://www.sourcemeta.com/schema", "/properties/foo", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/bar", "https://www.sourcemeta.com/schema", "/properties/bar", - "https://www.sourcemeta.com/bar", "", ""); + "https://www.sourcemeta.com/bar", "", "", false); EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/baz", "https://www.sourcemeta.com/schema", "/properties/baz", - "https://www.sourcemeta.com/baz", "", ""); + "https://www.sourcemeta.com/baz", "", "", false); EXPECT_FRAME_STATIC_2020_12_ANCHOR( frame, "https://www.sourcemeta.com/baz#extra", "https://www.sourcemeta.com/schema", "/properties/baz/items", - "https://www.sourcemeta.com/baz", "/items", "/properties/baz"); + "https://www.sourcemeta.com/baz", "/items", "/properties/baz", false); EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/qux", "https://www.sourcemeta.com/schema", "/properties/foo/items", - "https://www.sourcemeta.com/qux", "", "/properties/foo"); + "https://www.sourcemeta.com/qux", "", "/properties/foo", false); // JSON Pointers EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", ""); + "https://www.sourcemeta.com/schema", "/properties", "", false); // foo EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/foo/$id", "https://www.sourcemeta.com/schema", "/properties/foo/$id", - "https://www.sourcemeta.com/foo", "/$id", "/properties/foo"); + "https://www.sourcemeta.com/foo", "/$id", "/properties/foo", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/foo/$anchor", "https://www.sourcemeta.com/schema", "/properties/foo/$anchor", - "https://www.sourcemeta.com/foo", "/$anchor", "/properties/foo"); + "https://www.sourcemeta.com/foo", "/$anchor", "/properties/foo", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo/items", "https://www.sourcemeta.com/schema", "/properties/foo/items", - "https://www.sourcemeta.com/qux", "", "/properties/foo"); + "https://www.sourcemeta.com/qux", "", "/properties/foo", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/foo/items/$id", "https://www.sourcemeta.com/schema", "/properties/foo/items/$id", - "https://www.sourcemeta.com/qux", "/$id", "/properties/foo/items"); + "https://www.sourcemeta.com/qux", "/$id", "/properties/foo/items", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/foo#/$id", "https://www.sourcemeta.com/schema", "/properties/foo/$id", - "https://www.sourcemeta.com/foo", "/$id", "/properties/foo"); + "https://www.sourcemeta.com/foo", "/$id", "/properties/foo", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/foo#/$anchor", "https://www.sourcemeta.com/schema", "/properties/foo/$anchor", - "https://www.sourcemeta.com/foo", "/$anchor", "/properties/foo"); + "https://www.sourcemeta.com/foo", "/$anchor", "/properties/foo", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/foo#/items", "https://www.sourcemeta.com/schema", "/properties/foo/items", - "https://www.sourcemeta.com/qux", "", "/properties/foo"); + "https://www.sourcemeta.com/qux", "", "/properties/foo", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/foo#/items/$id", "https://www.sourcemeta.com/schema", "/properties/foo/items/$id", - "https://www.sourcemeta.com/qux", "/$id", "/properties/foo/items"); + "https://www.sourcemeta.com/qux", "/$id", "/properties/foo/items", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/qux#/$id", "https://www.sourcemeta.com/schema", "/properties/foo/items/$id", - "https://www.sourcemeta.com/qux", "/$id", "/properties/foo/items"); + "https://www.sourcemeta.com/qux", "/$id", "/properties/foo/items", false); // bar EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/bar", "https://www.sourcemeta.com/schema", "/properties/bar", - "https://www.sourcemeta.com/bar", "", ""); + "https://www.sourcemeta.com/bar", "", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/bar/$id", "https://www.sourcemeta.com/schema", "/properties/bar/$id", - "https://www.sourcemeta.com/bar", "/$id", "/properties/bar"); + "https://www.sourcemeta.com/bar", "/$id", "/properties/bar", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/bar#/$id", "https://www.sourcemeta.com/schema", "/properties/bar/$id", - "https://www.sourcemeta.com/bar", "/$id", "/properties/bar"); + "https://www.sourcemeta.com/bar", "/$id", "/properties/bar", false); // baz EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/baz", "https://www.sourcemeta.com/schema", "/properties/baz", - "https://www.sourcemeta.com/baz", "", ""); + "https://www.sourcemeta.com/baz", "", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/baz/$id", "https://www.sourcemeta.com/schema", "/properties/baz/$id", - "https://www.sourcemeta.com/baz", "/$id", "/properties/baz"); + "https://www.sourcemeta.com/baz", "/$id", "/properties/baz", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/baz/items", "https://www.sourcemeta.com/schema", "/properties/baz/items", - "https://www.sourcemeta.com/baz", "/items", "/properties/baz"); + "https://www.sourcemeta.com/baz", "/items", "/properties/baz", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/baz/items/$anchor", "https://www.sourcemeta.com/schema", "/properties/baz/items/$anchor", "https://www.sourcemeta.com/baz", "/items/$anchor", - "/properties/baz/items"); + "/properties/baz/items", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/baz#/$id", "https://www.sourcemeta.com/schema", "/properties/baz/$id", - "https://www.sourcemeta.com/baz", "/$id", "/properties/baz"); + "https://www.sourcemeta.com/baz", "/$id", "/properties/baz", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/baz#/items", "https://www.sourcemeta.com/schema", "/properties/baz/items", - "https://www.sourcemeta.com/baz", "/items", "/properties/baz"); + "https://www.sourcemeta.com/baz", "/items", "/properties/baz", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/baz#/items/$anchor", "https://www.sourcemeta.com/schema", "/properties/baz/items/$anchor", "https://www.sourcemeta.com/baz", "/items/$anchor", - "/properties/baz/items"); + "/properties/baz/items", false); // References @@ -603,18 +611,18 @@ TEST(JSONSchema_frame_2020_12, explicit_argument_id_same) { EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); // References @@ -643,26 +651,26 @@ TEST(JSONSchema_frame_2020_12, anchor_top_level) { EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$anchor", "https://www.sourcemeta.com/schema", "/$anchor", - "https://www.sourcemeta.com/schema", "/$anchor", ""); + "https://www.sourcemeta.com/schema", "/$anchor", "", false); // Anchors EXPECT_FRAME_STATIC_2020_12_ANCHOR( frame, "https://www.sourcemeta.com/schema#foo", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // References @@ -705,105 +713,106 @@ TEST(JSONSchema_frame_2020_12, explicit_argument_id_different) { EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/test", "https://www.sourcemeta.com/schema", "/properties/one", - "https://www.sourcemeta.com/test", "", ""); + "https://www.sourcemeta.com/test", "", "", false); EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.example.com", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); - EXPECT_FRAME_STATIC_2020_12_RESOURCE(frame, "https://www.example.com/test", - "https://www.sourcemeta.com/schema", - "/properties/one", - "https://www.example.com/test", "", ""); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); + EXPECT_FRAME_STATIC_2020_12_RESOURCE( + frame, "https://www.example.com/test", + "https://www.sourcemeta.com/schema", "/properties/one", + "https://www.example.com/test", "", "", false); EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.test.com", "https://www.sourcemeta.com/schema", - "/properties/two", "https://www.test.com", "", ""); + "/properties/two", "https://www.test.com", "", "", false); // Anchors EXPECT_FRAME_STATIC_2020_12_ANCHOR( frame, "https://www.sourcemeta.com/schema#foo", "https://www.sourcemeta.com/schema", "/items", - "https://www.sourcemeta.com/schema", "/items", ""); + "https://www.sourcemeta.com/schema", "/items", "", false); EXPECT_FRAME_STATIC_2020_12_ANCHOR( frame, "https://www.example.com#foo", "https://www.sourcemeta.com/schema", - "/items", "https://www.example.com", "/items", ""); + "/items", "https://www.example.com", "/items", "", false); EXPECT_FRAME_STATIC_2020_12_ANCHOR( frame, "https://www.sourcemeta.com/test#bar", "https://www.sourcemeta.com/schema", "/properties/one", - "https://www.sourcemeta.com/test", "", ""); - EXPECT_FRAME_STATIC_2020_12_ANCHOR(frame, "https://www.example.com/test#bar", - "https://www.sourcemeta.com/schema", - "/properties/one", - "https://www.example.com/test", "", ""); + "https://www.sourcemeta.com/test", "", "", false); + EXPECT_FRAME_STATIC_2020_12_ANCHOR( + frame, "https://www.example.com/test#bar", + "https://www.sourcemeta.com/schema", "/properties/one", + "https://www.example.com/test", "", "", false); EXPECT_FRAME_STATIC_2020_12_ANCHOR( frame, "https://www.test.com#baz", "https://www.sourcemeta.com/schema", - "/properties/two", "https://www.test.com", "", ""); + "/properties/two", "https://www.test.com", "", "", false); // JSON Pointers EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", - "https://www.sourcemeta.com/schema", "/items", ""); + "https://www.sourcemeta.com/schema", "/items", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/items/$anchor", "https://www.sourcemeta.com/schema", "/items/$anchor", - "https://www.sourcemeta.com/schema", "/items/$anchor", "/items"); + "https://www.sourcemeta.com/schema", "/items/$anchor", "/items", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", ""); + "https://www.sourcemeta.com/schema", "/properties", "", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/one", "https://www.sourcemeta.com/schema", "/properties/one", - "https://www.sourcemeta.com/test", "", ""); + "https://www.sourcemeta.com/test", "", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/one/$id", "https://www.sourcemeta.com/schema", "/properties/one/$id", - "https://www.sourcemeta.com/test", "/$id", "/properties/one"); + "https://www.sourcemeta.com/test", "/$id", "/properties/one", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/one/$anchor", "https://www.sourcemeta.com/schema", "/properties/one/$anchor", - "https://www.sourcemeta.com/test", "/$anchor", "/properties/one"); + "https://www.sourcemeta.com/test", "/$anchor", "/properties/one", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/two", "https://www.sourcemeta.com/schema", "/properties/two", - "https://www.test.com", "", ""); + "https://www.test.com", "", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/two/$id", "https://www.sourcemeta.com/schema", "/properties/two/$id", - "https://www.test.com", "/$id", "/properties/two"); + "https://www.test.com", "/$id", "/properties/two", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/two/$anchor", "https://www.sourcemeta.com/schema", "/properties/two/$anchor", - "https://www.test.com", "/$anchor", "/properties/two"); + "https://www.test.com", "/$anchor", "/properties/two", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/test#/$id", "https://www.sourcemeta.com/schema", "/properties/one/$id", - "https://www.sourcemeta.com/test", "/$id", "/properties/one"); + "https://www.sourcemeta.com/test", "/$id", "/properties/one", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/test#/$anchor", "https://www.sourcemeta.com/schema", "/properties/one/$anchor", - "https://www.sourcemeta.com/test", "/$anchor", "/properties/one"); + "https://www.sourcemeta.com/test", "/$anchor", "/properties/one", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.test.com#/$id", "https://www.sourcemeta.com/schema", - "/properties/two/$id", "https://www.test.com", "/$id", "/properties/two"); + "/properties/two/$id", "https://www.test.com", "/$id", "/properties/two", + false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.test.com#/$anchor", "https://www.sourcemeta.com/schema", "/properties/two/$anchor", - "https://www.test.com", "/$anchor", "/properties/two"); + "https://www.test.com", "/$anchor", "/properties/two", false); // References @@ -1071,97 +1080,99 @@ TEST(JSONSchema_frame_2020_12, dynamic_anchor_with_id) { EXPECT_FRAME_DYNAMIC_2020_12_ANCHOR( frame, "https://www.sourcemeta.com/schema#foo", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_DYNAMIC_2020_12_ANCHOR( frame, "https://www.sourcemeta.com/schema#test", "https://www.sourcemeta.com/schema", "/properties/foo", - "https://www.sourcemeta.com/schema", "/properties/foo", ""); + "https://www.sourcemeta.com/schema", "/properties/foo", "", false); EXPECT_FRAME_DYNAMIC_2020_12_ANCHOR( frame, "https://www.sourcemeta.com/bar#test", "https://www.sourcemeta.com/schema", "/properties/bar", - "https://www.sourcemeta.com/bar", "", ""); + "https://www.sourcemeta.com/bar", "", "", false); // Static anchors EXPECT_FRAME_STATIC_2020_12_ANCHOR( frame, "https://www.sourcemeta.com/schema#foo", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_STATIC_2020_12_ANCHOR( frame, "https://www.sourcemeta.com/schema#test", "https://www.sourcemeta.com/schema", "/properties/foo", - "https://www.sourcemeta.com/schema", "/properties/foo", ""); + "https://www.sourcemeta.com/schema", "/properties/foo", "", false); EXPECT_FRAME_STATIC_2020_12_ANCHOR( frame, "https://www.sourcemeta.com/bar#test", "https://www.sourcemeta.com/schema", "/properties/bar", - "https://www.sourcemeta.com/bar", "", ""); + "https://www.sourcemeta.com/bar", "", "", false); // Static identifiers EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/bar", "https://www.sourcemeta.com/schema", "/properties/bar", - "https://www.sourcemeta.com/bar", "", ""); + "https://www.sourcemeta.com/bar", "", "", false); // Static pointers EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$dynamicAnchor", "https://www.sourcemeta.com/schema", "/$dynamicAnchor", - "https://www.sourcemeta.com/schema", "/$dynamicAnchor", ""); + "https://www.sourcemeta.com/schema", "/$dynamicAnchor", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", ""); + "https://www.sourcemeta.com/schema", "/properties", "", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", - "https://www.sourcemeta.com/schema", "/properties/foo", ""); + "https://www.sourcemeta.com/schema", "/properties/foo", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/foo/$dynamicAnchor", "https://www.sourcemeta.com/schema", "/properties/foo/$dynamicAnchor", "https://www.sourcemeta.com/schema", "/properties/foo/$dynamicAnchor", - "/properties/foo"); + "/properties/foo", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/bar", "https://www.sourcemeta.com/schema", "/properties/bar", - "https://www.sourcemeta.com/bar", "", ""); + "https://www.sourcemeta.com/bar", "", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/bar/$id", "https://www.sourcemeta.com/schema", "/properties/bar/$id", - "https://www.sourcemeta.com/bar", "/$id", "/properties/bar"); + "https://www.sourcemeta.com/bar", "/$id", "/properties/bar", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/bar/$dynamicAnchor", "https://www.sourcemeta.com/schema", "/properties/bar/$dynamicAnchor", - "https://www.sourcemeta.com/bar", "/$dynamicAnchor", "/properties/bar"); + "https://www.sourcemeta.com/bar", "/$dynamicAnchor", "/properties/bar", + false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/bar/$anchor", "https://www.sourcemeta.com/schema", "/properties/bar/$anchor", - "https://www.sourcemeta.com/bar", "/$anchor", "/properties/bar"); + "https://www.sourcemeta.com/bar", "/$anchor", "/properties/bar", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/bar#/$id", "https://www.sourcemeta.com/schema", "/properties/bar/$id", - "https://www.sourcemeta.com/bar", "/$id", "/properties/bar"); + "https://www.sourcemeta.com/bar", "/$id", "/properties/bar", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/bar#/$dynamicAnchor", "https://www.sourcemeta.com/schema", "/properties/bar/$dynamicAnchor", - "https://www.sourcemeta.com/bar", "/$dynamicAnchor", "/properties/bar"); + "https://www.sourcemeta.com/bar", "/$dynamicAnchor", "/properties/bar", + false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/bar#/$anchor", "https://www.sourcemeta.com/schema", "/properties/bar/$anchor", - "https://www.sourcemeta.com/bar", "/$anchor", "/properties/bar"); + "https://www.sourcemeta.com/bar", "/$anchor", "/properties/bar", false); // References @@ -1194,30 +1205,35 @@ TEST(JSONSchema_frame_2020_12, dynamic_anchor_without_id) { EXPECT_ANONYMOUS_FRAME_DYNAMIC_ANCHOR( frame, "#test", "/properties/foo", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_ANCHOR( frame, "#test", "/properties/foo", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); // Static frames EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, std::nullopt); + JSON_Schema_2020_12, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties", "/properties", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/properties/foo", "/properties/foo", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/$dynamicAnchor", "/properties/foo/$dynamicAnchor", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/properties/foo"); + "/properties/foo", false); // References @@ -1252,32 +1268,38 @@ TEST(JSONSchema_frame_2020_12, EXPECT_ANONYMOUS_FRAME_DYNAMIC_ANCHOR( frame, "#test", "/$defs/test", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_ANCHOR( frame, "#test", "/$defs/test", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); // Static frames EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, std::nullopt); + JSON_Schema_2020_12, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$dynamicRef", "/$dynamicRef", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$defs", "/$defs", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/$defs/test", "/$defs/test", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$defs/test/$dynamicAnchor", "/$defs/test/$dynamicAnchor", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/$defs/test"); + "/$defs/test", false); // References @@ -1315,39 +1337,46 @@ TEST(JSONSchema_frame_2020_12, dynamic_ref_to_single_dynamic_anchor_external) { EXPECT_ANONYMOUS_FRAME_DYNAMIC_ANCHOR( frame, "#test", "/$defs/test", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_ANCHOR( frame, "#test", "/$defs/test", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); // Static frames EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, std::nullopt); + JSON_Schema_2020_12, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$dynamicRef", "/$dynamicRef", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$defs", "/$defs", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/$defs/test", "/$defs/test", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$defs/test/$dynamicAnchor", "/$defs/test/$dynamicAnchor", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/$defs/test"); + "/$defs/test", false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/$defs/foo", "/$defs/foo", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$defs/foo/$ref", "/$defs/foo/$ref", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/$defs/foo"); + "/$defs/foo", false); // References @@ -1399,20 +1428,23 @@ TEST(JSONSchema_frame_2020_12, no_id_recursive_empty_pointer) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, std::nullopt); + JSON_Schema_2020_12, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties", "/properties", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/properties/foo", "/properties/foo", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/$ref", "/properties/foo/$ref", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/properties/foo"); + "/properties/foo", false); // References @@ -1441,13 +1473,14 @@ TEST(JSONSchema_frame_2020_12, ref_metaschema) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, std::nullopt); + JSON_Schema_2020_12, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, ""); + JSON_Schema_2020_12, "", false); // References @@ -1504,35 +1537,35 @@ TEST(JSONSchema_frame_2020_12, ref_with_id) { EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$ref", "https://www.sourcemeta.com/schema", "/$ref", - "https://www.sourcemeta.com/schema", "/$ref", ""); + "https://www.sourcemeta.com/schema", "/$ref", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$defs", "https://www.sourcemeta.com/schema", "/$defs", - "https://www.sourcemeta.com/schema", "/$defs", ""); + "https://www.sourcemeta.com/schema", "/$defs", "", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/$defs/string", "https://www.sourcemeta.com/schema", "/$defs/string", - "https://www.sourcemeta.com/schema", "/$defs/string", ""); + "https://www.sourcemeta.com/schema", "/$defs/string", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$defs/string/type", "https://www.sourcemeta.com/schema", "/$defs/string/type", "https://www.sourcemeta.com/schema", "/$defs/string/type", - "/$defs/string"); + "/$defs/string", false); // References @@ -1568,44 +1601,44 @@ TEST(JSONSchema_frame_2020_12, ref_from_definitions) { EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$ref", "https://www.sourcemeta.com/schema", "/$ref", - "https://www.sourcemeta.com/schema", "/$ref", ""); + "https://www.sourcemeta.com/schema", "/$ref", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/definitions", "https://www.sourcemeta.com/schema", "/definitions", - "https://www.sourcemeta.com/schema", "/definitions", ""); + "https://www.sourcemeta.com/schema", "/definitions", "", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/definitions/middle", "https://www.sourcemeta.com/schema", "/definitions/middle", - "https://www.sourcemeta.com/schema", "/definitions/middle", ""); + "https://www.sourcemeta.com/schema", "/definitions/middle", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/definitions/middle/$ref", "https://www.sourcemeta.com/schema", "/definitions/middle/$ref", "https://www.sourcemeta.com/schema", "/definitions/middle/$ref", - "/definitions/middle"); + "/definitions/middle", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/definitions/string", "https://www.sourcemeta.com/schema", "/definitions/string", - "https://www.sourcemeta.com/schema", "/definitions/string", ""); + "https://www.sourcemeta.com/schema", "/definitions/string", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/definitions/string/type", "https://www.sourcemeta.com/schema", "/definitions/string/type", "https://www.sourcemeta.com/schema", "/definitions/string/type", - "/definitions/string"); + "/definitions/string", false); // References @@ -1640,14 +1673,15 @@ TEST(JSONSchema_frame_2020_12, relative_base_uri_without_ref) { EXPECT_EQ(frame.locations().size(), 3); EXPECT_FRAME_STATIC_2020_12_RESOURCE(frame, "common", "common", "", "common", - "", std::nullopt); + "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_2020_12_POINTER(frame, "common#/$schema", "common", - "/$schema", "common", "/$schema", ""); + "/$schema", "common", "/$schema", "", + false); EXPECT_FRAME_STATIC_2020_12_POINTER(frame, "common#/$id", "common", "/$id", - "common", "/$id", ""); + "common", "/$id", "", false); // References @@ -1679,33 +1713,36 @@ TEST(JSONSchema_frame_2020_12, relative_base_uri_with_ref) { EXPECT_EQ(frame.locations().size(), 10); EXPECT_FRAME_STATIC_2020_12_RESOURCE(frame, "common", "common", "", "common", - "", std::nullopt); + "", std::nullopt, false); // Anchors EXPECT_FRAME_STATIC_2020_12_ANCHOR(frame, "common#foo", "common", - "/$defs/foo", "common", "/$defs/foo", ""); + "/$defs/foo", "common", "/$defs/foo", "", + false); // JSON Pointers EXPECT_FRAME_STATIC_2020_12_POINTER(frame, "common#/$schema", "common", - "/$schema", "common", "/$schema", ""); + "/$schema", "common", "/$schema", "", + false); EXPECT_FRAME_STATIC_2020_12_POINTER(frame, "common#/$id", "common", "/$id", - "common", "/$id", ""); + "common", "/$id", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER(frame, "common#/allOf", "common", - "/allOf", "common", "/allOf", ""); + "/allOf", "common", "/allOf", "", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA(frame, "common#/allOf/0", "common", - "/allOf/0", "common", "/allOf/0", ""); + "/allOf/0", "common", "/allOf/0", "", + false); EXPECT_FRAME_STATIC_2020_12_POINTER(frame, "common#/allOf/0/$ref", "common", "/allOf/0/$ref", "common", - "/allOf/0/$ref", "/allOf/0"); + "/allOf/0/$ref", "/allOf/0", false); EXPECT_FRAME_STATIC_2020_12_POINTER(frame, "common#/$defs", "common", - "/$defs", "common", "/$defs", ""); + "/$defs", "common", "/$defs", "", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA(frame, "common#/$defs/foo", "common", "/$defs/foo", "common", "/$defs/foo", - ""); - EXPECT_FRAME_STATIC_2020_12_POINTER(frame, "common#/$defs/foo/$anchor", - "common", "/$defs/foo/$anchor", "common", - "/$defs/foo/$anchor", "/$defs/foo"); + "", false); + EXPECT_FRAME_STATIC_2020_12_POINTER( + frame, "common#/$defs/foo/$anchor", "common", "/$defs/foo/$anchor", + "common", "/$defs/foo/$anchor", "/$defs/foo", false); // References @@ -1734,17 +1771,18 @@ TEST(JSONSchema_frame_2020_12, relative_base_with_relative_path_ref) { EXPECT_EQ(frame.locations().size(), 4); EXPECT_FRAME_STATIC_2020_12_RESOURCE(frame, "foo/bar/baz", "foo/bar/baz", "", - "foo/bar/baz", "", std::nullopt); + "foo/bar/baz", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_2020_12_POINTER(frame, "foo/bar/baz#/$schema", "foo/bar/baz", "/$schema", "foo/bar/baz", - "/$schema", ""); + "/$schema", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER(frame, "foo/bar/baz#/$id", "foo/bar/baz", - "/$id", "foo/bar/baz", "/$id", ""); + "/$id", "foo/bar/baz", "/$id", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER(frame, "foo/bar/baz#/$ref", "foo/bar/baz", - "/$ref", "foo/bar/baz", "/$ref", ""); + "/$ref", "foo/bar/baz", "/$ref", "", + false); // References @@ -1783,30 +1821,30 @@ TEST(JSONSchema_frame_2020_12, idempotent_with_refs) { EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$ref", "https://www.sourcemeta.com/schema", "/$ref", - "https://www.sourcemeta.com/schema", "/$ref", ""); + "https://www.sourcemeta.com/schema", "/$ref", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$defs", "https://www.sourcemeta.com/schema", "/$defs", - "https://www.sourcemeta.com/schema", "/$defs", ""); + "https://www.sourcemeta.com/schema", "/$defs", "", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/$defs/string", "https://www.sourcemeta.com/schema", "/$defs/string", - "https://www.sourcemeta.com/schema", "/$defs/string", ""); + "https://www.sourcemeta.com/schema", "/$defs/string", "", false); // References @@ -1881,57 +1919,57 @@ TEST(JSONSchema_frame_2020_12, properties_with_refs) { EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", ""); + "https://www.sourcemeta.com/schema", "/properties", "", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", - "https://www.sourcemeta.com/schema", "/properties/foo", ""); + "https://www.sourcemeta.com/schema", "/properties/foo", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/foo/type", "https://www.sourcemeta.com/schema", "/properties/foo/type", "https://www.sourcemeta.com/schema", "/properties/foo/type", - "/properties/foo"); + "/properties/foo", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/bar", "https://www.sourcemeta.com/schema", "/properties/bar", - "https://www.sourcemeta.com/schema", "/properties/bar", ""); + "https://www.sourcemeta.com/schema", "/properties/bar", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/bar/$ref", "https://www.sourcemeta.com/schema", "/properties/bar/$ref", "https://www.sourcemeta.com/schema", "/properties/bar/$ref", - "/properties/bar"); + "/properties/bar", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/baz", "https://www.sourcemeta.com/schema", "/properties/baz", - "https://www.sourcemeta.com/schema", "/properties/baz", ""); + "https://www.sourcemeta.com/schema", "/properties/baz", "", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/baz/items", "https://www.sourcemeta.com/schema", "/properties/baz/items", "https://www.sourcemeta.com/schema", "/properties/baz/items", - "/properties/baz"); + "/properties/baz", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/baz/items/$ref", "https://www.sourcemeta.com/schema", "/properties/baz/items/$ref", "https://www.sourcemeta.com/schema", "/properties/baz/items/$ref", - "/properties/baz/items"); + "/properties/baz/items", false); // References @@ -1984,55 +2022,55 @@ TEST(JSONSchema_frame_2020_12, property_ref_defs) { EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", ""); + "https://www.sourcemeta.com/schema", "/properties", "", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", - "https://www.sourcemeta.com/schema", "/properties/foo", ""); + "https://www.sourcemeta.com/schema", "/properties/foo", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/foo/$ref", "https://www.sourcemeta.com/schema", "/properties/foo/$ref", "https://www.sourcemeta.com/schema", "/properties/foo/$ref", - "/properties/foo"); + "/properties/foo", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/bar", "https://www.sourcemeta.com/schema", "/properties/bar", - "https://www.sourcemeta.com/schema", "/properties/bar", ""); + "https://www.sourcemeta.com/schema", "/properties/bar", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/bar/$ref", "https://www.sourcemeta.com/schema", "/properties/bar/$ref", "https://www.sourcemeta.com/schema", "/properties/bar/$ref", - "/properties/bar"); + "/properties/bar", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$defs", "https://www.sourcemeta.com/schema", "/$defs", - "https://www.sourcemeta.com/schema", "/$defs", ""); + "https://www.sourcemeta.com/schema", "/$defs", "", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/$defs/helper", "https://www.sourcemeta.com/schema", "/$defs/helper", - "https://www.sourcemeta.com/schema", "/$defs/helper", ""); + "https://www.sourcemeta.com/schema", "/$defs/helper", "", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/$defs/helper/items", "https://www.sourcemeta.com/schema", "/$defs/helper/items", "https://www.sourcemeta.com/schema", "/$defs/helper/items", - "/$defs/helper"); + "/$defs/helper", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/$defs/helper/items/" @@ -2040,7 +2078,7 @@ TEST(JSONSchema_frame_2020_12, property_ref_defs) { "https://www.sourcemeta.com/schema", "/$defs/helper/items/additionalProperties", "https://www.sourcemeta.com/schema", - "/$defs/helper/items/additionalProperties", "/$defs/helper/items"); + "/$defs/helper/items/additionalProperties", "/$defs/helper/items", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$defs/helper/items/" @@ -2049,7 +2087,7 @@ TEST(JSONSchema_frame_2020_12, property_ref_defs) { "/$defs/helper/items/additionalProperties/type", "https://www.sourcemeta.com/schema", "/$defs/helper/items/additionalProperties/type", - "/$defs/helper/items/additionalProperties"); + "/$defs/helper/items/additionalProperties", false); // References @@ -2097,46 +2135,46 @@ TEST(JSONSchema_frame_2020_12, property_cross_ref) { EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", ""); + "https://www.sourcemeta.com/schema", "/properties", "", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", - "https://www.sourcemeta.com/schema", "/properties/foo", ""); + "https://www.sourcemeta.com/schema", "/properties/foo", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/foo/$ref", "https://www.sourcemeta.com/schema", "/properties/foo/$ref", "https://www.sourcemeta.com/schema", "/properties/foo/$ref", - "/properties/foo"); + "/properties/foo", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/bar", "https://www.sourcemeta.com/schema", "/properties/bar", - "https://www.sourcemeta.com/schema", "/properties/bar", ""); + "https://www.sourcemeta.com/schema", "/properties/bar", "", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/bar/items", "https://www.sourcemeta.com/schema", "/properties/bar/items", "https://www.sourcemeta.com/schema", "/properties/bar/items", - "/properties/bar"); + "/properties/bar", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/bar/items/$anchor", "https://www.sourcemeta.com/schema", "/properties/bar/items/$anchor", "https://www.sourcemeta.com/schema", "/properties/bar/items/$anchor", - "/properties/bar/items"); + "/properties/bar/items", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/bar/items/" @@ -2144,13 +2182,14 @@ TEST(JSONSchema_frame_2020_12, property_cross_ref) { "https://www.sourcemeta.com/schema", "/properties/bar/items/additionalProperties", "https://www.sourcemeta.com/schema", - "/properties/bar/items/additionalProperties", "/properties/bar/items"); + "/properties/bar/items/additionalProperties", "/properties/bar/items", + false); EXPECT_FRAME_STATIC_2020_12_ANCHOR( frame, "https://www.sourcemeta.com/schema#foo", "https://www.sourcemeta.com/schema", "/properties/bar/items", "https://www.sourcemeta.com/schema", "/properties/bar/items", - "/properties/bar"); + "/properties/bar", false); // References @@ -2191,59 +2230,61 @@ TEST(JSONSchema_frame_2020_12, dynamic_ref_multiple_targets) { EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.example.com", "https://www.example.com", "", - "https://www.example.com", "", std::nullopt); + "https://www.example.com", "", std::nullopt, false); EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.example.com/foo", "https://www.example.com", - "/properties/foo", "https://www.example.com/foo", "", ""); + "/properties/foo", "https://www.example.com/foo", "", "", false); // Subschemas EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.example.com#/properties/foo", "https://www.example.com", "/properties/foo", - "https://www.example.com/foo", "", ""); + "https://www.example.com/foo", "", "", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.example.com#/properties/bar", "https://www.example.com", "/properties/bar", "https://www.example.com", - "/properties/bar", ""); + "/properties/bar", "", false); // JSON Pointers - EXPECT_FRAME_STATIC_2020_12_POINTER(frame, "https://www.example.com#/$id", - "https://www.example.com", "/$id", - "https://www.example.com", "/$id", ""); + EXPECT_FRAME_STATIC_2020_12_POINTER( + frame, "https://www.example.com#/$id", "https://www.example.com", "/$id", + "https://www.example.com", "/$id", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.example.com#/$schema", "https://www.example.com", - "/$schema", "https://www.example.com", "/$schema", ""); + "/$schema", "https://www.example.com", "/$schema", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.example.com#/$dynamicAnchor", "https://www.example.com", "/$dynamicAnchor", "https://www.example.com", - "/$dynamicAnchor", ""); + "/$dynamicAnchor", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.example.com#/properties", "https://www.example.com", - "/properties", "https://www.example.com", "/properties", ""); + "/properties", "https://www.example.com", "/properties", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.example.com#/properties/foo/$id", "https://www.example.com", "/properties/foo/$id", - "https://www.example.com/foo", "/$id", "/properties/foo"); + "https://www.example.com/foo", "/$id", "/properties/foo", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.example.com#/properties/foo/$dynamicAnchor", "https://www.example.com", "/properties/foo/$dynamicAnchor", - "https://www.example.com/foo", "/$dynamicAnchor", "/properties/foo"); + "https://www.example.com/foo", "/$dynamicAnchor", "/properties/foo", + false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.example.com#/properties/bar/$dynamicRef", "https://www.example.com", "/properties/bar/$dynamicRef", "https://www.example.com", "/properties/bar/$dynamicRef", - "/properties/bar"); + "/properties/bar", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.example.com/foo#/$id", "https://www.example.com", "/properties/foo/$id", "https://www.example.com/foo", "/$id", - "/properties/foo"); + "/properties/foo", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.example.com/foo#/$dynamicAnchor", "https://www.example.com", "/properties/foo/$dynamicAnchor", - "https://www.example.com/foo", "/$dynamicAnchor", "/properties/foo"); + "https://www.example.com/foo", "/$dynamicAnchor", "/properties/foo", + false); // Anchors @@ -2253,17 +2294,17 @@ TEST(JSONSchema_frame_2020_12, dynamic_ref_multiple_targets) { // from static anchors EXPECT_FRAME_STATIC_2020_12_ANCHOR( frame, "https://www.example.com#test", "https://www.example.com", "", - "https://www.example.com", "", std::nullopt); + "https://www.example.com", "", std::nullopt, false); EXPECT_FRAME_STATIC_2020_12_ANCHOR( frame, "https://www.example.com/foo#test", "https://www.example.com", - "/properties/foo", "https://www.example.com/foo", "", ""); + "/properties/foo", "https://www.example.com/foo", "", "", false); EXPECT_FRAME_DYNAMIC_2020_12_ANCHOR( frame, "https://www.example.com#test", "https://www.example.com", "", - "https://www.example.com", "", std::nullopt); + "https://www.example.com", "", std::nullopt, false); EXPECT_FRAME_DYNAMIC_2020_12_ANCHOR( frame, "https://www.example.com/foo#test", "https://www.example.com", - "/properties/foo", "https://www.example.com/foo", "", ""); + "/properties/foo", "https://www.example.com/foo", "", "", false); // References @@ -2300,55 +2341,59 @@ TEST(JSONSchema_frame_2020_12, cross_id_anonymous_nested) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, std::nullopt); + JSON_Schema_2020_12, std::nullopt, false); // JSON Pointers EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, ""); + JSON_Schema_2020_12, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$defs", "/$defs", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); // From the top EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/$defs/schema", "/$defs/schema", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$defs/schema/$schema", "/$defs/schema/$schema", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/$defs/schema"); + "/$defs/schema", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$defs/schema/$id", "/$defs/schema/$id", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/$defs/schema"); + "/$defs/schema", false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/$defs/schema/items", "/$defs/schema/items", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/$defs/schema"); + "/$defs/schema", false); // From within EXPECT_ANONYMOUS_FRAME_STATIC_RESOURCE( frame, "https://example.com", "/$defs/schema", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/$schema", "/$defs/schema/$schema", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/$defs/schema"); + "/$defs/schema", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/$id", "/$defs/schema/$id", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/$defs/schema"); + "/$defs/schema", false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "https://example.com#/items", "/$defs/schema/items", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/$defs/schema"); + "/$defs/schema", false); // References @@ -2384,22 +2429,23 @@ TEST(JSONSchema_frame_2020_12, relative_id_with_absolute_default_id) { // With current identifier EXPECT_FRAME_STATIC_2020_12_RESOURCE(frame, "relative", "relative", "", - "relative", "", std::nullopt); + "relative", "", std::nullopt, false); EXPECT_FRAME_STATIC_2020_12_POINTER(frame, "relative#/$id", "relative", - "/$id", "relative", "/$id", ""); + "/$id", "relative", "/$id", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER(frame, "relative#/$schema", "relative", - "/$schema", "relative", "/$schema", ""); + "/$schema", "relative", "/$schema", "", + false); // With default identifier EXPECT_FRAME_STATIC_2020_12_RESOURCE(frame, "https://example.com/relative", "relative", "", "relative", "", - std::nullopt); + std::nullopt, false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://example.com/relative#/$id", "relative", "/$id", - "relative", "/$id", ""); + "relative", "/$id", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://example.com/relative#/$schema", "relative", "/$schema", - "relative", "/$schema", ""); + "relative", "/$schema", "", false); // References @@ -2448,36 +2494,36 @@ TEST(JSONSchema_frame_2020_12, single_nested_path_recursive_with_identifier) { EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/schema", "", "/wrapper", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "", "/wrapper/$id", - "https://www.sourcemeta.com/schema", "/$id", "/wrapper"); + "https://www.sourcemeta.com/schema", "/$id", "/wrapper", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "", "/wrapper/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "/wrapper"); + "/wrapper", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$ref", "", "/wrapper/$ref", - "https://www.sourcemeta.com/schema", "/$ref", "/wrapper"); + "https://www.sourcemeta.com/schema", "/$ref", "/wrapper", false); // From the root EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/wrapper", "/wrapper", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - std::nullopt); + std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/wrapper/$id", "/wrapper/$id", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/wrapper"); + "/wrapper", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/wrapper/$schema", "/wrapper/$schema", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/wrapper"); + "/wrapper", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/wrapper/$ref", "/wrapper/$ref", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/wrapper"); + "/wrapper", false); // References @@ -2515,11 +2561,11 @@ TEST(JSONSchema_frame_2020_12, EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/wrapper", "/wrapper", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - std::nullopt); + std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/wrapper/$ref", "/wrapper/$ref", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/wrapper"); + "/wrapper", false); // References @@ -2554,45 +2600,45 @@ TEST(JSONSchema_frame_2020_12, single_nested_anonymous_with_nested_resource) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/wrapper", "/wrapper", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - std::nullopt); + std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/wrapper/items", "/wrapper/items", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/wrapper"); + "/wrapper", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/wrapper/items/$id", "/wrapper/items/$id", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/wrapper/items"); + "/wrapper/items", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/wrapper/items/$schema", "/wrapper/items/$schema", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/wrapper/items"); + "/wrapper/items", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/wrapper/items/$anchor", "/wrapper/items/$anchor", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/wrapper/items"); + "/wrapper/items", false); EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/schema", "", "/wrapper/items", - "https://www.sourcemeta.com/schema", "", "/wrapper"); + "https://www.sourcemeta.com/schema", "", "/wrapper", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "", "/wrapper/items/$id", - "https://www.sourcemeta.com/schema", "/$id", "/wrapper/items"); + "https://www.sourcemeta.com/schema", "/$id", "/wrapper/items", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "", "/wrapper/items/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "/wrapper/items"); + "/wrapper/items", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$anchor", "", "/wrapper/items/$anchor", "https://www.sourcemeta.com/schema", "/$anchor", - "/wrapper/items"); + "/wrapper/items", false); // Anchors EXPECT_FRAME_STATIC_2020_12_ANCHOR( frame, "https://www.sourcemeta.com/schema#test", "", "/wrapper/items", - "https://www.sourcemeta.com/schema", "", "/wrapper"); + "https://www.sourcemeta.com/schema", "", "/wrapper", false); // References @@ -2641,75 +2687,75 @@ TEST(JSONSchema_frame_2020_12, multiple_nested_cross_ref) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/wrapper", "/wrapper", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - std::nullopt); + std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/wrapper/$ref", "/wrapper/$ref", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/wrapper"); + "/wrapper", false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/common/test", "/common/test", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - std::nullopt); + std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/common/test/$anchor", "/common/test/$anchor", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/common/test"); + "/common/test", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/common/test/$ref", "/common/test/$ref", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/common/test"); + "/common/test", false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/common/with-id", "/common/with-id", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - std::nullopt); + std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/common/with-id/$id", "/common/with-id/$id", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/common/with-id"); + "/common/with-id", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/common/with-id/$schema", "/common/with-id/$schema", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/common/with-id"); + "/common/with-id", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/common/with-id/$anchor", "/common/with-id/$anchor", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/common/with-id"); + "/common/with-id", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/common/with-id/type", "/common/with-id/type", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/common/with-id"); + "/common/with-id", false); EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/schema", "", "/common/with-id", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "", "/common/with-id/$id", "https://www.sourcemeta.com/schema", "/$id", - "/common/with-id"); + "/common/with-id", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "", "/common/with-id/$schema", "https://www.sourcemeta.com/schema", - "/$schema", "/common/with-id"); + "/$schema", "/common/with-id", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$anchor", "", "/common/with-id/$anchor", "https://www.sourcemeta.com/schema", - "/$anchor", "/common/with-id"); + "/$anchor", "/common/with-id", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/type", "", "/common/with-id/type", "https://www.sourcemeta.com/schema", "/type", - "/common/with-id"); + "/common/with-id", false); // Anchors EXPECT_ANONYMOUS_FRAME_STATIC_ANCHOR( frame, "#foo", "/common/test", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - std::nullopt); + std::nullopt, false); EXPECT_FRAME_STATIC_2020_12_ANCHOR( frame, "https://www.sourcemeta.com/schema#bar", "", "/common/with-id", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // References @@ -2758,20 +2804,20 @@ TEST(JSONSchema_frame_2020_12, multiple_nested_cross_ref_missing_target) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/wrapper", "/wrapper", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - std::nullopt); + std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/wrapper/$ref", "/wrapper/$ref", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/wrapper"); + "/wrapper", false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/common/test", "/common/test", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - std::nullopt); + std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/common/test/$ref", "/common/test/$ref", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/common/test"); + "/common/test", false); // References @@ -2900,20 +2946,20 @@ TEST(JSONSchema_frame_2020_12, multiple_nested_with_default_id) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/wrapper", "/wrapper", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - std::nullopt); + std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/wrapper/$ref", "/wrapper/$ref", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/wrapper"); + "/wrapper", false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/common/test", "/common/test", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - std::nullopt); + std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/common/test/$ref", "/common/test/$ref", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/common/test"); + "/common/test", false); // References @@ -2939,13 +2985,15 @@ TEST(JSONSchema_frame_2020_12, anchor_with_invalid_type) { EXPECT_EQ(frame.locations().size(), 3); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, std::nullopt); + JSON_Schema_2020_12, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$anchor", "/$anchor", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_EQ(frame.references().size(), 1); EXPECT_STATIC_REFERENCE( @@ -2968,13 +3016,15 @@ TEST(JSONSchema_frame_2020_12, dynamic_anchor_with_invalid_type) { EXPECT_EQ(frame.locations().size(), 3); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, std::nullopt); + JSON_Schema_2020_12, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$dynamicAnchor", "/$dynamicAnchor", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_EQ(frame.references().size(), 1); EXPECT_STATIC_REFERENCE( @@ -2997,13 +3047,15 @@ TEST(JSONSchema_frame_2020_12, dynamic_ref_with_invalid_type) { EXPECT_EQ(frame.locations().size(), 3); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, std::nullopt); + JSON_Schema_2020_12, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$dynamicRef", "/$dynamicRef", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_EQ(frame.references().size(), 1); EXPECT_STATIC_REFERENCE( @@ -3040,44 +3092,47 @@ TEST(JSONSchema_frame_2020_12, EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, std::nullopt); + JSON_Schema_2020_12, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties", "/properties", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/properties/foo", "/properties/foo", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/$ref", "/properties/foo/$ref", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/properties/foo"); + "/properties/foo", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/properties", "/properties/foo/properties", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/properties/foo"); + "/properties/foo", false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/properties/foo/properties/bar", "/properties/foo/properties/bar", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/properties/foo"); + "/properties/foo", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/properties/bar/$ref", "/properties/foo/properties/bar/$ref", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/properties/foo/properties/bar"); + "/properties/foo/properties/bar", false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/properties/foo/properties/bar/additionalProperties", "/properties/foo/properties/bar/additionalProperties", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/properties/foo/properties/bar"); + "/properties/foo/properties/bar", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/properties/bar/additionalProperties/$ref", "/properties/foo/properties/bar/additionalProperties/$ref", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/properties/foo/properties/bar/additionalProperties"); + "/properties/foo/properties/bar/additionalProperties", false); EXPECT_EQ(frame.references().size(), 4); @@ -3122,41 +3177,42 @@ TEST(JSONSchema_frame_2020_12, ref_to_ref_chain) { EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$ref", "https://www.sourcemeta.com/schema", "/$ref", - "https://www.sourcemeta.com/schema", "/$ref", ""); + "https://www.sourcemeta.com/schema", "/$ref", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$defs", "https://www.sourcemeta.com/schema", "/$defs", - "https://www.sourcemeta.com/schema", "/$defs", ""); + "https://www.sourcemeta.com/schema", "/$defs", "", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/$defs/parent", "https://www.sourcemeta.com/schema", "/$defs/parent", - "https://www.sourcemeta.com/schema", "/$defs/parent", ""); + "https://www.sourcemeta.com/schema", "/$defs/parent", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$defs/parent/$ref", "https://www.sourcemeta.com/schema", "/$defs/parent/$ref", "https://www.sourcemeta.com/schema", "/$defs/parent/$ref", - "/$defs/parent"); + "/$defs/parent", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/$defs/child", "https://www.sourcemeta.com/schema", "/$defs/child", - "https://www.sourcemeta.com/schema", "/$defs/child", ""); + "https://www.sourcemeta.com/schema", "/$defs/child", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$defs/child/type", "https://www.sourcemeta.com/schema", "/$defs/child/type", - "https://www.sourcemeta.com/schema", "/$defs/child/type", "/$defs/child"); + "https://www.sourcemeta.com/schema", "/$defs/child/type", "/$defs/child", + false); EXPECT_EQ(frame.references().size(), 3); @@ -3197,46 +3253,46 @@ TEST(JSONSchema_frame_2020_12, nested_defs_unreferenced) { EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", ""); + "https://www.sourcemeta.com/schema", "/properties", "", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", - "https://www.sourcemeta.com/schema", "/properties/foo", ""); + "https://www.sourcemeta.com/schema", "/properties/foo", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/foo/$defs", "https://www.sourcemeta.com/schema", "/properties/foo/$defs", "https://www.sourcemeta.com/schema", "/properties/foo/$defs", - "/properties/foo"); + "/properties/foo", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo/$defs/unused", "https://www.sourcemeta.com/schema", "/properties/foo/$defs/unused", "https://www.sourcemeta.com/schema", "/properties/foo/$defs/unused", - "/properties/foo"); + "/properties/foo", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/foo/$defs/unused/type", "https://www.sourcemeta.com/schema", "/properties/foo/$defs/unused/type", "https://www.sourcemeta.com/schema", "/properties/foo/$defs/unused/type", - "/properties/foo/$defs/unused"); + "/properties/foo/$defs/unused", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/foo/type", "https://www.sourcemeta.com/schema", "/properties/foo/type", "https://www.sourcemeta.com/schema", "/properties/foo/type", - "/properties/foo"); + "/properties/foo", false); EXPECT_EQ(frame.references().size(), 1); @@ -3267,42 +3323,42 @@ TEST(JSONSchema_frame_2020_12, circular_ref_through_defs) { EXPECT_FRAME_STATIC_2020_12_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/$defs/a", "https://www.sourcemeta.com/schema", "/$defs/a", - "https://www.sourcemeta.com/schema", "/$defs/a", ""); + "https://www.sourcemeta.com/schema", "/$defs/a", "", false); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/$defs/b", "https://www.sourcemeta.com/schema", "/$defs/b", - "https://www.sourcemeta.com/schema", "/$defs/b", ""); + "https://www.sourcemeta.com/schema", "/$defs/b", "", false); // JSON Pointers EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$defs", "https://www.sourcemeta.com/schema", "/$defs", - "https://www.sourcemeta.com/schema", "/$defs", ""); + "https://www.sourcemeta.com/schema", "/$defs", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$ref", "https://www.sourcemeta.com/schema", "/$ref", - "https://www.sourcemeta.com/schema", "/$ref", ""); + "https://www.sourcemeta.com/schema", "/$ref", "", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$defs/a/$ref", "https://www.sourcemeta.com/schema", "/$defs/a/$ref", - "https://www.sourcemeta.com/schema", "/$defs/a/$ref", "/$defs/a"); + "https://www.sourcemeta.com/schema", "/$defs/a/$ref", "/$defs/a", false); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$defs/b/$ref", "https://www.sourcemeta.com/schema", "/$defs/b/$ref", - "https://www.sourcemeta.com/schema", "/$defs/b/$ref", "/$defs/b"); + "https://www.sourcemeta.com/schema", "/$defs/b/$ref", "/$defs/b", false); // References diff --git a/test/jsonschema/jsonschema_frame_draft0_test.cc b/test/jsonschema/jsonschema_frame_draft0_test.cc index edb2dc665..78ef388ba 100644 --- a/test/jsonschema/jsonschema_frame_draft0_test.cc +++ b/test/jsonschema/jsonschema_frame_draft0_test.cc @@ -8,27 +8,30 @@ #define EXPECT_FRAME_STATIC_DRAFT0_RESOURCE( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_RESOURCE(frame, reference, root_id, expected_pointer, \ "http://json-schema.org/draft-00/schema#", \ JSON_Schema_Draft_0_Hyper, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); #define EXPECT_FRAME_STATIC_DRAFT0_POINTER( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_POINTER(frame, reference, root_id, expected_pointer, \ "http://json-schema.org/draft-00/schema#", \ JSON_Schema_Draft_0_Hyper, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); #define EXPECT_FRAME_STATIC_DRAFT0_SUBSCHEMA( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_SUBSCHEMA(frame, reference, root_id, expected_pointer, \ "http://json-schema.org/draft-00/schema#", \ JSON_Schema_Draft_0_Hyper, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); TEST(JSONSchema_frame_draft0, anonymous_with_nested_schema_resource) { const sourcemeta::core::JSON document = sourcemeta::core::parse_json(R"JSON({ @@ -45,27 +48,29 @@ TEST(JSONSchema_frame_draft0, anonymous_with_nested_schema_resource) { EXPECT_ANONYMOUS_FRAME_STATIC_RESOURCE( frame, "https://example.com", "/additionalProperties", - "http://json-schema.org/draft-00/schema#", JSON_Schema_Draft_0_Hyper, ""); + "http://json-schema.org/draft-00/schema#", JSON_Schema_Draft_0_Hyper, "", + false); // JSON Pointers EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/id", "/additionalProperties/id", "http://json-schema.org/draft-00/schema#", JSON_Schema_Draft_0_Hyper, - "/additionalProperties"); + "/additionalProperties", false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-00/schema#", - JSON_Schema_Draft_0_Hyper, std::nullopt); + JSON_Schema_Draft_0_Hyper, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-00/schema#", - JSON_Schema_Draft_0_Hyper, ""); + JSON_Schema_Draft_0_Hyper, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalProperties", "/additionalProperties", - "http://json-schema.org/draft-00/schema#", JSON_Schema_Draft_0_Hyper, ""); + "http://json-schema.org/draft-00/schema#", JSON_Schema_Draft_0_Hyper, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalProperties/id", "/additionalProperties/id", "http://json-schema.org/draft-00/schema#", JSON_Schema_Draft_0_Hyper, - "/additionalProperties"); + "/additionalProperties", false); // References @@ -92,18 +97,18 @@ TEST(JSONSchema_frame_draft0, empty_schema) { EXPECT_FRAME_STATIC_DRAFT0_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); // References @@ -130,18 +135,18 @@ TEST(JSONSchema_frame_draft0, empty_schema_trailing_hash) { EXPECT_FRAME_STATIC_DRAFT0_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); // References @@ -172,39 +177,39 @@ TEST(JSONSchema_frame_draft0, one_level_applicators_without_identifiers) { EXPECT_FRAME_STATIC_DRAFT0_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT0_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", - "https://www.sourcemeta.com/schema", "/items", ""); + "https://www.sourcemeta.com/schema", "/items", "", false); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/items/type", "https://www.sourcemeta.com/schema", "/items/type", - "https://www.sourcemeta.com/schema", "/items/type", "/items"); + "https://www.sourcemeta.com/schema", "/items/type", "/items", false); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", ""); + "https://www.sourcemeta.com/schema", "/properties", "", false); EXPECT_FRAME_STATIC_DRAFT0_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", - "https://www.sourcemeta.com/schema", "/properties/foo", ""); + "https://www.sourcemeta.com/schema", "/properties/foo", "", false); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/foo/type", "https://www.sourcemeta.com/schema", "/properties/foo/type", "https://www.sourcemeta.com/schema", "/properties/foo/type", - "/properties/foo"); + "/properties/foo", false); // References @@ -232,42 +237,42 @@ TEST(JSONSchema_frame_draft0, one_level_applicators_with_identifiers) { EXPECT_FRAME_STATIC_DRAFT0_RESOURCE( frame, "https://www.sourcemeta.com/test/qux", "https://www.sourcemeta.com/test/qux", "", - "https://www.sourcemeta.com/test/qux", "", std::nullopt); - EXPECT_FRAME_STATIC_DRAFT0_RESOURCE(frame, "https://www.sourcemeta.com/foo", - "https://www.sourcemeta.com/test/qux", - "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/test/qux", "", std::nullopt, false); + EXPECT_FRAME_STATIC_DRAFT0_RESOURCE( + frame, "https://www.sourcemeta.com/foo", + "https://www.sourcemeta.com/test/qux", "/items", + "https://www.sourcemeta.com/foo", "", "", false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/test/qux#/id", "https://www.sourcemeta.com/test/qux", "/id", - "https://www.sourcemeta.com/test/qux", "/id", ""); + "https://www.sourcemeta.com/test/qux", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/test/qux#/$schema", "https://www.sourcemeta.com/test/qux", "/$schema", - "https://www.sourcemeta.com/test/qux", "/$schema", ""); + "https://www.sourcemeta.com/test/qux", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT0_SUBSCHEMA( frame, "https://www.sourcemeta.com/test/qux#/items", "https://www.sourcemeta.com/test/qux", "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/test/qux#/items/id", "https://www.sourcemeta.com/test/qux", "/items/id", - "https://www.sourcemeta.com/foo", "/id", "/items"); + "https://www.sourcemeta.com/foo", "/id", "/items", false); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/test/qux#/items/type", "https://www.sourcemeta.com/test/qux", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/foo#/id", "https://www.sourcemeta.com/test/qux", "/items/id", - "https://www.sourcemeta.com/foo", "/id", "/items"); + "https://www.sourcemeta.com/foo", "/id", "/items", false); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/foo#/type", "https://www.sourcemeta.com/test/qux", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); // References @@ -298,42 +303,42 @@ TEST(JSONSchema_frame_draft0, subschema_absolute_identifier) { EXPECT_FRAME_STATIC_DRAFT0_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); - EXPECT_FRAME_STATIC_DRAFT0_RESOURCE(frame, "https://www.sourcemeta.com/foo", - "https://www.sourcemeta.com/schema", - "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); + EXPECT_FRAME_STATIC_DRAFT0_RESOURCE( + frame, "https://www.sourcemeta.com/foo", + "https://www.sourcemeta.com/schema", "/items", + "https://www.sourcemeta.com/foo", "", "", false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT0_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/items/id", "https://www.sourcemeta.com/schema", "/items/id", - "https://www.sourcemeta.com/foo", "/id", "/items"); + "https://www.sourcemeta.com/foo", "/id", "/items", false); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/items/type", "https://www.sourcemeta.com/schema", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/foo#/id", "https://www.sourcemeta.com/schema", "/items/id", - "https://www.sourcemeta.com/foo", "/id", "/items"); + "https://www.sourcemeta.com/foo", "/id", "/items", false); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/foo#/type", "https://www.sourcemeta.com/schema", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); // References @@ -376,18 +381,18 @@ TEST(JSONSchema_frame_draft0, explicit_argument_id_same) { EXPECT_FRAME_STATIC_DRAFT0_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); // References @@ -425,59 +430,60 @@ TEST(JSONSchema_frame_draft0, explicit_argument_id_different) { EXPECT_FRAME_STATIC_DRAFT0_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_STATIC_DRAFT0_RESOURCE( frame, "https://www.sourcemeta.com/test", "https://www.sourcemeta.com/schema", "/properties/one", - "https://www.sourcemeta.com/test", "", ""); + "https://www.sourcemeta.com/test", "", "", false); EXPECT_FRAME_STATIC_DRAFT0_RESOURCE( frame, "https://www.example.com", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); - EXPECT_FRAME_STATIC_DRAFT0_RESOURCE(frame, "https://www.example.com/test", - "https://www.sourcemeta.com/schema", - "/properties/one", - "https://www.example.com/test", "", ""); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); + EXPECT_FRAME_STATIC_DRAFT0_RESOURCE( + frame, "https://www.example.com/test", + "https://www.sourcemeta.com/schema", "/properties/one", + "https://www.example.com/test", "", "", false); EXPECT_FRAME_STATIC_DRAFT0_RESOURCE( frame, "https://www.test.com", "https://www.sourcemeta.com/schema", - "/properties/two", "https://www.test.com", "", ""); + "/properties/two", "https://www.test.com", "", "", false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", ""); + "https://www.sourcemeta.com/schema", "/properties", "", false); EXPECT_FRAME_STATIC_DRAFT0_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/one", "https://www.sourcemeta.com/schema", "/properties/one", - "https://www.sourcemeta.com/test", "", ""); + "https://www.sourcemeta.com/test", "", "", false); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/one/id", "https://www.sourcemeta.com/schema", "/properties/one/id", - "https://www.sourcemeta.com/test", "/id", "/properties/one"); + "https://www.sourcemeta.com/test", "/id", "/properties/one", false); EXPECT_FRAME_STATIC_DRAFT0_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/two", "https://www.sourcemeta.com/schema", "/properties/two", - "https://www.test.com", "", ""); + "https://www.test.com", "", "", false); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/two/id", "https://www.sourcemeta.com/schema", "/properties/two/id", - "https://www.test.com", "/id", "/properties/two"); + "https://www.test.com", "/id", "/properties/two", false); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/test#/id", "https://www.sourcemeta.com/schema", "/properties/one/id", - "https://www.sourcemeta.com/test", "/id", "/properties/one"); + "https://www.sourcemeta.com/test", "/id", "/properties/one", false); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.test.com#/id", "https://www.sourcemeta.com/schema", - "/properties/two/id", "https://www.test.com", "/id", "/properties/two"); + "/properties/two/id", "https://www.test.com", "/id", "/properties/two", + false); // References @@ -504,13 +510,13 @@ TEST(JSONSchema_frame_draft0, ref_metaschema) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-00/schema#", - JSON_Schema_Draft_0_Hyper, std::nullopt); + JSON_Schema_Draft_0_Hyper, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-00/schema#", - JSON_Schema_Draft_0_Hyper, ""); + JSON_Schema_Draft_0_Hyper, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "http://json-schema.org/draft-00/schema#", - JSON_Schema_Draft_0_Hyper, ""); + JSON_Schema_Draft_0_Hyper, "", false); // References diff --git a/test/jsonschema/jsonschema_frame_draft1_test.cc b/test/jsonschema/jsonschema_frame_draft1_test.cc index 6f59103b3..628280897 100644 --- a/test/jsonschema/jsonschema_frame_draft1_test.cc +++ b/test/jsonschema/jsonschema_frame_draft1_test.cc @@ -8,27 +8,30 @@ #define EXPECT_FRAME_STATIC_DRAFT1_RESOURCE( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_RESOURCE(frame, reference, root_id, expected_pointer, \ "http://json-schema.org/draft-01/schema#", \ JSON_Schema_Draft_1_Hyper, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); #define EXPECT_FRAME_STATIC_DRAFT1_POINTER( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_POINTER(frame, reference, root_id, expected_pointer, \ "http://json-schema.org/draft-01/schema#", \ JSON_Schema_Draft_1_Hyper, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); #define EXPECT_FRAME_STATIC_DRAFT1_SUBSCHEMA( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_SUBSCHEMA(frame, reference, root_id, expected_pointer, \ "http://json-schema.org/draft-01/schema#", \ JSON_Schema_Draft_1_Hyper, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); TEST(JSONSchema_frame_draft1, anonymous_with_nested_schema_resource) { const sourcemeta::core::JSON document = sourcemeta::core::parse_json(R"JSON({ @@ -45,27 +48,29 @@ TEST(JSONSchema_frame_draft1, anonymous_with_nested_schema_resource) { EXPECT_ANONYMOUS_FRAME_STATIC_RESOURCE( frame, "https://example.com", "/additionalProperties", - "http://json-schema.org/draft-01/schema#", JSON_Schema_Draft_1_Hyper, ""); + "http://json-schema.org/draft-01/schema#", JSON_Schema_Draft_1_Hyper, "", + false); // JSON Pointers EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/id", "/additionalProperties/id", "http://json-schema.org/draft-01/schema#", JSON_Schema_Draft_1_Hyper, - "/additionalProperties"); + "/additionalProperties", false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-01/schema#", - JSON_Schema_Draft_1_Hyper, std::nullopt); + JSON_Schema_Draft_1_Hyper, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-01/schema#", - JSON_Schema_Draft_1_Hyper, ""); + JSON_Schema_Draft_1_Hyper, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalProperties", "/additionalProperties", - "http://json-schema.org/draft-01/schema#", JSON_Schema_Draft_1_Hyper, ""); + "http://json-schema.org/draft-01/schema#", JSON_Schema_Draft_1_Hyper, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalProperties/id", "/additionalProperties/id", "http://json-schema.org/draft-01/schema#", JSON_Schema_Draft_1_Hyper, - "/additionalProperties"); + "/additionalProperties", false); // References @@ -92,18 +97,18 @@ TEST(JSONSchema_frame_draft1, empty_schema) { EXPECT_FRAME_STATIC_DRAFT1_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); // References @@ -130,18 +135,18 @@ TEST(JSONSchema_frame_draft1, empty_schema_trailing_hash) { EXPECT_FRAME_STATIC_DRAFT1_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); // References @@ -172,39 +177,39 @@ TEST(JSONSchema_frame_draft1, one_level_applicators_without_identifiers) { EXPECT_FRAME_STATIC_DRAFT1_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT1_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", - "https://www.sourcemeta.com/schema", "/items", ""); + "https://www.sourcemeta.com/schema", "/items", "", false); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/items/type", "https://www.sourcemeta.com/schema", "/items/type", - "https://www.sourcemeta.com/schema", "/items/type", "/items"); + "https://www.sourcemeta.com/schema", "/items/type", "/items", false); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", ""); + "https://www.sourcemeta.com/schema", "/properties", "", false); EXPECT_FRAME_STATIC_DRAFT1_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", - "https://www.sourcemeta.com/schema", "/properties/foo", ""); + "https://www.sourcemeta.com/schema", "/properties/foo", "", false); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/foo/type", "https://www.sourcemeta.com/schema", "/properties/foo/type", "https://www.sourcemeta.com/schema", "/properties/foo/type", - "/properties/foo"); + "/properties/foo", false); // References @@ -232,42 +237,42 @@ TEST(JSONSchema_frame_draft1, one_level_applicators_with_identifiers) { EXPECT_FRAME_STATIC_DRAFT1_RESOURCE( frame, "https://www.sourcemeta.com/test/qux", "https://www.sourcemeta.com/test/qux", "", - "https://www.sourcemeta.com/test/qux", "", std::nullopt); - EXPECT_FRAME_STATIC_DRAFT1_RESOURCE(frame, "https://www.sourcemeta.com/foo", - "https://www.sourcemeta.com/test/qux", - "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/test/qux", "", std::nullopt, false); + EXPECT_FRAME_STATIC_DRAFT1_RESOURCE( + frame, "https://www.sourcemeta.com/foo", + "https://www.sourcemeta.com/test/qux", "/items", + "https://www.sourcemeta.com/foo", "", "", false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/test/qux#/id", "https://www.sourcemeta.com/test/qux", "/id", - "https://www.sourcemeta.com/test/qux", "/id", ""); + "https://www.sourcemeta.com/test/qux", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/test/qux#/$schema", "https://www.sourcemeta.com/test/qux", "/$schema", - "https://www.sourcemeta.com/test/qux", "/$schema", ""); + "https://www.sourcemeta.com/test/qux", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT1_SUBSCHEMA( frame, "https://www.sourcemeta.com/test/qux#/items", "https://www.sourcemeta.com/test/qux", "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/test/qux#/items/id", "https://www.sourcemeta.com/test/qux", "/items/id", - "https://www.sourcemeta.com/foo", "/id", "/items"); + "https://www.sourcemeta.com/foo", "/id", "/items", false); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/test/qux#/items/type", "https://www.sourcemeta.com/test/qux", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/foo#/id", "https://www.sourcemeta.com/test/qux", "/items/id", - "https://www.sourcemeta.com/foo", "/id", "/items"); + "https://www.sourcemeta.com/foo", "/id", "/items", false); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/foo#/type", "https://www.sourcemeta.com/test/qux", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); // References @@ -298,42 +303,42 @@ TEST(JSONSchema_frame_draft1, subschema_absolute_identifier) { EXPECT_FRAME_STATIC_DRAFT1_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); - EXPECT_FRAME_STATIC_DRAFT1_RESOURCE(frame, "https://www.sourcemeta.com/foo", - "https://www.sourcemeta.com/schema", - "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); + EXPECT_FRAME_STATIC_DRAFT1_RESOURCE( + frame, "https://www.sourcemeta.com/foo", + "https://www.sourcemeta.com/schema", "/items", + "https://www.sourcemeta.com/foo", "", "", false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT1_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/items/id", "https://www.sourcemeta.com/schema", "/items/id", - "https://www.sourcemeta.com/foo", "/id", "/items"); + "https://www.sourcemeta.com/foo", "/id", "/items", false); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/items/type", "https://www.sourcemeta.com/schema", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/foo#/id", "https://www.sourcemeta.com/schema", "/items/id", - "https://www.sourcemeta.com/foo", "/id", "/items"); + "https://www.sourcemeta.com/foo", "/id", "/items", false); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/foo#/type", "https://www.sourcemeta.com/schema", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); // References @@ -376,18 +381,18 @@ TEST(JSONSchema_frame_draft1, explicit_argument_id_same) { EXPECT_FRAME_STATIC_DRAFT1_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); // References @@ -425,59 +430,60 @@ TEST(JSONSchema_frame_draft1, explicit_argument_id_different) { EXPECT_FRAME_STATIC_DRAFT1_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_STATIC_DRAFT1_RESOURCE( frame, "https://www.sourcemeta.com/test", "https://www.sourcemeta.com/schema", "/properties/one", - "https://www.sourcemeta.com/test", "", ""); + "https://www.sourcemeta.com/test", "", "", false); EXPECT_FRAME_STATIC_DRAFT1_RESOURCE( frame, "https://www.example.com", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); - EXPECT_FRAME_STATIC_DRAFT1_RESOURCE(frame, "https://www.example.com/test", - "https://www.sourcemeta.com/schema", - "/properties/one", - "https://www.example.com/test", "", ""); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); + EXPECT_FRAME_STATIC_DRAFT1_RESOURCE( + frame, "https://www.example.com/test", + "https://www.sourcemeta.com/schema", "/properties/one", + "https://www.example.com/test", "", "", false); EXPECT_FRAME_STATIC_DRAFT1_RESOURCE( frame, "https://www.test.com", "https://www.sourcemeta.com/schema", - "/properties/two", "https://www.test.com", "", ""); + "/properties/two", "https://www.test.com", "", "", false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", ""); + "https://www.sourcemeta.com/schema", "/properties", "", false); EXPECT_FRAME_STATIC_DRAFT1_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/one", "https://www.sourcemeta.com/schema", "/properties/one", - "https://www.sourcemeta.com/test", "", ""); + "https://www.sourcemeta.com/test", "", "", false); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/one/id", "https://www.sourcemeta.com/schema", "/properties/one/id", - "https://www.sourcemeta.com/test", "/id", "/properties/one"); + "https://www.sourcemeta.com/test", "/id", "/properties/one", false); EXPECT_FRAME_STATIC_DRAFT1_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/two", "https://www.sourcemeta.com/schema", "/properties/two", - "https://www.test.com", "", ""); + "https://www.test.com", "", "", false); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/two/id", "https://www.sourcemeta.com/schema", "/properties/two/id", - "https://www.test.com", "/id", "/properties/two"); + "https://www.test.com", "/id", "/properties/two", false); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/test#/id", "https://www.sourcemeta.com/schema", "/properties/one/id", - "https://www.sourcemeta.com/test", "/id", "/properties/one"); + "https://www.sourcemeta.com/test", "/id", "/properties/one", false); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.test.com#/id", "https://www.sourcemeta.com/schema", - "/properties/two/id", "https://www.test.com", "/id", "/properties/two"); + "/properties/two/id", "https://www.test.com", "/id", "/properties/two", + false); // References @@ -504,13 +510,13 @@ TEST(JSONSchema_frame_draft1, ref_metaschema) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-01/schema#", - JSON_Schema_Draft_1_Hyper, std::nullopt); + JSON_Schema_Draft_1_Hyper, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-01/schema#", - JSON_Schema_Draft_1_Hyper, ""); + JSON_Schema_Draft_1_Hyper, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "http://json-schema.org/draft-01/schema#", - JSON_Schema_Draft_1_Hyper, ""); + JSON_Schema_Draft_1_Hyper, "", false); // References diff --git a/test/jsonschema/jsonschema_frame_draft2_test.cc b/test/jsonschema/jsonschema_frame_draft2_test.cc index 26c945067..5ee797b90 100644 --- a/test/jsonschema/jsonschema_frame_draft2_test.cc +++ b/test/jsonschema/jsonschema_frame_draft2_test.cc @@ -8,27 +8,30 @@ #define EXPECT_FRAME_STATIC_DRAFT2_POINTER( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_POINTER(frame, reference, root_id, expected_pointer, \ "http://json-schema.org/draft-02/schema#", \ JSON_Schema_Draft_2_Hyper, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); #define EXPECT_FRAME_STATIC_DRAFT2_RESOURCE( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_RESOURCE(frame, reference, root_id, expected_pointer, \ "http://json-schema.org/draft-02/schema#", \ JSON_Schema_Draft_2_Hyper, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); #define EXPECT_FRAME_STATIC_DRAFT2_SUBSCHEMA( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_SUBSCHEMA(frame, reference, root_id, expected_pointer, \ "http://json-schema.org/draft-02/schema#", \ JSON_Schema_Draft_2_Hyper, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); TEST(JSONSchema_frame_draft2, anonymous_with_nested_schema_resource) { const sourcemeta::core::JSON document = sourcemeta::core::parse_json(R"JSON({ @@ -45,27 +48,29 @@ TEST(JSONSchema_frame_draft2, anonymous_with_nested_schema_resource) { EXPECT_ANONYMOUS_FRAME_STATIC_RESOURCE( frame, "https://example.com", "/additionalProperties", - "http://json-schema.org/draft-02/schema#", JSON_Schema_Draft_2_Hyper, ""); + "http://json-schema.org/draft-02/schema#", JSON_Schema_Draft_2_Hyper, "", + false); // JSON Pointers EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/id", "/additionalProperties/id", "http://json-schema.org/draft-02/schema#", JSON_Schema_Draft_2_Hyper, - "/additionalProperties"); + "/additionalProperties", false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-02/schema#", - JSON_Schema_Draft_2_Hyper, std::nullopt); + JSON_Schema_Draft_2_Hyper, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-02/schema#", - JSON_Schema_Draft_2_Hyper, ""); + JSON_Schema_Draft_2_Hyper, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalProperties", "/additionalProperties", - "http://json-schema.org/draft-02/schema#", JSON_Schema_Draft_2_Hyper, ""); + "http://json-schema.org/draft-02/schema#", JSON_Schema_Draft_2_Hyper, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalProperties/id", "/additionalProperties/id", "http://json-schema.org/draft-02/schema#", JSON_Schema_Draft_2_Hyper, - "/additionalProperties"); + "/additionalProperties", false); // References @@ -92,18 +97,18 @@ TEST(JSONSchema_frame_draft2, empty_schema) { EXPECT_FRAME_STATIC_DRAFT2_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); // References @@ -130,18 +135,18 @@ TEST(JSONSchema_frame_draft2, empty_schema_trailing_hash) { EXPECT_FRAME_STATIC_DRAFT2_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); // References @@ -172,39 +177,39 @@ TEST(JSONSchema_frame_draft2, one_level_applicators_without_identifiers) { EXPECT_FRAME_STATIC_DRAFT2_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT2_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", - "https://www.sourcemeta.com/schema", "/items", ""); + "https://www.sourcemeta.com/schema", "/items", "", false); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/items/type", "https://www.sourcemeta.com/schema", "/items/type", - "https://www.sourcemeta.com/schema", "/items/type", "/items"); + "https://www.sourcemeta.com/schema", "/items/type", "/items", false); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", ""); + "https://www.sourcemeta.com/schema", "/properties", "", false); EXPECT_FRAME_STATIC_DRAFT2_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", - "https://www.sourcemeta.com/schema", "/properties/foo", ""); + "https://www.sourcemeta.com/schema", "/properties/foo", "", false); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/foo/type", "https://www.sourcemeta.com/schema", "/properties/foo/type", "https://www.sourcemeta.com/schema", "/properties/foo/type", - "/properties/foo"); + "/properties/foo", false); // References @@ -232,42 +237,42 @@ TEST(JSONSchema_frame_draft2, one_level_applicators_with_identifiers) { EXPECT_FRAME_STATIC_DRAFT2_RESOURCE( frame, "https://www.sourcemeta.com/test/qux", "https://www.sourcemeta.com/test/qux", "", - "https://www.sourcemeta.com/test/qux", "", std::nullopt); - EXPECT_FRAME_STATIC_DRAFT2_RESOURCE(frame, "https://www.sourcemeta.com/foo", - "https://www.sourcemeta.com/test/qux", - "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/test/qux", "", std::nullopt, false); + EXPECT_FRAME_STATIC_DRAFT2_RESOURCE( + frame, "https://www.sourcemeta.com/foo", + "https://www.sourcemeta.com/test/qux", "/items", + "https://www.sourcemeta.com/foo", "", "", false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/test/qux#/id", "https://www.sourcemeta.com/test/qux", "/id", - "https://www.sourcemeta.com/test/qux", "/id", ""); + "https://www.sourcemeta.com/test/qux", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/test/qux#/$schema", "https://www.sourcemeta.com/test/qux", "/$schema", - "https://www.sourcemeta.com/test/qux", "/$schema", ""); + "https://www.sourcemeta.com/test/qux", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT2_SUBSCHEMA( frame, "https://www.sourcemeta.com/test/qux#/items", "https://www.sourcemeta.com/test/qux", "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/test/qux#/items/id", "https://www.sourcemeta.com/test/qux", "/items/id", - "https://www.sourcemeta.com/foo", "/id", "/items"); + "https://www.sourcemeta.com/foo", "/id", "/items", false); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/test/qux#/items/type", "https://www.sourcemeta.com/test/qux", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/foo#/id", "https://www.sourcemeta.com/test/qux", "/items/id", - "https://www.sourcemeta.com/foo", "/id", "/items"); + "https://www.sourcemeta.com/foo", "/id", "/items", false); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/foo#/type", "https://www.sourcemeta.com/test/qux", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); // References @@ -298,42 +303,42 @@ TEST(JSONSchema_frame_draft2, subschema_absolute_identifier) { EXPECT_FRAME_STATIC_DRAFT2_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); - EXPECT_FRAME_STATIC_DRAFT2_RESOURCE(frame, "https://www.sourcemeta.com/foo", - "https://www.sourcemeta.com/schema", - "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); + EXPECT_FRAME_STATIC_DRAFT2_RESOURCE( + frame, "https://www.sourcemeta.com/foo", + "https://www.sourcemeta.com/schema", "/items", + "https://www.sourcemeta.com/foo", "", "", false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT2_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/items/id", "https://www.sourcemeta.com/schema", "/items/id", - "https://www.sourcemeta.com/foo", "/id", "/items"); + "https://www.sourcemeta.com/foo", "/id", "/items", false); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/items/type", "https://www.sourcemeta.com/schema", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/foo#/id", "https://www.sourcemeta.com/schema", "/items/id", - "https://www.sourcemeta.com/foo", "/id", "/items"); + "https://www.sourcemeta.com/foo", "/id", "/items", false); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/foo#/type", "https://www.sourcemeta.com/schema", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); // References @@ -376,18 +381,18 @@ TEST(JSONSchema_frame_draft2, explicit_argument_id_same) { EXPECT_FRAME_STATIC_DRAFT2_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); // References @@ -425,59 +430,60 @@ TEST(JSONSchema_frame_draft2, explicit_argument_id_different) { EXPECT_FRAME_STATIC_DRAFT2_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_STATIC_DRAFT2_RESOURCE( frame, "https://www.sourcemeta.com/test", "https://www.sourcemeta.com/schema", "/properties/one", - "https://www.sourcemeta.com/test", "", ""); + "https://www.sourcemeta.com/test", "", "", false); EXPECT_FRAME_STATIC_DRAFT2_RESOURCE( frame, "https://www.example.com", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); - EXPECT_FRAME_STATIC_DRAFT2_RESOURCE(frame, "https://www.example.com/test", - "https://www.sourcemeta.com/schema", - "/properties/one", - "https://www.example.com/test", "", ""); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); + EXPECT_FRAME_STATIC_DRAFT2_RESOURCE( + frame, "https://www.example.com/test", + "https://www.sourcemeta.com/schema", "/properties/one", + "https://www.example.com/test", "", "", false); EXPECT_FRAME_STATIC_DRAFT2_RESOURCE( frame, "https://www.test.com", "https://www.sourcemeta.com/schema", - "/properties/two", "https://www.test.com", "", ""); + "/properties/two", "https://www.test.com", "", "", false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", ""); + "https://www.sourcemeta.com/schema", "/properties", "", false); EXPECT_FRAME_STATIC_DRAFT2_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/one", "https://www.sourcemeta.com/schema", "/properties/one", - "https://www.sourcemeta.com/test", "", ""); + "https://www.sourcemeta.com/test", "", "", false); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/one/id", "https://www.sourcemeta.com/schema", "/properties/one/id", - "https://www.sourcemeta.com/test", "/id", "/properties/one"); + "https://www.sourcemeta.com/test", "/id", "/properties/one", false); EXPECT_FRAME_STATIC_DRAFT2_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/two", "https://www.sourcemeta.com/schema", "/properties/two", - "https://www.test.com", "", ""); + "https://www.test.com", "", "", false); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/two/id", "https://www.sourcemeta.com/schema", "/properties/two/id", - "https://www.test.com", "/id", "/properties/two"); + "https://www.test.com", "/id", "/properties/two", false); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/test#/id", "https://www.sourcemeta.com/schema", "/properties/one/id", - "https://www.sourcemeta.com/test", "/id", "/properties/one"); + "https://www.sourcemeta.com/test", "/id", "/properties/one", false); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.test.com#/id", "https://www.sourcemeta.com/schema", - "/properties/two/id", "https://www.test.com", "/id", "/properties/two"); + "/properties/two/id", "https://www.test.com", "/id", "/properties/two", + false); // References @@ -504,13 +510,13 @@ TEST(JSONSchema_frame_draft2, ref_metaschema) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-02/schema#", - JSON_Schema_Draft_2_Hyper, std::nullopt); + JSON_Schema_Draft_2_Hyper, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-02/schema#", - JSON_Schema_Draft_2_Hyper, ""); + JSON_Schema_Draft_2_Hyper, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "http://json-schema.org/draft-02/schema#", - JSON_Schema_Draft_2_Hyper, ""); + JSON_Schema_Draft_2_Hyper, "", false); // References diff --git a/test/jsonschema/jsonschema_frame_draft3_test.cc b/test/jsonschema/jsonschema_frame_draft3_test.cc index 5bc7c37b6..e50eba2e1 100644 --- a/test/jsonschema/jsonschema_frame_draft3_test.cc +++ b/test/jsonschema/jsonschema_frame_draft3_test.cc @@ -8,27 +8,30 @@ #define EXPECT_FRAME_STATIC_DRAFT3_POINTER( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_POINTER(frame, reference, root_id, expected_pointer, \ "http://json-schema.org/draft-03/schema#", \ JSON_Schema_Draft_3, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); #define EXPECT_FRAME_STATIC_DRAFT3_RESOURCE( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_RESOURCE(frame, reference, root_id, expected_pointer, \ "http://json-schema.org/draft-03/schema#", \ JSON_Schema_Draft_3, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); #define EXPECT_FRAME_STATIC_DRAFT3_SUBSCHEMA( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_SUBSCHEMA(frame, reference, root_id, expected_pointer, \ "http://json-schema.org/draft-03/schema#", \ JSON_Schema_Draft_3, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); TEST(JSONSchema_frame_draft3, anonymous_with_nested_schema_resource) { const sourcemeta::core::JSON document = sourcemeta::core::parse_json(R"JSON({ @@ -45,27 +48,29 @@ TEST(JSONSchema_frame_draft3, anonymous_with_nested_schema_resource) { EXPECT_ANONYMOUS_FRAME_STATIC_RESOURCE( frame, "https://example.com", "/additionalProperties", - "http://json-schema.org/draft-03/schema#", JSON_Schema_Draft_3, ""); + "http://json-schema.org/draft-03/schema#", JSON_Schema_Draft_3, "", + false); // JSON Pointers EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/id", "/additionalProperties/id", "http://json-schema.org/draft-03/schema#", JSON_Schema_Draft_3, - "/additionalProperties"); + "/additionalProperties", false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-03/schema#", - JSON_Schema_Draft_3, std::nullopt); + JSON_Schema_Draft_3, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-03/schema#", - JSON_Schema_Draft_3, ""); + JSON_Schema_Draft_3, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalProperties", "/additionalProperties", - "http://json-schema.org/draft-03/schema#", JSON_Schema_Draft_3, ""); + "http://json-schema.org/draft-03/schema#", JSON_Schema_Draft_3, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalProperties/id", "/additionalProperties/id", "http://json-schema.org/draft-03/schema#", JSON_Schema_Draft_3, - "/additionalProperties"); + "/additionalProperties", false); // References @@ -92,18 +97,18 @@ TEST(JSONSchema_frame_draft3, empty_schema) { EXPECT_FRAME_STATIC_DRAFT3_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); // References @@ -130,18 +135,18 @@ TEST(JSONSchema_frame_draft3, empty_schema_trailing_slash) { EXPECT_FRAME_STATIC_DRAFT3_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); // References @@ -172,39 +177,39 @@ TEST(JSONSchema_frame_draft3, one_level_applicators_without_identifiers) { EXPECT_FRAME_STATIC_DRAFT3_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT3_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", - "https://www.sourcemeta.com/schema", "/items", ""); + "https://www.sourcemeta.com/schema", "/items", "", false); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/items/type", "https://www.sourcemeta.com/schema", "/items/type", - "https://www.sourcemeta.com/schema", "/items/type", "/items"); + "https://www.sourcemeta.com/schema", "/items/type", "/items", false); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", ""); + "https://www.sourcemeta.com/schema", "/properties", "", false); EXPECT_FRAME_STATIC_DRAFT3_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", - "https://www.sourcemeta.com/schema", "/properties/foo", ""); + "https://www.sourcemeta.com/schema", "/properties/foo", "", false); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/foo/type", "https://www.sourcemeta.com/schema", "/properties/foo/type", "https://www.sourcemeta.com/schema", "/properties/foo/type", - "/properties/foo"); + "/properties/foo", false); // References @@ -232,42 +237,42 @@ TEST(JSONSchema_frame_draft3, one_level_applicators_with_identifiers) { EXPECT_FRAME_STATIC_DRAFT3_RESOURCE( frame, "https://www.sourcemeta.com/test/qux", "https://www.sourcemeta.com/test/qux", "", - "https://www.sourcemeta.com/test/qux", "", std::nullopt); - EXPECT_FRAME_STATIC_DRAFT3_RESOURCE(frame, "https://www.sourcemeta.com/foo", - "https://www.sourcemeta.com/test/qux", - "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/test/qux", "", std::nullopt, false); + EXPECT_FRAME_STATIC_DRAFT3_RESOURCE( + frame, "https://www.sourcemeta.com/foo", + "https://www.sourcemeta.com/test/qux", "/items", + "https://www.sourcemeta.com/foo", "", "", false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/test/qux#/id", "https://www.sourcemeta.com/test/qux", "/id", - "https://www.sourcemeta.com/test/qux", "/id", ""); + "https://www.sourcemeta.com/test/qux", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/test/qux#/$schema", "https://www.sourcemeta.com/test/qux", "/$schema", - "https://www.sourcemeta.com/test/qux", "/$schema", ""); + "https://www.sourcemeta.com/test/qux", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT3_SUBSCHEMA( frame, "https://www.sourcemeta.com/test/qux#/items", "https://www.sourcemeta.com/test/qux", "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/test/qux#/items/id", "https://www.sourcemeta.com/test/qux", "/items/id", - "https://www.sourcemeta.com/foo", "/id", "/items"); + "https://www.sourcemeta.com/foo", "/id", "/items", false); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/test/qux#/items/type", "https://www.sourcemeta.com/test/qux", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/foo#/id", "https://www.sourcemeta.com/test/qux", "/items/id", - "https://www.sourcemeta.com/foo", "/id", "/items"); + "https://www.sourcemeta.com/foo", "/id", "/items", false); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/foo#/type", "https://www.sourcemeta.com/test/qux", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); // References @@ -298,42 +303,42 @@ TEST(JSONSchema_frame_draft3, subschema_absolute_identifier) { EXPECT_FRAME_STATIC_DRAFT3_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); - EXPECT_FRAME_STATIC_DRAFT3_RESOURCE(frame, "https://www.sourcemeta.com/foo", - "https://www.sourcemeta.com/schema", - "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); + EXPECT_FRAME_STATIC_DRAFT3_RESOURCE( + frame, "https://www.sourcemeta.com/foo", + "https://www.sourcemeta.com/schema", "/items", + "https://www.sourcemeta.com/foo", "", "", false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT3_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/items/id", "https://www.sourcemeta.com/schema", "/items/id", - "https://www.sourcemeta.com/foo", "/id", "/items"); + "https://www.sourcemeta.com/foo", "/id", "/items", false); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/items/type", "https://www.sourcemeta.com/schema", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/foo#/id", "https://www.sourcemeta.com/schema", "/items/id", - "https://www.sourcemeta.com/foo", "/id", "/items"); + "https://www.sourcemeta.com/foo", "/id", "/items", false); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/foo#/type", "https://www.sourcemeta.com/schema", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); // References @@ -376,18 +381,18 @@ TEST(JSONSchema_frame_draft3, explicit_argument_id_same) { EXPECT_FRAME_STATIC_DRAFT3_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); // References @@ -425,59 +430,60 @@ TEST(JSONSchema_frame_draft3, explicit_argument_id_different) { EXPECT_FRAME_STATIC_DRAFT3_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_STATIC_DRAFT3_RESOURCE( frame, "https://www.sourcemeta.com/test", "https://www.sourcemeta.com/schema", "/properties/one", - "https://www.sourcemeta.com/test", "", ""); + "https://www.sourcemeta.com/test", "", "", false); EXPECT_FRAME_STATIC_DRAFT3_RESOURCE( frame, "https://www.example.com", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); - EXPECT_FRAME_STATIC_DRAFT3_RESOURCE(frame, "https://www.example.com/test", - "https://www.sourcemeta.com/schema", - "/properties/one", - "https://www.example.com/test", "", ""); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); + EXPECT_FRAME_STATIC_DRAFT3_RESOURCE( + frame, "https://www.example.com/test", + "https://www.sourcemeta.com/schema", "/properties/one", + "https://www.example.com/test", "", "", false); EXPECT_FRAME_STATIC_DRAFT3_RESOURCE( frame, "https://www.test.com", "https://www.sourcemeta.com/schema", - "/properties/two", "https://www.test.com", "", ""); + "/properties/two", "https://www.test.com", "", "", false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", ""); + "https://www.sourcemeta.com/schema", "/properties", "", false); EXPECT_FRAME_STATIC_DRAFT3_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/one", "https://www.sourcemeta.com/schema", "/properties/one", - "https://www.sourcemeta.com/test", "", ""); + "https://www.sourcemeta.com/test", "", "", false); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/one/id", "https://www.sourcemeta.com/schema", "/properties/one/id", - "https://www.sourcemeta.com/test", "/id", "/properties/one"); + "https://www.sourcemeta.com/test", "/id", "/properties/one", false); EXPECT_FRAME_STATIC_DRAFT3_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/two", "https://www.sourcemeta.com/schema", "/properties/two", - "https://www.test.com", "", ""); + "https://www.test.com", "", "", false); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/two/id", "https://www.sourcemeta.com/schema", "/properties/two/id", - "https://www.test.com", "/id", "/properties/two"); + "https://www.test.com", "/id", "/properties/two", false); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/test#/id", "https://www.sourcemeta.com/schema", "/properties/one/id", - "https://www.sourcemeta.com/test", "/id", "/properties/one"); + "https://www.sourcemeta.com/test", "/id", "/properties/one", false); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.test.com#/id", "https://www.sourcemeta.com/schema", - "/properties/two/id", "https://www.test.com", "/id", "/properties/two"); + "/properties/two/id", "https://www.test.com", "/id", "/properties/two", + false); // References @@ -504,13 +510,13 @@ TEST(JSONSchema_frame_draft3, ref_metaschema) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-03/schema#", - JSON_Schema_Draft_3, std::nullopt); + JSON_Schema_Draft_3, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-03/schema#", - JSON_Schema_Draft_3, ""); + JSON_Schema_Draft_3, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "http://json-schema.org/draft-03/schema#", - JSON_Schema_Draft_3, ""); + JSON_Schema_Draft_3, "", false); // References @@ -548,17 +554,17 @@ TEST(JSONSchema_frame_draft3, ref_with_id) { // so we do know about the dialect anyway EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-03/schema#", - JSON_Schema_Draft_3, std::nullopt); + JSON_Schema_Draft_3, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/id", "/id", "http://json-schema.org/draft-03/schema#", - JSON_Schema_Draft_3, ""); + JSON_Schema_Draft_3, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-03/schema#", - JSON_Schema_Draft_3, ""); + JSON_Schema_Draft_3, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "http://json-schema.org/draft-03/schema#", - JSON_Schema_Draft_3, ""); + JSON_Schema_Draft_3, "", false); // References @@ -589,16 +595,16 @@ TEST(JSONSchema_frame_draft3, top_level_relative_ref_with_id) { // Note that `id` is IGNORED given the sibling `$ref` EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-03/schema#", - JSON_Schema_Draft_3, std::nullopt); + JSON_Schema_Draft_3, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-03/schema#", - JSON_Schema_Draft_3, ""); + JSON_Schema_Draft_3, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/id", "/id", "http://json-schema.org/draft-03/schema#", - JSON_Schema_Draft_3, ""); + JSON_Schema_Draft_3, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "http://json-schema.org/draft-03/schema#", - JSON_Schema_Draft_3, ""); + JSON_Schema_Draft_3, "", false); EXPECT_EQ(frame.references().size(), 2); @@ -626,28 +632,28 @@ TEST(JSONSchema_frame_draft3, nested_relative_ref_with_id) { EXPECT_EQ(frame.locations().size(), 6); - EXPECT_FRAME_STATIC_DRAFT3_RESOURCE(frame, "https://example.com", - "https://example.com", "", - "https://example.com", "", std::nullopt); + EXPECT_FRAME_STATIC_DRAFT3_RESOURCE( + frame, "https://example.com", "https://example.com", "", + "https://example.com", "", std::nullopt, false); EXPECT_FRAME_STATIC_DRAFT3_POINTER(frame, "https://example.com#/id", "https://example.com", "/id", - "https://example.com", "/id", ""); - EXPECT_FRAME_STATIC_DRAFT3_POINTER(frame, "https://example.com#/$schema", - "https://example.com", "/$schema", - "https://example.com", "/$schema", ""); + "https://example.com", "/id", "", false); + EXPECT_FRAME_STATIC_DRAFT3_POINTER( + frame, "https://example.com#/$schema", "https://example.com", "/$schema", + "https://example.com", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT3_SUBSCHEMA( frame, "https://example.com#/additionalProperties", "https://example.com", "/additionalProperties", "https://example.com", "/additionalProperties", - ""); + "", false); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://example.com#/additionalProperties/id", "https://example.com", "/additionalProperties/id", "https://example.com", - "/additionalProperties/id", "/additionalProperties"); + "/additionalProperties/id", "/additionalProperties", false); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://example.com#/additionalProperties/$ref", "https://example.com", "/additionalProperties/$ref", "https://example.com", "/additionalProperties/$ref", - "/additionalProperties"); + "/additionalProperties", false); EXPECT_EQ(frame.references().size(), 2); diff --git a/test/jsonschema/jsonschema_frame_draft4_test.cc b/test/jsonschema/jsonschema_frame_draft4_test.cc index f2fd7a9b6..c535f432e 100644 --- a/test/jsonschema/jsonschema_frame_draft4_test.cc +++ b/test/jsonschema/jsonschema_frame_draft4_test.cc @@ -8,35 +8,39 @@ #define EXPECT_FRAME_STATIC_DRAFT4_POINTER( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_POINTER(frame, reference, root_id, expected_pointer, \ "http://json-schema.org/draft-04/schema#", \ JSON_Schema_Draft_4, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); #define EXPECT_FRAME_STATIC_DRAFT4_RESOURCE( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_RESOURCE(frame, reference, root_id, expected_pointer, \ "http://json-schema.org/draft-04/schema#", \ JSON_Schema_Draft_4, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); #define EXPECT_FRAME_STATIC_DRAFT4_ANCHOR( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_ANCHOR(frame, reference, root_id, expected_pointer, \ "http://json-schema.org/draft-04/schema#", \ JSON_Schema_Draft_4, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); #define EXPECT_FRAME_STATIC_DRAFT4_SUBSCHEMA( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_SUBSCHEMA(frame, reference, root_id, expected_pointer, \ "http://json-schema.org/draft-04/schema#", \ JSON_Schema_Draft_4, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); TEST(JSONSchema_frame_draft4, anonymous_with_nested_schema_resource) { const sourcemeta::core::JSON document = sourcemeta::core::parse_json(R"JSON({ @@ -53,27 +57,29 @@ TEST(JSONSchema_frame_draft4, anonymous_with_nested_schema_resource) { EXPECT_ANONYMOUS_FRAME_STATIC_RESOURCE( frame, "https://example.com", "/additionalProperties", - "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, ""); + "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, "", + false); // JSON Pointers EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/id", "/additionalProperties/id", "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, - "/additionalProperties"); + "/additionalProperties", false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-04/schema#", - JSON_Schema_Draft_4, std::nullopt); + JSON_Schema_Draft_4, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-04/schema#", - JSON_Schema_Draft_4, ""); + JSON_Schema_Draft_4, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalProperties", "/additionalProperties", - "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, ""); + "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalProperties/id", "/additionalProperties/id", "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, - "/additionalProperties"); + "/additionalProperties", false); // References @@ -100,18 +106,18 @@ TEST(JSONSchema_frame_draft4, empty_schema) { EXPECT_FRAME_STATIC_DRAFT4_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); // References @@ -138,18 +144,18 @@ TEST(JSONSchema_frame_draft4, empty_schema_trailing_hash) { EXPECT_FRAME_STATIC_DRAFT4_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); // References @@ -180,39 +186,39 @@ TEST(JSONSchema_frame_draft4, one_level_applicators_without_identifiers) { EXPECT_FRAME_STATIC_DRAFT4_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT4_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", - "https://www.sourcemeta.com/schema", "/items", ""); + "https://www.sourcemeta.com/schema", "/items", "", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/items/type", "https://www.sourcemeta.com/schema", "/items/type", - "https://www.sourcemeta.com/schema", "/items/type", "/items"); + "https://www.sourcemeta.com/schema", "/items/type", "/items", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", ""); + "https://www.sourcemeta.com/schema", "/properties", "", false); EXPECT_FRAME_STATIC_DRAFT4_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", - "https://www.sourcemeta.com/schema", "/properties/foo", ""); + "https://www.sourcemeta.com/schema", "/properties/foo", "", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/foo/type", "https://www.sourcemeta.com/schema", "/properties/foo/type", "https://www.sourcemeta.com/schema", "/properties/foo/type", - "/properties/foo"); + "/properties/foo", false); // References @@ -240,42 +246,42 @@ TEST(JSONSchema_frame_draft4, one_level_applicators_with_identifiers) { EXPECT_FRAME_STATIC_DRAFT4_RESOURCE( frame, "https://www.sourcemeta.com/test/qux", "https://www.sourcemeta.com/test/qux", "", - "https://www.sourcemeta.com/test/qux", "", std::nullopt); - EXPECT_FRAME_STATIC_DRAFT4_RESOURCE(frame, "https://www.sourcemeta.com/foo", - "https://www.sourcemeta.com/test/qux", - "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/test/qux", "", std::nullopt, false); + EXPECT_FRAME_STATIC_DRAFT4_RESOURCE( + frame, "https://www.sourcemeta.com/foo", + "https://www.sourcemeta.com/test/qux", "/items", + "https://www.sourcemeta.com/foo", "", "", false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/test/qux#/id", "https://www.sourcemeta.com/test/qux", "/id", - "https://www.sourcemeta.com/test/qux", "/id", ""); + "https://www.sourcemeta.com/test/qux", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/test/qux#/$schema", "https://www.sourcemeta.com/test/qux", "/$schema", - "https://www.sourcemeta.com/test/qux", "/$schema", ""); + "https://www.sourcemeta.com/test/qux", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT4_SUBSCHEMA( frame, "https://www.sourcemeta.com/test/qux#/items", "https://www.sourcemeta.com/test/qux", "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/test/qux#/items/id", "https://www.sourcemeta.com/test/qux", "/items/id", - "https://www.sourcemeta.com/foo", "/id", "/items"); + "https://www.sourcemeta.com/foo", "/id", "/items", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/test/qux#/items/type", "https://www.sourcemeta.com/test/qux", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/foo#/id", "https://www.sourcemeta.com/test/qux", "/items/id", - "https://www.sourcemeta.com/foo", "/id", "/items"); + "https://www.sourcemeta.com/foo", "/id", "/items", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/foo#/type", "https://www.sourcemeta.com/test/qux", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); // References @@ -306,42 +312,42 @@ TEST(JSONSchema_frame_draft4, subschema_absolute_identifier) { EXPECT_FRAME_STATIC_DRAFT4_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); - EXPECT_FRAME_STATIC_DRAFT4_RESOURCE(frame, "https://www.sourcemeta.com/foo", - "https://www.sourcemeta.com/schema", - "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); + EXPECT_FRAME_STATIC_DRAFT4_RESOURCE( + frame, "https://www.sourcemeta.com/foo", + "https://www.sourcemeta.com/schema", "/items", + "https://www.sourcemeta.com/foo", "", "", false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT4_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/items/id", "https://www.sourcemeta.com/schema", "/items/id", - "https://www.sourcemeta.com/foo", "/id", "/items"); + "https://www.sourcemeta.com/foo", "/id", "/items", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/items/type", "https://www.sourcemeta.com/schema", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/foo#/id", "https://www.sourcemeta.com/schema", "/items/id", - "https://www.sourcemeta.com/foo", "/id", "/items"); + "https://www.sourcemeta.com/foo", "/id", "/items", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/foo#/type", "https://www.sourcemeta.com/schema", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); // References @@ -384,18 +390,18 @@ TEST(JSONSchema_frame_draft4, explicit_argument_id_same) { EXPECT_FRAME_STATIC_DRAFT4_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); // References @@ -433,59 +439,60 @@ TEST(JSONSchema_frame_draft4, explicit_argument_id_different) { EXPECT_FRAME_STATIC_DRAFT4_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_STATIC_DRAFT4_RESOURCE( frame, "https://www.sourcemeta.com/test", "https://www.sourcemeta.com/schema", "/properties/one", - "https://www.sourcemeta.com/test", "", ""); + "https://www.sourcemeta.com/test", "", "", false); EXPECT_FRAME_STATIC_DRAFT4_RESOURCE( frame, "https://www.example.com", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); - EXPECT_FRAME_STATIC_DRAFT4_RESOURCE(frame, "https://www.example.com/test", - "https://www.sourcemeta.com/schema", - "/properties/one", - "https://www.example.com/test", "", ""); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); + EXPECT_FRAME_STATIC_DRAFT4_RESOURCE( + frame, "https://www.example.com/test", + "https://www.sourcemeta.com/schema", "/properties/one", + "https://www.example.com/test", "", "", false); EXPECT_FRAME_STATIC_DRAFT4_RESOURCE( frame, "https://www.test.com", "https://www.sourcemeta.com/schema", - "/properties/two", "https://www.test.com", "", ""); + "/properties/two", "https://www.test.com", "", "", false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", ""); + "https://www.sourcemeta.com/schema", "/properties", "", false); EXPECT_FRAME_STATIC_DRAFT4_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/one", "https://www.sourcemeta.com/schema", "/properties/one", - "https://www.sourcemeta.com/test", "", ""); + "https://www.sourcemeta.com/test", "", "", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/one/id", "https://www.sourcemeta.com/schema", "/properties/one/id", - "https://www.sourcemeta.com/test", "/id", "/properties/one"); + "https://www.sourcemeta.com/test", "/id", "/properties/one", false); EXPECT_FRAME_STATIC_DRAFT4_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/two", "https://www.sourcemeta.com/schema", "/properties/two", - "https://www.test.com", "", ""); + "https://www.test.com", "", "", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/two/id", "https://www.sourcemeta.com/schema", "/properties/two/id", - "https://www.test.com", "/id", "/properties/two"); + "https://www.test.com", "/id", "/properties/two", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/test#/id", "https://www.sourcemeta.com/schema", "/properties/one/id", - "https://www.sourcemeta.com/test", "/id", "/properties/one"); + "https://www.sourcemeta.com/test", "/id", "/properties/one", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.test.com#/id", "https://www.sourcemeta.com/schema", - "/properties/two/id", "https://www.test.com", "/id", "/properties/two"); + "/properties/two/id", "https://www.test.com", "/id", "/properties/two", + false); // References @@ -512,13 +519,13 @@ TEST(JSONSchema_frame_draft4, ref_metaschema) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-04/schema#", - JSON_Schema_Draft_4, std::nullopt); + JSON_Schema_Draft_4, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-04/schema#", - JSON_Schema_Draft_4, ""); + JSON_Schema_Draft_4, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "http://json-schema.org/draft-04/schema#", - JSON_Schema_Draft_4, ""); + JSON_Schema_Draft_4, "", false); // References @@ -557,36 +564,40 @@ TEST(JSONSchema_frame_draft4, location_independent_identifier_anonymous) { // Pointers EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-04/schema#", - JSON_Schema_Draft_4, std::nullopt); + JSON_Schema_Draft_4, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-04/schema#", - JSON_Schema_Draft_4, ""); + JSON_Schema_Draft_4, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions", "/definitions", - "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, ""); + "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, "", + false); // Foo EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/definitions/foo", "/definitions/foo", - "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, ""); + "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions/foo/id", "/definitions/foo/id", "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, - "/definitions/foo"); + "/definitions/foo", false); // Bar EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/definitions/bar", "/definitions/bar", - "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, ""); + "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions/bar/$ref", "/definitions/bar/$ref", "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, - "/definitions/bar"); + "/definitions/bar", false); // Anchors EXPECT_ANONYMOUS_FRAME_STATIC_ANCHOR( frame, "#foo", "/definitions/foo", - "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, ""); + "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, "", + false); // References @@ -625,26 +636,29 @@ TEST(JSONSchema_frame_draft4, ref_with_id) { // so we do know about the dialect anyway EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-04/schema#", - JSON_Schema_Draft_4, std::nullopt); + JSON_Schema_Draft_4, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/id", "/id", "http://json-schema.org/draft-04/schema#", - JSON_Schema_Draft_4, ""); + JSON_Schema_Draft_4, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-04/schema#", - JSON_Schema_Draft_4, ""); + JSON_Schema_Draft_4, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "http://json-schema.org/draft-04/schema#", - JSON_Schema_Draft_4, ""); + JSON_Schema_Draft_4, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions", "/definitions", - "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, ""); + "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions/string", "/definitions/string", - "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, ""); + "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions/string/type", "/definitions/string/type", - "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, ""); + "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, "", + false); // References @@ -681,32 +695,32 @@ TEST(JSONSchema_frame_draft4, EXPECT_FRAME_STATIC_DRAFT4_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", ""); + "https://www.sourcemeta.com/schema", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", ""); + "https://www.sourcemeta.com/schema", "/properties", "", false); EXPECT_FRAME_STATIC_DRAFT4_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", - "https://www.sourcemeta.com/schema", "/properties/foo", ""); + "https://www.sourcemeta.com/schema", "/properties/foo", "", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/foo/$ref", "https://www.sourcemeta.com/schema", "/properties/foo/$ref", "https://www.sourcemeta.com/schema", "/properties/foo/$ref", - "/properties/foo"); + "/properties/foo", false); EXPECT_FRAME_STATIC_DRAFT4_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/bar", "https://www.sourcemeta.com/schema", "/properties/bar", - "https://www.sourcemeta.com/schema", "/properties/bar", ""); + "https://www.sourcemeta.com/schema", "/properties/bar", "", false); // References @@ -736,14 +750,15 @@ TEST(JSONSchema_frame_draft4, relative_base_uri_without_ref) { EXPECT_EQ(frame.locations().size(), 3); EXPECT_FRAME_STATIC_DRAFT4_RESOURCE(frame, "common", "common", "", "common", - "", std::nullopt); + "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT4_POINTER(frame, "common#/$schema", "common", - "/$schema", "common", "/$schema", ""); + "/$schema", "common", "/$schema", "", + false); EXPECT_FRAME_STATIC_DRAFT4_POINTER(frame, "common#/id", "common", "/id", - "common", "/id", ""); + "common", "/id", "", false); // References @@ -775,35 +790,37 @@ TEST(JSONSchema_frame_draft4, relative_base_uri_with_ref) { EXPECT_EQ(frame.locations().size(), 10); EXPECT_FRAME_STATIC_DRAFT4_RESOURCE(frame, "common", "common", "", "common", - "", std::nullopt); + "", std::nullopt, false); // Anchors EXPECT_FRAME_STATIC_DRAFT4_ANCHOR(frame, "common#foo", "common", "/definitions/foo", "common", - "/definitions/foo", ""); + "/definitions/foo", "", false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT4_POINTER(frame, "common#/$schema", "common", - "/$schema", "common", "/$schema", ""); + "/$schema", "common", "/$schema", "", + false); EXPECT_FRAME_STATIC_DRAFT4_POINTER(frame, "common#/id", "common", "/id", - "common", "/id", ""); + "common", "/id", "", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER(frame, "common#/allOf", "common", "/allOf", - "common", "/allOf", ""); + "common", "/allOf", "", false); EXPECT_FRAME_STATIC_DRAFT4_SUBSCHEMA(frame, "common#/allOf/0", "common", - "/allOf/0", "common", "/allOf/0", ""); + "/allOf/0", "common", "/allOf/0", "", + false); EXPECT_FRAME_STATIC_DRAFT4_POINTER(frame, "common#/allOf/0/$ref", "common", "/allOf/0/$ref", "common", "/allOf/0/$ref", - "/allOf/0"); + "/allOf/0", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER(frame, "common#/definitions", "common", "/definitions", "common", "/definitions", - ""); + "", false); EXPECT_FRAME_STATIC_DRAFT4_SUBSCHEMA(frame, "common#/definitions/foo", "common", "/definitions/foo", "common", - "/definitions/foo", ""); - EXPECT_FRAME_STATIC_DRAFT4_POINTER(frame, "common#/definitions/foo/id", - "common", "/definitions/foo/id", "common", - "/definitions/foo/id", "/definitions/foo"); + "/definitions/foo", "", false); + EXPECT_FRAME_STATIC_DRAFT4_POINTER( + frame, "common#/definitions/foo/id", "common", "/definitions/foo/id", + "common", "/definitions/foo/id", "/definitions/foo", false); // References @@ -831,13 +848,13 @@ TEST(JSONSchema_frame_draft4, ref_with_invalid_type) { EXPECT_EQ(frame.locations().size(), 3); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-04/schema#", - JSON_Schema_Draft_4, std::nullopt); + JSON_Schema_Draft_4, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-04/schema#", - JSON_Schema_Draft_4, ""); + JSON_Schema_Draft_4, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "http://json-schema.org/draft-04/schema#", - JSON_Schema_Draft_4, ""); + JSON_Schema_Draft_4, "", false); EXPECT_EQ(frame.references().size(), 1); EXPECT_STATIC_REFERENCE( @@ -873,44 +890,46 @@ TEST(JSONSchema_frame_draft4, ref_invalidates_sibling_subschemas_and_refs) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-04/schema#", - JSON_Schema_Draft_4, std::nullopt); + JSON_Schema_Draft_4, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-04/schema#", - JSON_Schema_Draft_4, ""); + JSON_Schema_Draft_4, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties", "/properties", - "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, ""); + "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/properties/foo", "/properties/foo", - "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, ""); + "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/$ref", "/properties/foo/$ref", "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, - "/properties/foo"); + "/properties/foo", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/properties", "/properties/foo/properties", "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, - "/properties/foo"); + "/properties/foo", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/properties/bar", "/properties/foo/properties/bar", "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, - "/properties/foo"); + "/properties/foo", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/properties/bar/$ref", "/properties/foo/properties/bar/$ref", "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, - "/properties/foo"); + "/properties/foo", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/properties/bar/additionalProperties", "/properties/foo/properties/bar/additionalProperties", "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, - "/properties/foo"); + "/properties/foo", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/properties/bar/additionalProperties/$ref", "/properties/foo/properties/bar/additionalProperties/$ref", "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, - "/properties/foo"); + "/properties/foo", false); EXPECT_EQ(frame.references().size(), 2); @@ -940,16 +959,16 @@ TEST(JSONSchema_frame_draft4, top_level_relative_ref_with_id) { // Note that `id` is IGNORED given the sibling `$ref` EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-04/schema#", - JSON_Schema_Draft_4, std::nullopt); + JSON_Schema_Draft_4, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-04/schema#", - JSON_Schema_Draft_4, ""); + JSON_Schema_Draft_4, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/id", "/id", "http://json-schema.org/draft-04/schema#", - JSON_Schema_Draft_4, ""); + JSON_Schema_Draft_4, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "http://json-schema.org/draft-04/schema#", - JSON_Schema_Draft_4, ""); + JSON_Schema_Draft_4, "", false); EXPECT_EQ(frame.references().size(), 2); @@ -977,28 +996,28 @@ TEST(JSONSchema_frame_draft4, nested_relative_ref_with_id) { EXPECT_EQ(frame.locations().size(), 6); - EXPECT_FRAME_STATIC_DRAFT4_RESOURCE(frame, "https://example.com", - "https://example.com", "", - "https://example.com", "", std::nullopt); + EXPECT_FRAME_STATIC_DRAFT4_RESOURCE( + frame, "https://example.com", "https://example.com", "", + "https://example.com", "", std::nullopt, false); EXPECT_FRAME_STATIC_DRAFT4_POINTER(frame, "https://example.com#/id", "https://example.com", "/id", - "https://example.com", "/id", ""); - EXPECT_FRAME_STATIC_DRAFT4_POINTER(frame, "https://example.com#/$schema", - "https://example.com", "/$schema", - "https://example.com", "/$schema", ""); + "https://example.com", "/id", "", false); + EXPECT_FRAME_STATIC_DRAFT4_POINTER( + frame, "https://example.com#/$schema", "https://example.com", "/$schema", + "https://example.com", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT4_SUBSCHEMA( frame, "https://example.com#/additionalProperties", "https://example.com", "/additionalProperties", "https://example.com", "/additionalProperties", - ""); + "", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://example.com#/additionalProperties/id", "https://example.com", "/additionalProperties/id", "https://example.com", - "/additionalProperties/id", "/additionalProperties"); + "/additionalProperties/id", "/additionalProperties", false); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://example.com#/additionalProperties/$ref", "https://example.com", "/additionalProperties/$ref", "https://example.com", "/additionalProperties/$ref", - "/additionalProperties"); + "/additionalProperties", false); EXPECT_EQ(frame.references().size(), 2); diff --git a/test/jsonschema/jsonschema_frame_draft6_test.cc b/test/jsonschema/jsonschema_frame_draft6_test.cc index 9e1a9a1c4..5bac528b7 100644 --- a/test/jsonschema/jsonschema_frame_draft6_test.cc +++ b/test/jsonschema/jsonschema_frame_draft6_test.cc @@ -8,35 +8,39 @@ #define EXPECT_FRAME_STATIC_DRAFT6_POINTER( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_POINTER(frame, reference, root_id, expected_pointer, \ "http://json-schema.org/draft-06/schema#", \ JSON_Schema_Draft_6, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); #define EXPECT_FRAME_STATIC_DRAFT6_RESOURCE( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_RESOURCE(frame, reference, root_id, expected_pointer, \ "http://json-schema.org/draft-06/schema#", \ JSON_Schema_Draft_6, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); #define EXPECT_FRAME_STATIC_DRAFT6_ANCHOR( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_ANCHOR(frame, reference, root_id, expected_pointer, \ "http://json-schema.org/draft-06/schema#", \ JSON_Schema_Draft_6, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); #define EXPECT_FRAME_STATIC_DRAFT6_SUBSCHEMA( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_SUBSCHEMA(frame, reference, root_id, expected_pointer, \ "http://json-schema.org/draft-06/schema#", \ JSON_Schema_Draft_6, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); TEST(JSONSchema_frame_draft6, anonymous_with_nested_schema_resource) { const sourcemeta::core::JSON document = sourcemeta::core::parse_json(R"JSON({ @@ -53,27 +57,29 @@ TEST(JSONSchema_frame_draft6, anonymous_with_nested_schema_resource) { EXPECT_ANONYMOUS_FRAME_STATIC_RESOURCE( frame, "https://example.com", "/additionalProperties", - "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, ""); + "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/$id", "/additionalProperties/$id", "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, - "/additionalProperties"); + "/additionalProperties", false); // JSON Pointers EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-06/schema#", - JSON_Schema_Draft_6, std::nullopt); + JSON_Schema_Draft_6, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-06/schema#", - JSON_Schema_Draft_6, ""); + JSON_Schema_Draft_6, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalProperties", "/additionalProperties", - "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, ""); + "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalProperties/$id", "/additionalProperties/$id", "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, - "/additionalProperties"); + "/additionalProperties", false); // References @@ -100,18 +106,18 @@ TEST(JSONSchema_frame_draft6, empty_schema) { EXPECT_FRAME_STATIC_DRAFT6_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); // References @@ -138,18 +144,18 @@ TEST(JSONSchema_frame_draft6, empty_schema_trailing_hash) { EXPECT_FRAME_STATIC_DRAFT6_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); // References @@ -180,39 +186,39 @@ TEST(JSONSchema_frame_draft6, one_level_applicators_without_identifiers) { EXPECT_FRAME_STATIC_DRAFT6_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT6_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", - "https://www.sourcemeta.com/schema", "/items", ""); + "https://www.sourcemeta.com/schema", "/items", "", false); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/items/type", "https://www.sourcemeta.com/schema", "/items/type", - "https://www.sourcemeta.com/schema", "/items/type", "/items"); + "https://www.sourcemeta.com/schema", "/items/type", "/items", false); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", ""); + "https://www.sourcemeta.com/schema", "/properties", "", false); EXPECT_FRAME_STATIC_DRAFT6_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", - "https://www.sourcemeta.com/schema", "/properties/foo", ""); + "https://www.sourcemeta.com/schema", "/properties/foo", "", false); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/foo/type", "https://www.sourcemeta.com/schema", "/properties/foo/type", "https://www.sourcemeta.com/schema", "/properties/foo/type", - "/properties/foo"); + "/properties/foo", false); // References @@ -240,42 +246,42 @@ TEST(JSONSchema_frame_draft6, one_level_applicators_with_identifiers) { EXPECT_FRAME_STATIC_DRAFT6_RESOURCE( frame, "https://www.sourcemeta.com/test/qux", "https://www.sourcemeta.com/test/qux", "", - "https://www.sourcemeta.com/test/qux", "", std::nullopt); - EXPECT_FRAME_STATIC_DRAFT6_RESOURCE(frame, "https://www.sourcemeta.com/foo", - "https://www.sourcemeta.com/test/qux", - "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/test/qux", "", std::nullopt, false); + EXPECT_FRAME_STATIC_DRAFT6_RESOURCE( + frame, "https://www.sourcemeta.com/foo", + "https://www.sourcemeta.com/test/qux", "/items", + "https://www.sourcemeta.com/foo", "", "", false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/test/qux#/$id", "https://www.sourcemeta.com/test/qux", "/$id", - "https://www.sourcemeta.com/test/qux", "/$id", ""); + "https://www.sourcemeta.com/test/qux", "/$id", "", false); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/test/qux#/$schema", "https://www.sourcemeta.com/test/qux", "/$schema", - "https://www.sourcemeta.com/test/qux", "/$schema", ""); + "https://www.sourcemeta.com/test/qux", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT6_SUBSCHEMA( frame, "https://www.sourcemeta.com/test/qux#/items", "https://www.sourcemeta.com/test/qux", "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/test/qux#/items/$id", "https://www.sourcemeta.com/test/qux", "/items/$id", - "https://www.sourcemeta.com/foo", "/$id", "/items"); + "https://www.sourcemeta.com/foo", "/$id", "/items", false); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/test/qux#/items/type", "https://www.sourcemeta.com/test/qux", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/foo#/$id", "https://www.sourcemeta.com/test/qux", "/items/$id", - "https://www.sourcemeta.com/foo", "/$id", "/items"); + "https://www.sourcemeta.com/foo", "/$id", "/items", false); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/foo#/type", "https://www.sourcemeta.com/test/qux", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); // References @@ -306,42 +312,42 @@ TEST(JSONSchema_frame_draft6, subschema_absolute_identifier) { EXPECT_FRAME_STATIC_DRAFT6_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); - EXPECT_FRAME_STATIC_DRAFT6_RESOURCE(frame, "https://www.sourcemeta.com/foo", - "https://www.sourcemeta.com/schema", - "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); + EXPECT_FRAME_STATIC_DRAFT6_RESOURCE( + frame, "https://www.sourcemeta.com/foo", + "https://www.sourcemeta.com/schema", "/items", + "https://www.sourcemeta.com/foo", "", "", false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT6_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/items/$id", "https://www.sourcemeta.com/schema", "/items/$id", - "https://www.sourcemeta.com/foo", "/$id", "/items"); + "https://www.sourcemeta.com/foo", "/$id", "/items", false); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/items/type", "https://www.sourcemeta.com/schema", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/foo#/$id", "https://www.sourcemeta.com/schema", "/items/$id", - "https://www.sourcemeta.com/foo", "/$id", "/items"); + "https://www.sourcemeta.com/foo", "/$id", "/items", false); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/foo#/type", "https://www.sourcemeta.com/schema", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); // References @@ -384,18 +390,18 @@ TEST(JSONSchema_frame_draft6, explicit_argument_id_same) { EXPECT_FRAME_STATIC_DRAFT6_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); // References @@ -433,59 +439,60 @@ TEST(JSONSchema_frame_draft6, explicit_argument_id_different) { EXPECT_FRAME_STATIC_DRAFT6_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_STATIC_DRAFT6_RESOURCE( frame, "https://www.sourcemeta.com/test", "https://www.sourcemeta.com/schema", "/properties/one", - "https://www.sourcemeta.com/test", "", ""); + "https://www.sourcemeta.com/test", "", "", false); EXPECT_FRAME_STATIC_DRAFT6_RESOURCE( frame, "https://www.example.com", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); - EXPECT_FRAME_STATIC_DRAFT6_RESOURCE(frame, "https://www.example.com/test", - "https://www.sourcemeta.com/schema", - "/properties/one", - "https://www.example.com/test", "", ""); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); + EXPECT_FRAME_STATIC_DRAFT6_RESOURCE( + frame, "https://www.example.com/test", + "https://www.sourcemeta.com/schema", "/properties/one", + "https://www.example.com/test", "", "", false); EXPECT_FRAME_STATIC_DRAFT6_RESOURCE( frame, "https://www.test.com", "https://www.sourcemeta.com/schema", - "/properties/two", "https://www.test.com", "", ""); + "/properties/two", "https://www.test.com", "", "", false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", ""); + "https://www.sourcemeta.com/schema", "/properties", "", false); EXPECT_FRAME_STATIC_DRAFT6_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/one", "https://www.sourcemeta.com/schema", "/properties/one", - "https://www.sourcemeta.com/test", "", ""); + "https://www.sourcemeta.com/test", "", "", false); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/one/$id", "https://www.sourcemeta.com/schema", "/properties/one/$id", - "https://www.sourcemeta.com/test", "/$id", "/properties/one"); + "https://www.sourcemeta.com/test", "/$id", "/properties/one", false); EXPECT_FRAME_STATIC_DRAFT6_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/two", "https://www.sourcemeta.com/schema", "/properties/two", - "https://www.test.com", "", ""); + "https://www.test.com", "", "", false); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/two/$id", "https://www.sourcemeta.com/schema", "/properties/two/$id", - "https://www.test.com", "/$id", "/properties/two"); + "https://www.test.com", "/$id", "/properties/two", false); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/test#/$id", "https://www.sourcemeta.com/schema", "/properties/one/$id", - "https://www.sourcemeta.com/test", "/$id", "/properties/one"); + "https://www.sourcemeta.com/test", "/$id", "/properties/one", false); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.test.com#/$id", "https://www.sourcemeta.com/schema", - "/properties/two/$id", "https://www.test.com", "/$id", "/properties/two"); + "/properties/two/$id", "https://www.test.com", "/$id", "/properties/two", + false); // References @@ -512,13 +519,13 @@ TEST(JSONSchema_frame_draft6, ref_metaschema) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-06/schema#", - JSON_Schema_Draft_6, std::nullopt); + JSON_Schema_Draft_6, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-06/schema#", - JSON_Schema_Draft_6, ""); + JSON_Schema_Draft_6, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "http://json-schema.org/draft-06/schema#", - JSON_Schema_Draft_6, ""); + JSON_Schema_Draft_6, "", false); // References @@ -557,36 +564,40 @@ TEST(JSONSchema_frame_draft6, location_independent_identifier_anonymous) { // Pointers EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-06/schema#", - JSON_Schema_Draft_6, std::nullopt); + JSON_Schema_Draft_6, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-06/schema#", - JSON_Schema_Draft_6, ""); + JSON_Schema_Draft_6, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions", "/definitions", - "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, ""); + "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, "", + false); // Foo EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/definitions/foo", "/definitions/foo", - "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, ""); + "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions/foo/$id", "/definitions/foo/$id", "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, - "/definitions/foo"); + "/definitions/foo", false); // Bar EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/definitions/bar", "/definitions/bar", - "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, ""); + "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions/bar/$ref", "/definitions/bar/$ref", "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, - "/definitions/bar"); + "/definitions/bar", false); // Anchors EXPECT_ANONYMOUS_FRAME_STATIC_ANCHOR( frame, "#foo", "/definitions/foo", - "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, ""); + "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, "", + false); // References @@ -625,26 +636,29 @@ TEST(JSONSchema_frame_draft6, ref_with_id) { // so we do know about the dialect anyway EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-06/schema#", - JSON_Schema_Draft_6, std::nullopt); + JSON_Schema_Draft_6, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$id", "/$id", "http://json-schema.org/draft-06/schema#", - JSON_Schema_Draft_6, ""); + JSON_Schema_Draft_6, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-06/schema#", - JSON_Schema_Draft_6, ""); + JSON_Schema_Draft_6, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "http://json-schema.org/draft-06/schema#", - JSON_Schema_Draft_6, ""); + JSON_Schema_Draft_6, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions", "/definitions", - "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, ""); + "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions/string", "/definitions/string", - "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, ""); + "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions/string/type", "/definitions/string/type", - "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, ""); + "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, "", + false); // References @@ -672,14 +686,15 @@ TEST(JSONSchema_frame_draft6, relative_base_uri_without_ref) { EXPECT_EQ(frame.locations().size(), 3); EXPECT_FRAME_STATIC_DRAFT6_RESOURCE(frame, "common", "common", "", "common", - "", std::nullopt); + "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT6_POINTER(frame, "common#/$schema", "common", - "/$schema", "common", "/$schema", ""); + "/$schema", "common", "/$schema", "", + false); EXPECT_FRAME_STATIC_DRAFT6_POINTER(frame, "common#/$id", "common", "/$id", - "common", "/$id", ""); + "common", "/$id", "", false); // References @@ -711,35 +726,37 @@ TEST(JSONSchema_frame_draft6, relative_base_uri_with_ref) { EXPECT_EQ(frame.locations().size(), 10); EXPECT_FRAME_STATIC_DRAFT6_RESOURCE(frame, "common", "common", "", "common", - "", std::nullopt); + "", std::nullopt, false); // Anchors EXPECT_FRAME_STATIC_DRAFT6_ANCHOR(frame, "common#foo", "common", "/definitions/foo", "common", - "/definitions/foo", ""); + "/definitions/foo", "", false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT6_POINTER(frame, "common#/$schema", "common", - "/$schema", "common", "/$schema", ""); + "/$schema", "common", "/$schema", "", + false); EXPECT_FRAME_STATIC_DRAFT6_POINTER(frame, "common#/$id", "common", "/$id", - "common", "/$id", ""); + "common", "/$id", "", false); EXPECT_FRAME_STATIC_DRAFT6_POINTER(frame, "common#/allOf", "common", "/allOf", - "common", "/allOf", ""); + "common", "/allOf", "", false); EXPECT_FRAME_STATIC_DRAFT6_SUBSCHEMA(frame, "common#/allOf/0", "common", - "/allOf/0", "common", "/allOf/0", ""); + "/allOf/0", "common", "/allOf/0", "", + false); EXPECT_FRAME_STATIC_DRAFT6_POINTER(frame, "common#/allOf/0/$ref", "common", "/allOf/0/$ref", "common", "/allOf/0/$ref", - "/allOf/0"); + "/allOf/0", false); EXPECT_FRAME_STATIC_DRAFT6_POINTER(frame, "common#/definitions", "common", "/definitions", "common", "/definitions", - ""); + "", false); EXPECT_FRAME_STATIC_DRAFT6_SUBSCHEMA(frame, "common#/definitions/foo", "common", "/definitions/foo", "common", - "/definitions/foo", ""); + "/definitions/foo", "", false); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "common#/definitions/foo/$id", "common", "/definitions/foo/$id", - "common", "/definitions/foo/$id", "/definitions/foo"); + "common", "/definitions/foo/$id", "/definitions/foo", false); // References @@ -780,44 +797,46 @@ TEST(JSONSchema_frame_draft6, ref_invalidates_sibling_subschemas_and_refs) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-06/schema#", - JSON_Schema_Draft_6, std::nullopt); + JSON_Schema_Draft_6, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-06/schema#", - JSON_Schema_Draft_6, ""); + JSON_Schema_Draft_6, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties", "/properties", - "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, ""); + "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/properties/foo", "/properties/foo", - "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, ""); + "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/$ref", "/properties/foo/$ref", "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, - "/properties/foo"); + "/properties/foo", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/properties", "/properties/foo/properties", "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, - "/properties/foo"); + "/properties/foo", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/properties/bar", "/properties/foo/properties/bar", "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, - "/properties/foo"); + "/properties/foo", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/properties/bar/$ref", "/properties/foo/properties/bar/$ref", "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, - "/properties/foo"); + "/properties/foo", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/properties/bar/additionalProperties", "/properties/foo/properties/bar/additionalProperties", "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, - "/properties/foo"); + "/properties/foo", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/properties/bar/additionalProperties/$ref", "/properties/foo/properties/bar/additionalProperties/$ref", "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, - "/properties/foo"); + "/properties/foo", false); EXPECT_EQ(frame.references().size(), 2); @@ -847,16 +866,16 @@ TEST(JSONSchema_frame_draft6, top_level_relative_ref_with_id) { // Note that `$id` is IGNORED given the sibling `$ref` EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-06/schema#", - JSON_Schema_Draft_6, std::nullopt); + JSON_Schema_Draft_6, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-06/schema#", - JSON_Schema_Draft_6, ""); + JSON_Schema_Draft_6, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$id", "/$id", "http://json-schema.org/draft-06/schema#", - JSON_Schema_Draft_6, ""); + JSON_Schema_Draft_6, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "http://json-schema.org/draft-06/schema#", - JSON_Schema_Draft_6, ""); + JSON_Schema_Draft_6, "", false); EXPECT_EQ(frame.references().size(), 2); @@ -884,28 +903,28 @@ TEST(JSONSchema_frame_draft6, nested_relative_ref_with_id) { EXPECT_EQ(frame.locations().size(), 6); - EXPECT_FRAME_STATIC_DRAFT6_RESOURCE(frame, "https://example.com", - "https://example.com", "", - "https://example.com", "", std::nullopt); + EXPECT_FRAME_STATIC_DRAFT6_RESOURCE( + frame, "https://example.com", "https://example.com", "", + "https://example.com", "", std::nullopt, false); EXPECT_FRAME_STATIC_DRAFT6_POINTER(frame, "https://example.com#/$id", "https://example.com", "/$id", - "https://example.com", "/$id", ""); - EXPECT_FRAME_STATIC_DRAFT6_POINTER(frame, "https://example.com#/$schema", - "https://example.com", "/$schema", - "https://example.com", "/$schema", ""); + "https://example.com", "/$id", "", false); + EXPECT_FRAME_STATIC_DRAFT6_POINTER( + frame, "https://example.com#/$schema", "https://example.com", "/$schema", + "https://example.com", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT6_SUBSCHEMA( frame, "https://example.com#/additionalProperties", "https://example.com", "/additionalProperties", "https://example.com", "/additionalProperties", - ""); + "", false); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://example.com#/additionalProperties/$id", "https://example.com", "/additionalProperties/$id", "https://example.com", - "/additionalProperties/$id", "/additionalProperties"); + "/additionalProperties/$id", "/additionalProperties", false); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://example.com#/additionalProperties/$ref", "https://example.com", "/additionalProperties/$ref", "https://example.com", "/additionalProperties/$ref", - "/additionalProperties"); + "/additionalProperties", false); EXPECT_EQ(frame.references().size(), 2); @@ -917,3 +936,98 @@ TEST(JSONSchema_frame_draft6, nested_relative_ref_with_id) { "https://example.com/bar", "https://example.com/bar", std::nullopt, "bar"); } + +TEST(JSONSchema_frame_draft6, propertyNames_with_nested_applicators) { + const sourcemeta::core::JSON document = sourcemeta::core::parse_json(R"JSON({ + "$schema": "http://json-schema.org/draft-06/schema#", + "propertyNames": { + "anyOf": [ + { "minLength": 1 }, + { "maxLength": 10 } + ], + "additionalProperties": { + "type": "boolean" + }, + "definitions": { + "test": { + "type": "string" + } + } + } + })JSON"); + + sourcemeta::core::SchemaFrame frame{ + sourcemeta::core::SchemaFrame::Mode::References}; + frame.analyse(document, sourcemeta::core::schema_walker, + sourcemeta::core::schema_resolver); + + EXPECT_EQ(frame.locations().size(), 13); + + EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( + frame, "", "", "http://json-schema.org/draft-06/schema#", + JSON_Schema_Draft_6, std::nullopt, false); + EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( + frame, "#/propertyNames", "/propertyNames", + "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, "", true); + EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( + frame, "#/propertyNames/anyOf/0", "/propertyNames/anyOf/0", + "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, + "/propertyNames", true); + EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( + frame, "#/propertyNames/anyOf/1", "/propertyNames/anyOf/1", + "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, + "/propertyNames", true); + EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( + frame, "#/propertyNames/additionalProperties", + "/propertyNames/additionalProperties", + "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, + "/propertyNames", false); + EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( + frame, "#/propertyNames/definitions/test", + "/propertyNames/definitions/test", + "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, + "/propertyNames", false); + + // JSON Pointers + + EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( + frame, "#/$schema", "/$schema", "http://json-schema.org/draft-06/schema#", + JSON_Schema_Draft_6, "", false); + EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( + frame, "#/propertyNames/anyOf", "/propertyNames/anyOf", + "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, + "/propertyNames", true); + EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( + frame, "#/propertyNames/anyOf/0/minLength", + "/propertyNames/anyOf/0/minLength", + "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, + "/propertyNames/anyOf/0", true); + EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( + frame, "#/propertyNames/anyOf/1/maxLength", + "/propertyNames/anyOf/1/maxLength", + "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, + "/propertyNames/anyOf/1", true); + EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( + frame, "#/propertyNames/additionalProperties/type", + "/propertyNames/additionalProperties/type", + "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, + "/propertyNames/additionalProperties", false); + EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( + frame, "#/propertyNames/definitions", "/propertyNames/definitions", + "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, + "/propertyNames", true); + EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( + frame, "#/propertyNames/definitions/test/type", + "/propertyNames/definitions/test/type", + "http://json-schema.org/draft-06/schema#", JSON_Schema_Draft_6, + "/propertyNames/definitions/test", false); + + // References + + EXPECT_EQ(frame.references().size(), 1); + + EXPECT_STATIC_REFERENCE( + frame, "/$schema", "http://json-schema.org/draft-06/schema", + "http://json-schema.org/draft-06/schema", std::nullopt, + "http://json-schema.org/draft-06/schema#"); +} diff --git a/test/jsonschema/jsonschema_frame_draft7_test.cc b/test/jsonschema/jsonschema_frame_draft7_test.cc index d5e64e94f..a1a40ef89 100644 --- a/test/jsonschema/jsonschema_frame_draft7_test.cc +++ b/test/jsonschema/jsonschema_frame_draft7_test.cc @@ -8,35 +8,39 @@ #define EXPECT_FRAME_STATIC_DRAFT7_POINTER( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_POINTER(frame, reference, root_id, expected_pointer, \ "http://json-schema.org/draft-07/schema#", \ JSON_Schema_Draft_7, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); #define EXPECT_FRAME_STATIC_DRAFT7_RESOURCE( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_RESOURCE(frame, reference, root_id, expected_pointer, \ "http://json-schema.org/draft-07/schema#", \ JSON_Schema_Draft_7, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); #define EXPECT_FRAME_STATIC_DRAFT7_ANCHOR( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_ANCHOR(frame, reference, root_id, expected_pointer, \ "http://json-schema.org/draft-07/schema#", \ JSON_Schema_Draft_7, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); #define EXPECT_FRAME_STATIC_DRAFT7_SUBSCHEMA( \ frame, reference, root_id, expected_pointer, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC_SUBSCHEMA(frame, reference, root_id, expected_pointer, \ "http://json-schema.org/draft-07/schema#", \ JSON_Schema_Draft_7, expected_base, \ - expected_relative_pointer, expected_parent); + expected_relative_pointer, expected_parent, \ + expected_property_name); TEST(JSONSchema_frame_draft7, anonymous_with_nested_schema_resource) { const sourcemeta::core::JSON document = sourcemeta::core::parse_json(R"JSON({ @@ -53,27 +57,29 @@ TEST(JSONSchema_frame_draft7, anonymous_with_nested_schema_resource) { EXPECT_ANONYMOUS_FRAME_STATIC_RESOURCE( frame, "https://example.com", "/additionalProperties", - "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, ""); + "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, "", + false); // JSON Pointers EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/$id", "/additionalProperties/$id", "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, - "/additionalProperties"); + "/additionalProperties", false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-07/schema#", - JSON_Schema_Draft_7, std::nullopt); + JSON_Schema_Draft_7, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-07/schema#", - JSON_Schema_Draft_7, ""); + JSON_Schema_Draft_7, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalProperties", "/additionalProperties", - "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, ""); + "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalProperties/$id", "/additionalProperties/$id", "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, - "/additionalProperties"); + "/additionalProperties", false); // References @@ -100,18 +106,18 @@ TEST(JSONSchema_frame_draft7, empty_schema) { EXPECT_FRAME_STATIC_DRAFT7_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); // References @@ -138,18 +144,18 @@ TEST(JSONSchema_frame_draft7, empty_schema_trailing_hash) { EXPECT_FRAME_STATIC_DRAFT7_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); // References @@ -180,39 +186,39 @@ TEST(JSONSchema_frame_draft7, one_level_applicators_without_identifiers) { EXPECT_FRAME_STATIC_DRAFT7_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT7_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", - "https://www.sourcemeta.com/schema", "/items", ""); + "https://www.sourcemeta.com/schema", "/items", "", false); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/items/type", "https://www.sourcemeta.com/schema", "/items/type", - "https://www.sourcemeta.com/schema", "/items/type", "/items"); + "https://www.sourcemeta.com/schema", "/items/type", "/items", false); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", ""); + "https://www.sourcemeta.com/schema", "/properties", "", false); EXPECT_FRAME_STATIC_DRAFT7_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", - "https://www.sourcemeta.com/schema", "/properties/foo", ""); + "https://www.sourcemeta.com/schema", "/properties/foo", "", false); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/foo/type", "https://www.sourcemeta.com/schema", "/properties/foo/type", "https://www.sourcemeta.com/schema", "/properties/foo/type", - "/properties/foo"); + "/properties/foo", false); // References @@ -240,42 +246,42 @@ TEST(JSONSchema_frame_draft7, one_level_applicators_with_identifiers) { EXPECT_FRAME_STATIC_DRAFT7_RESOURCE( frame, "https://www.sourcemeta.com/test/qux", "https://www.sourcemeta.com/test/qux", "", - "https://www.sourcemeta.com/test/qux", "", std::nullopt); - EXPECT_FRAME_STATIC_DRAFT7_RESOURCE(frame, "https://www.sourcemeta.com/foo", - "https://www.sourcemeta.com/test/qux", - "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/test/qux", "", std::nullopt, false); + EXPECT_FRAME_STATIC_DRAFT7_RESOURCE( + frame, "https://www.sourcemeta.com/foo", + "https://www.sourcemeta.com/test/qux", "/items", + "https://www.sourcemeta.com/foo", "", "", false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/test/qux#/$id", "https://www.sourcemeta.com/test/qux", "/$id", - "https://www.sourcemeta.com/test/qux", "/$id", ""); + "https://www.sourcemeta.com/test/qux", "/$id", "", false); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/test/qux#/$schema", "https://www.sourcemeta.com/test/qux", "/$schema", - "https://www.sourcemeta.com/test/qux", "/$schema", ""); + "https://www.sourcemeta.com/test/qux", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT7_SUBSCHEMA( frame, "https://www.sourcemeta.com/test/qux#/items", "https://www.sourcemeta.com/test/qux", "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/test/qux#/items/$id", "https://www.sourcemeta.com/test/qux", "/items/$id", - "https://www.sourcemeta.com/foo", "/$id", "/items"); + "https://www.sourcemeta.com/foo", "/$id", "/items", false); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/test/qux#/items/type", "https://www.sourcemeta.com/test/qux", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/foo#/$id", "https://www.sourcemeta.com/test/qux", "/items/$id", - "https://www.sourcemeta.com/foo", "/$id", "/items"); + "https://www.sourcemeta.com/foo", "/$id", "/items", false); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/foo#/type", "https://www.sourcemeta.com/test/qux", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); // References @@ -306,42 +312,42 @@ TEST(JSONSchema_frame_draft7, subschema_absolute_identifier) { EXPECT_FRAME_STATIC_DRAFT7_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); - EXPECT_FRAME_STATIC_DRAFT7_RESOURCE(frame, "https://www.sourcemeta.com/foo", - "https://www.sourcemeta.com/schema", - "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); + EXPECT_FRAME_STATIC_DRAFT7_RESOURCE( + frame, "https://www.sourcemeta.com/foo", + "https://www.sourcemeta.com/schema", "/items", + "https://www.sourcemeta.com/foo", "", "", false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT7_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/items/$id", "https://www.sourcemeta.com/schema", "/items/$id", - "https://www.sourcemeta.com/foo", "/$id", "/items"); + "https://www.sourcemeta.com/foo", "/$id", "/items", false); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/items/type", "https://www.sourcemeta.com/schema", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/foo#/$id", "https://www.sourcemeta.com/schema", "/items/$id", - "https://www.sourcemeta.com/foo", "/$id", "/items"); + "https://www.sourcemeta.com/foo", "/$id", "/items", false); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/foo#/type", "https://www.sourcemeta.com/schema", "/items/type", - "https://www.sourcemeta.com/foo", "/type", "/items"); + "https://www.sourcemeta.com/foo", "/type", "/items", false); // References @@ -384,18 +390,18 @@ TEST(JSONSchema_frame_draft7, explicit_argument_id_same) { EXPECT_FRAME_STATIC_DRAFT7_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); // References @@ -433,59 +439,60 @@ TEST(JSONSchema_frame_draft7, explicit_argument_id_different) { EXPECT_FRAME_STATIC_DRAFT7_RESOURCE( frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_STATIC_DRAFT7_RESOURCE( frame, "https://www.sourcemeta.com/test", "https://www.sourcemeta.com/schema", "/properties/one", - "https://www.sourcemeta.com/test", "", ""); + "https://www.sourcemeta.com/test", "", "", false); EXPECT_FRAME_STATIC_DRAFT7_RESOURCE( frame, "https://www.example.com", "https://www.sourcemeta.com/schema", "", - "https://www.sourcemeta.com/schema", "", std::nullopt); - EXPECT_FRAME_STATIC_DRAFT7_RESOURCE(frame, "https://www.example.com/test", - "https://www.sourcemeta.com/schema", - "/properties/one", - "https://www.example.com/test", "", ""); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); + EXPECT_FRAME_STATIC_DRAFT7_RESOURCE( + frame, "https://www.example.com/test", + "https://www.sourcemeta.com/schema", "/properties/one", + "https://www.example.com/test", "", "", false); EXPECT_FRAME_STATIC_DRAFT7_RESOURCE( frame, "https://www.test.com", "https://www.sourcemeta.com/schema", - "/properties/two", "https://www.test.com", "", ""); + "/properties/two", "https://www.test.com", "", "", false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", ""); + "https://www.sourcemeta.com/schema", "/$id", "", false); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", ""); + "https://www.sourcemeta.com/schema", "/properties", "", false); EXPECT_FRAME_STATIC_DRAFT7_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/one", "https://www.sourcemeta.com/schema", "/properties/one", - "https://www.sourcemeta.com/test", "", ""); + "https://www.sourcemeta.com/test", "", "", false); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/one/$id", "https://www.sourcemeta.com/schema", "/properties/one/$id", - "https://www.sourcemeta.com/test", "/$id", "/properties/one"); + "https://www.sourcemeta.com/test", "/$id", "/properties/one", false); EXPECT_FRAME_STATIC_DRAFT7_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/two", "https://www.sourcemeta.com/schema", "/properties/two", - "https://www.test.com", "", ""); + "https://www.test.com", "", "", false); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/two/$id", "https://www.sourcemeta.com/schema", "/properties/two/$id", - "https://www.test.com", "/$id", "/properties/two"); + "https://www.test.com", "/$id", "/properties/two", false); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/test#/$id", "https://www.sourcemeta.com/schema", "/properties/one/$id", - "https://www.sourcemeta.com/test", "/$id", "/properties/one"); + "https://www.sourcemeta.com/test", "/$id", "/properties/one", false); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.test.com#/$id", "https://www.sourcemeta.com/schema", - "/properties/two/$id", "https://www.test.com", "/$id", "/properties/two"); + "/properties/two/$id", "https://www.test.com", "/$id", "/properties/two", + false); // References @@ -512,13 +519,13 @@ TEST(JSONSchema_frame_draft7, ref_metaschema) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-07/schema#", - JSON_Schema_Draft_7, std::nullopt); + JSON_Schema_Draft_7, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-07/schema#", - JSON_Schema_Draft_7, ""); + JSON_Schema_Draft_7, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "http://json-schema.org/draft-07/schema#", - JSON_Schema_Draft_7, ""); + JSON_Schema_Draft_7, "", false); // References @@ -557,36 +564,40 @@ TEST(JSONSchema_frame_draft7, location_independent_identifier_anonymous) { // Pointers EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-07/schema#", - JSON_Schema_Draft_7, std::nullopt); + JSON_Schema_Draft_7, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-07/schema#", - JSON_Schema_Draft_7, ""); + JSON_Schema_Draft_7, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions", "/definitions", - "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, ""); + "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, "", + false); // Foo EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/definitions/foo", "/definitions/foo", - "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, ""); + "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions/foo/$id", "/definitions/foo/$id", "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, - "/definitions/foo"); + "/definitions/foo", false); // Bar EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/definitions/bar", "/definitions/bar", - "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, ""); + "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions/bar/$ref", "/definitions/bar/$ref", "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, - "/definitions/bar"); + "/definitions/bar", false); // Anchors EXPECT_ANONYMOUS_FRAME_STATIC_ANCHOR( frame, "#foo", "/definitions/foo", - "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, ""); + "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, "", + false); // References @@ -625,26 +636,29 @@ TEST(JSONSchema_frame_draft7, ref_with_id) { // so we do know about the dialect anyway EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-07/schema#", - JSON_Schema_Draft_7, std::nullopt); + JSON_Schema_Draft_7, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$id", "/$id", "http://json-schema.org/draft-07/schema#", - JSON_Schema_Draft_7, ""); + JSON_Schema_Draft_7, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-07/schema#", - JSON_Schema_Draft_7, ""); + JSON_Schema_Draft_7, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "http://json-schema.org/draft-07/schema#", - JSON_Schema_Draft_7, ""); + JSON_Schema_Draft_7, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions", "/definitions", - "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, ""); + "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions/string", "/definitions/string", - "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, ""); + "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions/string/type", "/definitions/string/type", - "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, ""); + "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, "", + false); // References @@ -678,25 +692,28 @@ TEST(JSONSchema_frame_draft7, ref_with_definitions) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-07/schema#", - JSON_Schema_Draft_7, std::nullopt); + JSON_Schema_Draft_7, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-07/schema#", - JSON_Schema_Draft_7, ""); + JSON_Schema_Draft_7, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "http://json-schema.org/draft-07/schema#", - JSON_Schema_Draft_7, ""); + JSON_Schema_Draft_7, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions", "/definitions", - "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, ""); + "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, "", + false); // Note that this is NOT considered to be a subschema, as `$ref` overrides it EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions/string", "/definitions/string", - "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, ""); + "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions/string/type", "/definitions/string/type", - "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, ""); + "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, "", + false); // References @@ -730,22 +747,25 @@ TEST(JSONSchema_frame_draft7, ref_with_properties) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-07/schema#", - JSON_Schema_Draft_7, std::nullopt); + JSON_Schema_Draft_7, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-07/schema#", - JSON_Schema_Draft_7, ""); + JSON_Schema_Draft_7, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "http://json-schema.org/draft-07/schema#", - JSON_Schema_Draft_7, ""); + JSON_Schema_Draft_7, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties", "/properties", - "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, ""); + "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/string", "/properties/string", - "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, ""); + "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/string/type", "/properties/string/type", - "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, ""); + "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, "", + false); // References @@ -773,14 +793,15 @@ TEST(JSONSchema_frame_draft7, relative_base_uri_without_ref) { EXPECT_EQ(frame.locations().size(), 3); EXPECT_FRAME_STATIC_DRAFT7_RESOURCE(frame, "common", "common", "", "common", - "", std::nullopt); + "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT7_POINTER(frame, "common#/$schema", "common", - "/$schema", "common", "/$schema", ""); + "/$schema", "common", "/$schema", "", + false); EXPECT_FRAME_STATIC_DRAFT7_POINTER(frame, "common#/$id", "common", "/$id", - "common", "/$id", ""); + "common", "/$id", "", false); // References @@ -812,35 +833,37 @@ TEST(JSONSchema_frame_draft7, relative_base_uri_with_ref) { EXPECT_EQ(frame.locations().size(), 10); EXPECT_FRAME_STATIC_DRAFT7_RESOURCE(frame, "common", "common", "", "common", - "", std::nullopt); + "", std::nullopt, false); // Anchors EXPECT_FRAME_STATIC_DRAFT7_ANCHOR(frame, "common#foo", "common", "/definitions/foo", "common", - "/definitions/foo", ""); + "/definitions/foo", "", false); // JSON Pointers EXPECT_FRAME_STATIC_DRAFT7_POINTER(frame, "common#/$schema", "common", - "/$schema", "common", "/$schema", ""); + "/$schema", "common", "/$schema", "", + false); EXPECT_FRAME_STATIC_DRAFT7_POINTER(frame, "common#/$id", "common", "/$id", - "common", "/$id", ""); + "common", "/$id", "", false); EXPECT_FRAME_STATIC_DRAFT7_POINTER(frame, "common#/allOf", "common", "/allOf", - "common", "/allOf", ""); + "common", "/allOf", "", false); EXPECT_FRAME_STATIC_DRAFT7_SUBSCHEMA(frame, "common#/allOf/0", "common", - "/allOf/0", "common", "/allOf/0", ""); + "/allOf/0", "common", "/allOf/0", "", + false); EXPECT_FRAME_STATIC_DRAFT7_POINTER(frame, "common#/allOf/0/$ref", "common", "/allOf/0/$ref", "common", "/allOf/0/$ref", - "/allOf/0"); + "/allOf/0", false); EXPECT_FRAME_STATIC_DRAFT7_POINTER(frame, "common#/definitions", "common", "/definitions", "common", "/definitions", - ""); + "", false); EXPECT_FRAME_STATIC_DRAFT7_SUBSCHEMA(frame, "common#/definitions/foo", "common", "/definitions/foo", "common", - "/definitions/foo", ""); + "/definitions/foo", "", false); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "common#/definitions/foo/$id", "common", "/definitions/foo/$id", - "common", "/definitions/foo/$id", "/definitions/foo"); + "common", "/definitions/foo/$id", "/definitions/foo", false); // References @@ -881,44 +904,46 @@ TEST(JSONSchema_frame_draft7, ref_invalidates_sibling_subschemas_and_refs) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-07/schema#", - JSON_Schema_Draft_7, std::nullopt); + JSON_Schema_Draft_7, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-07/schema#", - JSON_Schema_Draft_7, ""); + JSON_Schema_Draft_7, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties", "/properties", - "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, ""); + "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/properties/foo", "/properties/foo", - "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, ""); + "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/$ref", "/properties/foo/$ref", "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, - "/properties/foo"); + "/properties/foo", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/properties", "/properties/foo/properties", "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, - "/properties/foo"); + "/properties/foo", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/properties/bar", "/properties/foo/properties/bar", "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, - "/properties/foo"); + "/properties/foo", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/properties/bar/$ref", "/properties/foo/properties/bar/$ref", "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, - "/properties/foo"); + "/properties/foo", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/properties/bar/additionalProperties", "/properties/foo/properties/bar/additionalProperties", "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, - "/properties/foo"); + "/properties/foo", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/properties/bar/additionalProperties/$ref", "/properties/foo/properties/bar/additionalProperties/$ref", "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, - "/properties/foo"); + "/properties/foo", false); EXPECT_EQ(frame.references().size(), 2); @@ -948,16 +973,16 @@ TEST(JSONSchema_frame_draft7, top_level_relative_ref_with_id) { // Note that `$id` is IGNORED given the sibling `$ref` EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-07/schema#", - JSON_Schema_Draft_7, std::nullopt); + JSON_Schema_Draft_7, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-07/schema#", - JSON_Schema_Draft_7, ""); + JSON_Schema_Draft_7, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$id", "/$id", "http://json-schema.org/draft-07/schema#", - JSON_Schema_Draft_7, ""); + JSON_Schema_Draft_7, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "http://json-schema.org/draft-07/schema#", - JSON_Schema_Draft_7, ""); + JSON_Schema_Draft_7, "", false); EXPECT_EQ(frame.references().size(), 2); @@ -985,28 +1010,28 @@ TEST(JSONSchema_frame_draft7, nested_relative_ref_with_id) { EXPECT_EQ(frame.locations().size(), 6); - EXPECT_FRAME_STATIC_DRAFT7_RESOURCE(frame, "https://example.com", - "https://example.com", "", - "https://example.com", "", std::nullopt); + EXPECT_FRAME_STATIC_DRAFT7_RESOURCE( + frame, "https://example.com", "https://example.com", "", + "https://example.com", "", std::nullopt, false); EXPECT_FRAME_STATIC_DRAFT7_POINTER(frame, "https://example.com#/$id", "https://example.com", "/$id", - "https://example.com", "/$id", ""); - EXPECT_FRAME_STATIC_DRAFT7_POINTER(frame, "https://example.com#/$schema", - "https://example.com", "/$schema", - "https://example.com", "/$schema", ""); + "https://example.com", "/$id", "", false); + EXPECT_FRAME_STATIC_DRAFT7_POINTER( + frame, "https://example.com#/$schema", "https://example.com", "/$schema", + "https://example.com", "/$schema", "", false); EXPECT_FRAME_STATIC_DRAFT7_SUBSCHEMA( frame, "https://example.com#/additionalProperties", "https://example.com", "/additionalProperties", "https://example.com", "/additionalProperties", - ""); + "", false); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://example.com#/additionalProperties/$id", "https://example.com", "/additionalProperties/$id", "https://example.com", - "/additionalProperties/$id", "/additionalProperties"); + "/additionalProperties/$id", "/additionalProperties", false); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://example.com#/additionalProperties/$ref", "https://example.com", "/additionalProperties/$ref", "https://example.com", "/additionalProperties/$ref", - "/additionalProperties"); + "/additionalProperties", false); EXPECT_EQ(frame.references().size(), 2); diff --git a/test/jsonschema/jsonschema_frame_test.cc b/test/jsonschema/jsonschema_frame_test.cc index 4d090ee74..58f6b300b 100644 --- a/test/jsonschema/jsonschema_frame_test.cc +++ b/test/jsonschema/jsonschema_frame_test.cc @@ -38,110 +38,116 @@ TEST(JSONSchema_frame, nested_schemas_mixing_dialects) { frame, "https://www.sourcemeta.com/test", "https://www.sourcemeta.com/test", "", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://www.sourcemeta.com/test", "", std::nullopt); + "https://www.sourcemeta.com/test", "", std::nullopt, false); EXPECT_FRAME_STATIC_RESOURCE(frame, "https://www.sourcemeta.com/foo", "https://www.sourcemeta.com/test", "/$defs/foo", "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); EXPECT_FRAME_STATIC_RESOURCE( frame, "https://www.sourcemeta.com/bar", "https://www.sourcemeta.com/test", "/$defs/foo/definitions/bar", "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, - "https://www.sourcemeta.com/bar", "", "/$defs/foo"); + "https://www.sourcemeta.com/bar", "", "/$defs/foo", false); // JSON Pointers - EXPECT_FRAME_STATIC_POINTER(frame, "https://www.sourcemeta.com/test#/$id", - "https://www.sourcemeta.com/test", "/$id", - "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, - "https://www.sourcemeta.com/test", "/$id", ""); + EXPECT_FRAME_STATIC_POINTER( + frame, "https://www.sourcemeta.com/test#/$id", + "https://www.sourcemeta.com/test", "/$id", + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, + "https://www.sourcemeta.com/test", "/$id", "", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://www.sourcemeta.com/test#/$schema", "https://www.sourcemeta.com/test", "/$schema", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://www.sourcemeta.com/test", "/$schema", ""); - EXPECT_FRAME_STATIC_POINTER(frame, "https://www.sourcemeta.com/test#/$defs", - "https://www.sourcemeta.com/test", "/$defs", - "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, - "https://www.sourcemeta.com/test", "/$defs", ""); + "https://www.sourcemeta.com/test", "/$schema", "", false); + EXPECT_FRAME_STATIC_POINTER( + frame, "https://www.sourcemeta.com/test#/$defs", + "https://www.sourcemeta.com/test", "/$defs", + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, + "https://www.sourcemeta.com/test", "/$defs", "", false); EXPECT_FRAME_STATIC_SUBSCHEMA( frame, "https://www.sourcemeta.com/test#/$defs/foo", "https://www.sourcemeta.com/test", "/$defs/foo", "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, - "https://www.sourcemeta.com/foo", "", ""); + "https://www.sourcemeta.com/foo", "", "", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://www.sourcemeta.com/test#/$defs/foo/id", "https://www.sourcemeta.com/test", "/$defs/foo/id", "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, - "https://www.sourcemeta.com/foo", "/id", "/$defs/foo"); + "https://www.sourcemeta.com/foo", "/id", "/$defs/foo", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://www.sourcemeta.com/test#/$defs/foo/$schema", "https://www.sourcemeta.com/test", "/$defs/foo/$schema", "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, - "https://www.sourcemeta.com/foo", "/$schema", "/$defs/foo"); + "https://www.sourcemeta.com/foo", "/$schema", "/$defs/foo", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://www.sourcemeta.com/test#/$defs/foo/definitions", "https://www.sourcemeta.com/test", "/$defs/foo/definitions", "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, - "https://www.sourcemeta.com/foo", "/definitions", "/$defs/foo"); + "https://www.sourcemeta.com/foo", "/definitions", "/$defs/foo", false); EXPECT_FRAME_STATIC_SUBSCHEMA( frame, "https://www.sourcemeta.com/test#/$defs/foo/definitions/bar", "https://www.sourcemeta.com/test", "/$defs/foo/definitions/bar", "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, - "https://www.sourcemeta.com/bar", "", "/$defs/foo"); + "https://www.sourcemeta.com/bar", "", "/$defs/foo", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://www.sourcemeta.com/test#/$defs/foo/definitions/bar/id", "https://www.sourcemeta.com/test", "/$defs/foo/definitions/bar/id", "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, - "https://www.sourcemeta.com/bar", "/id", "/$defs/foo/definitions/bar"); + "https://www.sourcemeta.com/bar", "/id", "/$defs/foo/definitions/bar", + false); EXPECT_FRAME_STATIC_POINTER( frame, "https://www.sourcemeta.com/test#/$defs/foo/definitions/bar/type", "https://www.sourcemeta.com/test", "/$defs/foo/definitions/bar/type", "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, - "https://www.sourcemeta.com/bar", "/type", "/$defs/foo/definitions/bar"); + "https://www.sourcemeta.com/bar", "/type", "/$defs/foo/definitions/bar", + false); EXPECT_FRAME_STATIC_POINTER( frame, "https://www.sourcemeta.com/foo#/id", "https://www.sourcemeta.com/test", "/$defs/foo/id", "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, - "https://www.sourcemeta.com/foo", "/id", "/$defs/foo"); + "https://www.sourcemeta.com/foo", "/id", "/$defs/foo", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://www.sourcemeta.com/foo#/$schema", "https://www.sourcemeta.com/test", "/$defs/foo/$schema", "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, - "https://www.sourcemeta.com/foo", "/$schema", "/$defs/foo"); + "https://www.sourcemeta.com/foo", "/$schema", "/$defs/foo", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://www.sourcemeta.com/foo#/definitions", "https://www.sourcemeta.com/test", "/$defs/foo/definitions", "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, - "https://www.sourcemeta.com/foo", "/definitions", "/$defs/foo"); + "https://www.sourcemeta.com/foo", "/definitions", "/$defs/foo", false); EXPECT_FRAME_STATIC_SUBSCHEMA( frame, "https://www.sourcemeta.com/foo#/definitions/bar", "https://www.sourcemeta.com/test", "/$defs/foo/definitions/bar", "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, - "https://www.sourcemeta.com/bar", "", "/$defs/foo"); + "https://www.sourcemeta.com/bar", "", "/$defs/foo", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://www.sourcemeta.com/foo#/definitions/bar/id", "https://www.sourcemeta.com/test", "/$defs/foo/definitions/bar/id", "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, - "https://www.sourcemeta.com/bar", "/id", "/$defs/foo/definitions/bar"); + "https://www.sourcemeta.com/bar", "/id", "/$defs/foo/definitions/bar", + false); EXPECT_FRAME_STATIC_POINTER( frame, "https://www.sourcemeta.com/foo#/definitions/bar/type", "https://www.sourcemeta.com/test", "/$defs/foo/definitions/bar/type", "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, - "https://www.sourcemeta.com/bar", "/type", "/$defs/foo/definitions/bar"); + "https://www.sourcemeta.com/bar", "/type", "/$defs/foo/definitions/bar", + false); EXPECT_FRAME_STATIC_POINTER( frame, "https://www.sourcemeta.com/bar#/id", "https://www.sourcemeta.com/test", "/$defs/foo/definitions/bar/id", "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, - "https://www.sourcemeta.com/bar", "/id", "/$defs/foo/definitions/bar"); + "https://www.sourcemeta.com/bar", "/id", "/$defs/foo/definitions/bar", + false); EXPECT_FRAME_STATIC_POINTER( frame, "https://www.sourcemeta.com/bar#/type", "https://www.sourcemeta.com/test", "/$defs/foo/definitions/bar/type", "http://json-schema.org/draft-04/schema#", JSON_Schema_Draft_4, - "https://www.sourcemeta.com/bar", "/type", "/$defs/foo/definitions/bar"); + "https://www.sourcemeta.com/bar", "/type", "/$defs/foo/definitions/bar", + false); // References @@ -186,51 +192,51 @@ TEST(JSONSchema_frame, nested_schemas_sibling_ref_nested_2020_12_draft7) { EXPECT_FRAME_STATIC_RESOURCE( frame, "https://example.com/main", "https://example.com/main", "", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://example.com/main", "", std::nullopt); + "https://example.com/main", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/main#/$schema", "https://example.com/main", "/$schema", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://example.com/main", "/$schema", ""); + JSON_Schema_2020_12, "https://example.com/main", "/$schema", "", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/main#/$id", "https://example.com/main", "/$id", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://example.com/main", "/$id", ""); + JSON_Schema_2020_12, "https://example.com/main", "/$id", "", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/main#/$ref", "https://example.com/main", "/$ref", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://example.com/main", "/$ref", ""); + JSON_Schema_2020_12, "https://example.com/main", "/$ref", "", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/main#/$defs", "https://example.com/main", "/$defs", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://example.com/main", "/$defs", ""); + JSON_Schema_2020_12, "https://example.com/main", "/$defs", "", false); EXPECT_FRAME_STATIC_RESOURCE( frame, "https://example.com/embedded", "https://example.com/main", "/$defs/embedded", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://example.com/embedded", "", ""); + JSON_Schema_2020_12, "https://example.com/embedded", "", "", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/embedded#/$schema", "https://example.com/main", "/$defs/embedded/$schema", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://example.com/embedded", "/$schema", "/$defs/embedded"); + "https://example.com/embedded", "/$schema", "/$defs/embedded", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/embedded#/$id", "https://example.com/main", "/$defs/embedded/$id", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "https://example.com/embedded", "/$id", - "/$defs/embedded"); + "/$defs/embedded", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/embedded#/$ref", "https://example.com/main", "/$defs/embedded/$ref", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "https://example.com/embedded", "/$ref", - "/$defs/embedded"); + "/$defs/embedded", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/embedded#/definitions", "https://example.com/main", "/$defs/embedded/definitions", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://example.com/embedded", "/definitions", "/$defs/embedded"); + "https://example.com/embedded", "/definitions", "/$defs/embedded", false); // Note that this is still considered to be a subschema, but a 2020-12 one. // The logic is that we try to interpret it as Draft 7, given `$schema`, but @@ -241,51 +247,53 @@ TEST(JSONSchema_frame, nested_schemas_sibling_ref_nested_2020_12_draft7) { frame, "https://example.com/embedded#/definitions/foo", "https://example.com/main", "/$defs/embedded/definitions/foo", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://example.com/embedded", "/definitions/foo", "/$defs/embedded"); + "https://example.com/embedded", "/definitions/foo", "/$defs/embedded", + false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/embedded#/definitions/foo/type", "https://example.com/main", "/$defs/embedded/definitions/foo/type", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "https://example.com/embedded", "/definitions/foo/type", - "/$defs/embedded/definitions/foo"); + "/$defs/embedded/definitions/foo", false); // From the root EXPECT_FRAME_STATIC_SUBSCHEMA( frame, "https://example.com/main#/$defs/embedded", "https://example.com/main", "/$defs/embedded", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://example.com/embedded", "", ""); + "https://example.com/embedded", "", "", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/main#/$defs/embedded/$schema", "https://example.com/main", "/$defs/embedded/$schema", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://example.com/embedded", "/$schema", "/$defs/embedded"); + "https://example.com/embedded", "/$schema", "/$defs/embedded", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/main#/$defs/embedded/$id", "https://example.com/main", "/$defs/embedded/$id", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://example.com/embedded", "/$id", "/$defs/embedded"); + "https://example.com/embedded", "/$id", "/$defs/embedded", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/main#/$defs/embedded/$ref", "https://example.com/main", "/$defs/embedded/$ref", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://example.com/embedded", "/$ref", "/$defs/embedded"); + "https://example.com/embedded", "/$ref", "/$defs/embedded", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/main#/$defs/embedded/definitions", "https://example.com/main", "/$defs/embedded/definitions", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://example.com/embedded", "/definitions", "/$defs/embedded"); + "https://example.com/embedded", "/definitions", "/$defs/embedded", false); EXPECT_FRAME_STATIC_SUBSCHEMA( frame, "https://example.com/main#/$defs/embedded/definitions/foo", "https://example.com/main", "/$defs/embedded/definitions/foo", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://example.com/embedded", "/definitions/foo", "/$defs/embedded"); + "https://example.com/embedded", "/definitions/foo", "/$defs/embedded", + false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/main#/$defs/embedded/definitions/foo/type", "https://example.com/main", "/$defs/embedded/definitions/foo/type", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "https://example.com/embedded", "/definitions/foo/type", - "/$defs/embedded/definitions/foo"); + "/$defs/embedded/definitions/foo", false); // References @@ -342,123 +350,125 @@ TEST(JSONSchema_frame, EXPECT_FRAME_STATIC_RESOURCE( frame, "https://example.com/main", "https://example.com/main", "", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://example.com/main", "", std::nullopt); + "https://example.com/main", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/main#/$schema", "https://example.com/main", "/$schema", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://example.com/main", "/$schema", ""); + JSON_Schema_2020_12, "https://example.com/main", "/$schema", "", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/main#/$id", "https://example.com/main", "/$id", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://example.com/main", "/$id", ""); + JSON_Schema_2020_12, "https://example.com/main", "/$id", "", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/main#/$ref", "https://example.com/main", "/$ref", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://example.com/main", "/$ref", ""); + JSON_Schema_2020_12, "https://example.com/main", "/$ref", "", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/main#/$defs", "https://example.com/main", "/$defs", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://example.com/main", "/$defs", ""); + JSON_Schema_2020_12, "https://example.com/main", "/$defs", "", false); EXPECT_FRAME_STATIC_RESOURCE( frame, "https://example.com/embedded", "https://example.com/main", "/$defs/embedded", "http://json-schema.org/draft-07/schema#", - JSON_Schema_Draft_7, "https://example.com/embedded", "", ""); + JSON_Schema_Draft_7, "https://example.com/embedded", "", "", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/embedded#/$schema", "https://example.com/main", "/$defs/embedded/$schema", "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, - "https://example.com/embedded", "/$schema", "/$defs/embedded"); + "https://example.com/embedded", "/$schema", "/$defs/embedded", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/embedded#/$id", "https://example.com/main", "/$defs/embedded/$id", "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, "https://example.com/embedded", "/$id", - "/$defs/embedded"); + "/$defs/embedded", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/embedded#/allOf", "https://example.com/main", "/$defs/embedded/allOf", "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, "https://example.com/embedded", "/allOf", - "/$defs/embedded"); + "/$defs/embedded", false); EXPECT_FRAME_STATIC_SUBSCHEMA( frame, "https://example.com/embedded#/allOf/0", "https://example.com/main", "/$defs/embedded/allOf/0", "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, - "https://example.com/embedded", "/allOf/0", "/$defs/embedded"); + "https://example.com/embedded", "/allOf/0", "/$defs/embedded", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/embedded#/allOf/0/$ref", "https://example.com/main", "/$defs/embedded/allOf/0/$ref", "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, "https://example.com/embedded", "/allOf/0/$ref", - "/$defs/embedded/allOf/0"); + "/$defs/embedded/allOf/0", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/embedded#/definitions", "https://example.com/main", "/$defs/embedded/definitions", "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, - "https://example.com/embedded", "/definitions", "/$defs/embedded"); + "https://example.com/embedded", "/definitions", "/$defs/embedded", false); EXPECT_FRAME_STATIC_SUBSCHEMA( frame, "https://example.com/embedded#/definitions/foo", "https://example.com/main", "/$defs/embedded/definitions/foo", "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, - "https://example.com/embedded", "/definitions/foo", "/$defs/embedded"); + "https://example.com/embedded", "/definitions/foo", "/$defs/embedded", + false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/embedded#/definitions/foo/type", "https://example.com/main", "/$defs/embedded/definitions/foo/type", "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, "https://example.com/embedded", "/definitions/foo/type", - "/$defs/embedded/definitions/foo"); + "/$defs/embedded/definitions/foo", false); // From the root EXPECT_FRAME_STATIC_SUBSCHEMA( frame, "https://example.com/main#/$defs/embedded", "https://example.com/main", "/$defs/embedded", "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, - "https://example.com/embedded", "", ""); + "https://example.com/embedded", "", "", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/main#/$defs/embedded/$schema", "https://example.com/main", "/$defs/embedded/$schema", "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, - "https://example.com/embedded", "/$schema", "/$defs/embedded"); + "https://example.com/embedded", "/$schema", "/$defs/embedded", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/main#/$defs/embedded/$id", "https://example.com/main", "/$defs/embedded/$id", "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, - "https://example.com/embedded", "/$id", "/$defs/embedded"); + "https://example.com/embedded", "/$id", "/$defs/embedded", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/main#/$defs/embedded/allOf", "https://example.com/main", "/$defs/embedded/allOf", "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, - "https://example.com/embedded", "/allOf", "/$defs/embedded"); + "https://example.com/embedded", "/allOf", "/$defs/embedded", false); EXPECT_FRAME_STATIC_SUBSCHEMA( frame, "https://example.com/main#/$defs/embedded/allOf/0", "https://example.com/main", "/$defs/embedded/allOf/0", "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, - "https://example.com/embedded", "/allOf/0", "/$defs/embedded"); + "https://example.com/embedded", "/allOf/0", "/$defs/embedded", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/main#/$defs/embedded/allOf/0/$ref", "https://example.com/main", "/$defs/embedded/allOf/0/$ref", "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, "https://example.com/embedded", "/allOf/0/$ref", - "/$defs/embedded/allOf/0"); + "/$defs/embedded/allOf/0", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/main#/$defs/embedded/definitions", "https://example.com/main", "/$defs/embedded/definitions", "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, - "https://example.com/embedded", "/definitions", "/$defs/embedded"); + "https://example.com/embedded", "/definitions", "/$defs/embedded", false); EXPECT_FRAME_STATIC_SUBSCHEMA( frame, "https://example.com/main#/$defs/embedded/definitions/foo", "https://example.com/main", "/$defs/embedded/definitions/foo", "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, - "https://example.com/embedded", "/definitions/foo", "/$defs/embedded"); + "https://example.com/embedded", "/definitions/foo", "/$defs/embedded", + false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/main#/$defs/embedded/definitions/foo/type", "https://example.com/main", "/$defs/embedded/definitions/foo/type", "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, "https://example.com/embedded", "/definitions/foo/type", - "/$defs/embedded/definitions/foo"); + "/$defs/embedded/definitions/foo", false); // References @@ -510,26 +520,26 @@ TEST(JSONSchema_frame, nested_schemas_sibling_ref_nested_2020_12_draft4) { EXPECT_FRAME_STATIC_RESOURCE( frame, "https://example.com/main", "https://example.com/main", "", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://example.com/main", "", std::nullopt); + "https://example.com/main", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/main#/$schema", "https://example.com/main", "/$schema", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://example.com/main", "/$schema", ""); + JSON_Schema_2020_12, "https://example.com/main", "/$schema", "", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/main#/$id", "https://example.com/main", "/$id", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://example.com/main", "/$id", ""); + JSON_Schema_2020_12, "https://example.com/main", "/$id", "", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/main#/$ref", "https://example.com/main", "/$ref", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://example.com/main", "/$ref", ""); + JSON_Schema_2020_12, "https://example.com/main", "/$ref", "", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/main#/$defs", "https://example.com/main", "/$defs", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://example.com/main", "/$defs", ""); + JSON_Schema_2020_12, "https://example.com/main", "/$defs", "", false); // Note that in this case, we DO NOT consider this to be a resource, as we end // up interpreting it as 2020-12, where `id` is not a valid keyword @@ -537,41 +547,44 @@ TEST(JSONSchema_frame, nested_schemas_sibling_ref_nested_2020_12_draft4) { frame, "https://example.com/main#/$defs/embedded", "https://example.com/main", "/$defs/embedded", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://example.com/main", "/$defs/embedded", ""); + "https://example.com/main", "/$defs/embedded", "", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/main#/$defs/embedded/$schema", "https://example.com/main", "/$defs/embedded/$schema", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://example.com/main", "/$defs/embedded/$schema", "/$defs/embedded"); - EXPECT_FRAME_STATIC_POINTER( - frame, "https://example.com/main#/$defs/embedded/id", - "https://example.com/main", "/$defs/embedded/id", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://example.com/main", "/$defs/embedded/id", "/$defs/embedded"); + "https://example.com/main", "/$defs/embedded/$schema", "/$defs/embedded", + false); + EXPECT_FRAME_STATIC_POINTER(frame, + "https://example.com/main#/$defs/embedded/id", + "https://example.com/main", "/$defs/embedded/id", + "https://json-schema.org/draft/2020-12/schema", + JSON_Schema_2020_12, "https://example.com/main", + "/$defs/embedded/id", "/$defs/embedded", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/main#/$defs/embedded/$ref", "https://example.com/main", "/$defs/embedded/$ref", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://example.com/main", "/$defs/embedded/$ref", "/$defs/embedded"); + "https://example.com/main", "/$defs/embedded/$ref", "/$defs/embedded", + false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/main#/$defs/embedded/definitions", "https://example.com/main", "/$defs/embedded/definitions", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "https://example.com/main", "/$defs/embedded/definitions", - "/$defs/embedded"); + "/$defs/embedded", false); EXPECT_FRAME_STATIC_SUBSCHEMA( frame, "https://example.com/main#/$defs/embedded/definitions/foo", "https://example.com/main", "/$defs/embedded/definitions/foo", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "https://example.com/main", "/$defs/embedded/definitions/foo", - "/$defs/embedded"); + "/$defs/embedded", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com/main#/$defs/embedded/definitions/foo/type", "https://example.com/main", "/$defs/embedded/definitions/foo/type", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "https://example.com/main", "/$defs/embedded/definitions/foo/type", - "/$defs/embedded/definitions/foo"); + "/$defs/embedded/definitions/foo", false); // References @@ -624,59 +637,66 @@ TEST(JSONSchema_frame, no_id) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, std::nullopt); + JSON_Schema_2020_12, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties", "/properties", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); // Foo EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/properties/foo", "/properties/foo", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/$anchor", "/properties/foo/$anchor", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/properties/foo"); + "/properties/foo", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/type", "/properties/foo/type", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/properties/foo"); + "/properties/foo", false); EXPECT_ANONYMOUS_FRAME_STATIC_ANCHOR( frame, "#foo", "/properties/foo", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); // Bar EXPECT_ANONYMOUS_FRAME_STATIC_RESOURCE( frame, "https://example.com", "/properties/bar", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_ANCHOR( frame, "https://example.com#bar", "/properties/bar", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/$id", "/properties/bar/$id", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/properties/bar"); + "/properties/bar", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/$anchor", "/properties/bar/$anchor", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/properties/bar"); + "/properties/bar", false); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/properties/bar", "/properties/bar", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/bar/$id", "/properties/bar/$id", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/properties/bar"); + "/properties/bar", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/bar/$anchor", "/properties/bar/$anchor", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/properties/bar"); + "/properties/bar", false); // References @@ -706,22 +726,22 @@ TEST(JSONSchema_frame, no_id_with_default) { frame, "https://www.sourcemeta.com/schema", "https://www.sourcemeta.com/schema", "", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://www.sourcemeta.com/schema", "", std::nullopt); + "https://www.sourcemeta.com/schema", "", std::nullopt, false); EXPECT_FRAME_STATIC_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://www.sourcemeta.com/schema", "/$schema", ""); + "https://www.sourcemeta.com/schema", "/$schema", "", false); EXPECT_FRAME_STATIC_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://www.sourcemeta.com/schema", "/items", ""); + "https://www.sourcemeta.com/schema", "/items", "", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://www.sourcemeta.com/schema#/items/type", "https://www.sourcemeta.com/schema", "/items/type", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://www.sourcemeta.com/schema", "/items/type", "/items"); + "https://www.sourcemeta.com/schema", "/items/type", "/items", false); // References @@ -752,48 +772,50 @@ TEST(JSONSchema_frame, id_with_default_id) { EXPECT_FRAME_STATIC_RESOURCE( frame, "https://example.com", "https://example.com", "", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://example.com", "", std::nullopt); + "https://example.com", "", std::nullopt, false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com#/$id", "https://example.com", "/$id", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://example.com", "/$id", ""); + "https://example.com", "/$id", "", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com#/$schema", "https://example.com", "/$schema", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://example.com", "/$schema", ""); + "https://example.com", "/$schema", "", false); EXPECT_FRAME_STATIC_SUBSCHEMA( frame, "https://example.com#/additionalProperties", "https://example.com", "/additionalProperties", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://example.com", "/additionalProperties", ""); + JSON_Schema_2020_12, "https://example.com", "/additionalProperties", "", + false); EXPECT_FRAME_STATIC_POINTER( frame, "https://example.com#/additionalProperties/type", "https://example.com", "/additionalProperties/type", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "https://example.com", "/additionalProperties/type", - "/additionalProperties"); + "/additionalProperties", false); EXPECT_FRAME_STATIC_RESOURCE( frame, "https://other.com", "https://example.com", "", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://example.com", "", std::nullopt); + "https://example.com", "", std::nullopt, false); EXPECT_FRAME_STATIC_POINTER( frame, "https://other.com#/$id", "https://example.com", "/$id", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://example.com", "/$id", ""); + "https://example.com", "/$id", "", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://other.com#/$schema", "https://example.com", "/$schema", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://example.com", "/$schema", ""); + "https://example.com", "/$schema", "", false); EXPECT_FRAME_STATIC_SUBSCHEMA( frame, "https://other.com#/additionalProperties", "https://example.com", "/additionalProperties", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://example.com", "/additionalProperties", ""); + JSON_Schema_2020_12, "https://example.com", "/additionalProperties", "", + false); EXPECT_FRAME_STATIC_POINTER( frame, "https://other.com#/additionalProperties/type", "https://example.com", "/additionalProperties/type", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "https://example.com", "/additionalProperties/type", - "/additionalProperties"); + "/additionalProperties", false); // References @@ -826,23 +848,26 @@ TEST(JSONSchema_frame, cross_2020_12_to_2019_09_without_id) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, std::nullopt); + JSON_Schema_2020_12, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$defs", "/$defs", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); // Subschema EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/$defs/schema", "/$defs/schema", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$defs/schema/$schema", "/$defs/schema/$schema", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/$defs/schema"); + "/$defs/schema", false); } TEST(JSONSchema_frame, cross_2020_12_to_draft7_without_id) { @@ -866,22 +891,25 @@ TEST(JSONSchema_frame, cross_2020_12_to_draft7_without_id) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, std::nullopt); + JSON_Schema_2020_12, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$defs", "/$defs", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); // Note that `$schema` without an identifier is NOT allowed EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/$defs/schema", "/$defs/schema", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$defs/schema/$schema", "/$defs/schema/$schema", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/$defs/schema"); + "/$defs/schema", false); } TEST(JSONSchema_frame, cross_2020_12_to_draft6_without_id) { @@ -905,22 +933,25 @@ TEST(JSONSchema_frame, cross_2020_12_to_draft6_without_id) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, std::nullopt); + JSON_Schema_2020_12, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$defs", "/$defs", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); // Note that `$schema` without an identifier is NOT allowed EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/$defs/schema", "/$defs/schema", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$defs/schema/$schema", "/$defs/schema/$schema", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/$defs/schema"); + "/$defs/schema", false); } TEST(JSONSchema_frame, cross_2020_12_to_draft4_without_id) { @@ -944,22 +975,25 @@ TEST(JSONSchema_frame, cross_2020_12_to_draft4_without_id) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, std::nullopt); + JSON_Schema_2020_12, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$defs", "/$defs", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); // Note that `$schema` without an identifier is NOT allowed EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/$defs/schema", "/$defs/schema", - "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, ""); + "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$defs/schema/$schema", "/$defs/schema/$schema", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "/$defs/schema"); + "/$defs/schema", false); } TEST(JSONSchema_frame, cross_draft7_to_draft4_without_id) { @@ -983,22 +1017,24 @@ TEST(JSONSchema_frame, cross_draft7_to_draft4_without_id) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-07/schema#", - JSON_Schema_Draft_7, std::nullopt); + JSON_Schema_Draft_7, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-07/schema#", - JSON_Schema_Draft_7, ""); + JSON_Schema_Draft_7, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions", "/definitions", - "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, ""); + "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, "", + false); // Note that `$schema` without an identifier is NOT allowed EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/definitions/schema", "/definitions/schema", - "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, ""); + "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions/schema/$schema", "/definitions/schema/$schema", "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, - "/definitions/schema"); + "/definitions/schema", false); } TEST(JSONSchema_frame, cross_draft7_to_2020_12_without_id) { @@ -1022,24 +1058,26 @@ TEST(JSONSchema_frame, cross_draft7_to_2020_12_without_id) { EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-07/schema#", - JSON_Schema_Draft_7, std::nullopt); + JSON_Schema_Draft_7, std::nullopt, false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-07/schema#", - JSON_Schema_Draft_7, ""); + JSON_Schema_Draft_7, "", false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions", "/definitions", - "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, ""); + "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, "", + false); // Subschema // Note that `$schema` without an identifier is NOT allowed EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/definitions/schema", "/definitions/schema", - "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, ""); + "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, "", + false); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions/schema/$schema", "/definitions/schema/$schema", "http://json-schema.org/draft-07/schema#", JSON_Schema_Draft_7, - "/definitions/schema"); + "/definitions/schema", false); } TEST(JSONSchema_frame, anchor_on_absolute_subid) { @@ -1063,56 +1101,59 @@ TEST(JSONSchema_frame, anchor_on_absolute_subid) { EXPECT_FRAME_STATIC_RESOURCE( frame, "https://www.example.com", "https://www.example.com", "", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://www.example.com", "", std::nullopt); + "https://www.example.com", "", std::nullopt, false); EXPECT_FRAME_STATIC_RESOURCE( frame, "https://www.example.org", "https://www.example.com", "/items", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://www.example.org", "", ""); - EXPECT_FRAME_STATIC_ANCHOR( - frame, "https://www.example.org#foo", "https://www.example.com", - "/items/items", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://www.example.org", "/items", "/items"); + "https://www.example.org", "", "", false); + EXPECT_FRAME_STATIC_ANCHOR(frame, "https://www.example.org#foo", + "https://www.example.com", "/items/items", + "https://json-schema.org/draft/2020-12/schema", + JSON_Schema_2020_12, "https://www.example.org", + "/items", "/items", false); // JSON Pointers EXPECT_FRAME_STATIC_POINTER( frame, "https://www.example.com#/$id", "https://www.example.com", "/$id", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://www.example.com", "/$id", ""); + "https://www.example.com", "/$id", "", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://www.example.com#/$schema", "https://www.example.com", "/$schema", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://www.example.com", "/$schema", ""); + JSON_Schema_2020_12, "https://www.example.com", "/$schema", "", false); EXPECT_FRAME_STATIC_SUBSCHEMA( frame, "https://www.example.com#/items", "https://www.example.com", "/items", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://www.example.org", "", ""); + JSON_Schema_2020_12, "https://www.example.org", "", "", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://www.example.com#/items/$id", "https://www.example.com", "/items/$id", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://www.example.org", "/$id", "/items"); - EXPECT_FRAME_STATIC_SUBSCHEMA( - frame, "https://www.example.com#/items/items", "https://www.example.com", - "/items/items", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://www.example.org", "/items", "/items"); + JSON_Schema_2020_12, "https://www.example.org", "/$id", "/items", false); + EXPECT_FRAME_STATIC_SUBSCHEMA(frame, "https://www.example.com#/items/items", + "https://www.example.com", "/items/items", + "https://json-schema.org/draft/2020-12/schema", + JSON_Schema_2020_12, "https://www.example.org", + "/items", "/items", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://www.example.com#/items/items/$anchor", "https://www.example.com", "/items/items/$anchor", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://www.example.org", "/items/$anchor", "/items/items"); + "https://www.example.org", "/items/$anchor", "/items/items", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://www.example.org#/$id", "https://www.example.com", "/items/$id", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://www.example.org", "/$id", "/items"); - EXPECT_FRAME_STATIC_SUBSCHEMA( - frame, "https://www.example.org#/items", "https://www.example.com", - "/items/items", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://www.example.org", "/items", "/items"); + JSON_Schema_2020_12, "https://www.example.org", "/$id", "/items", false); + EXPECT_FRAME_STATIC_SUBSCHEMA(frame, "https://www.example.org#/items", + "https://www.example.com", "/items/items", + "https://json-schema.org/draft/2020-12/schema", + JSON_Schema_2020_12, "https://www.example.org", + "/items", "/items", false); EXPECT_FRAME_STATIC_POINTER(frame, "https://www.example.org#/items/$anchor", "https://www.example.com", "/items/items/$anchor", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "https://www.example.org", - "/items/$anchor", "/items/items"); + "/items/$anchor", "/items/items", false); // References @@ -1463,46 +1504,48 @@ TEST(JSONSchema_frame, mode_references) { EXPECT_FRAME_STATIC_RESOURCE( frame, "https://www.example.com", "https://www.example.com", "", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://www.example.com", "", std::nullopt); + "https://www.example.com", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_POINTER( frame, "https://www.example.com#/$id", "https://www.example.com", "/$id", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://www.example.com", "/$id", ""); + "https://www.example.com", "/$id", "", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://www.example.com#/$schema", "https://www.example.com", "/$schema", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://www.example.com", "/$schema", ""); + JSON_Schema_2020_12, "https://www.example.com", "/$schema", "", false); EXPECT_FRAME_STATIC_SUBSCHEMA( frame, "https://www.example.com#/items", "https://www.example.com", "/items", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://www.example.com", "/items", ""); + JSON_Schema_2020_12, "https://www.example.com", "/items", "", false); EXPECT_FRAME_STATIC_ANCHOR( frame, "https://www.example.com#helper", "https://www.example.com", "/items", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://www.example.com", "/items", ""); + JSON_Schema_2020_12, "https://www.example.com", "/items", "", false); EXPECT_FRAME_STATIC_POINTER(frame, "https://www.example.com#/items/$anchor", "https://www.example.com", "/items/$anchor", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "https://www.example.com", - "/items/$anchor", "/items"); - EXPECT_FRAME_STATIC_POINTER( - frame, "https://www.example.com#/items/$ref", "https://www.example.com", - "/items/$ref", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://www.example.com", "/items/$ref", "/items"); + "/items/$anchor", "/items", false); + EXPECT_FRAME_STATIC_POINTER(frame, "https://www.example.com#/items/$ref", + "https://www.example.com", "/items/$ref", + "https://json-schema.org/draft/2020-12/schema", + JSON_Schema_2020_12, "https://www.example.com", + "/items/$ref", "/items", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://www.example.com#/$defs", "https://www.example.com", "/$defs", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://www.example.com", "/$defs", ""); - EXPECT_FRAME_STATIC_SUBSCHEMA( - frame, "https://www.example.com#/$defs/helper", "https://www.example.com", - "/$defs/helper", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://www.example.com", "/$defs/helper", ""); + JSON_Schema_2020_12, "https://www.example.com", "/$defs", "", false); + EXPECT_FRAME_STATIC_SUBSCHEMA(frame, "https://www.example.com#/$defs/helper", + "https://www.example.com", "/$defs/helper", + "https://json-schema.org/draft/2020-12/schema", + JSON_Schema_2020_12, "https://www.example.com", + "/$defs/helper", "", false); // References @@ -1540,46 +1583,48 @@ TEST(JSONSchema_frame, mode_locations) { EXPECT_FRAME_STATIC_RESOURCE( frame, "https://www.example.com", "https://www.example.com", "", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://www.example.com", "", std::nullopt); + "https://www.example.com", "", std::nullopt, false); // JSON Pointers EXPECT_FRAME_STATIC_POINTER( frame, "https://www.example.com#/$id", "https://www.example.com", "/$id", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, - "https://www.example.com", "/$id", ""); + "https://www.example.com", "/$id", "", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://www.example.com#/$schema", "https://www.example.com", "/$schema", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://www.example.com", "/$schema", ""); + JSON_Schema_2020_12, "https://www.example.com", "/$schema", "", false); EXPECT_FRAME_STATIC_SUBSCHEMA( frame, "https://www.example.com#/items", "https://www.example.com", "/items", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://www.example.com", "/items", ""); + JSON_Schema_2020_12, "https://www.example.com", "/items", "", false); EXPECT_FRAME_STATIC_ANCHOR( frame, "https://www.example.com#helper", "https://www.example.com", "/items", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://www.example.com", "/items", ""); + JSON_Schema_2020_12, "https://www.example.com", "/items", "", false); EXPECT_FRAME_STATIC_POINTER(frame, "https://www.example.com#/items/$anchor", "https://www.example.com", "/items/$anchor", "https://json-schema.org/draft/2020-12/schema", JSON_Schema_2020_12, "https://www.example.com", - "/items/$anchor", "/items"); - EXPECT_FRAME_STATIC_POINTER( - frame, "https://www.example.com#/items/$ref", "https://www.example.com", - "/items/$ref", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://www.example.com", "/items/$ref", "/items"); + "/items/$anchor", "/items", false); + EXPECT_FRAME_STATIC_POINTER(frame, "https://www.example.com#/items/$ref", + "https://www.example.com", "/items/$ref", + "https://json-schema.org/draft/2020-12/schema", + JSON_Schema_2020_12, "https://www.example.com", + "/items/$ref", "/items", false); EXPECT_FRAME_STATIC_POINTER( frame, "https://www.example.com#/$defs", "https://www.example.com", "/$defs", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://www.example.com", "/$defs", ""); - EXPECT_FRAME_STATIC_SUBSCHEMA( - frame, "https://www.example.com#/$defs/helper", "https://www.example.com", - "/$defs/helper", "https://json-schema.org/draft/2020-12/schema", - JSON_Schema_2020_12, "https://www.example.com", "/$defs/helper", ""); + JSON_Schema_2020_12, "https://www.example.com", "/$defs", "", false); + EXPECT_FRAME_STATIC_SUBSCHEMA(frame, "https://www.example.com#/$defs/helper", + "https://www.example.com", "/$defs/helper", + "https://json-schema.org/draft/2020-12/schema", + JSON_Schema_2020_12, "https://www.example.com", + "/$defs/helper", "", false); // References @@ -1819,7 +1864,8 @@ TEST(JSONSchema_frame, to_json_mode_references) { "position": null, "relativePointer": "", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/bar#/$schema": { "parent": "/properties/bar", @@ -1830,7 +1876,8 @@ TEST(JSONSchema_frame, to_json_mode_references) { "position": null, "relativePointer": "/$schema", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/bar#/id": { "parent": "/properties/bar", @@ -1841,7 +1888,8 @@ TEST(JSONSchema_frame, to_json_mode_references) { "position": null, "relativePointer": "/id", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/bar#/type": { "parent": "/properties/bar", @@ -1852,7 +1900,8 @@ TEST(JSONSchema_frame, to_json_mode_references) { "position": null, "relativePointer": "/type", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/test": { "parent": null, @@ -1863,7 +1912,8 @@ TEST(JSONSchema_frame, to_json_mode_references) { "position": null, "relativePointer": "", "dialect": "https://json-schema.org/draft/2020-12/schema", - "baseDialect": "https://json-schema.org/draft/2020-12/schema" + "baseDialect": "https://json-schema.org/draft/2020-12/schema", + "propertyName": false }, "https://www.sourcemeta.com/test#/$id": { "parent": "", @@ -1874,7 +1924,8 @@ TEST(JSONSchema_frame, to_json_mode_references) { "position": null, "relativePointer": "/$id", "dialect": "https://json-schema.org/draft/2020-12/schema", - "baseDialect": "https://json-schema.org/draft/2020-12/schema" + "baseDialect": "https://json-schema.org/draft/2020-12/schema", + "propertyName": false }, "https://www.sourcemeta.com/test#/$schema": { "parent": "", @@ -1885,7 +1936,8 @@ TEST(JSONSchema_frame, to_json_mode_references) { "position": null, "relativePointer": "/$schema", "dialect": "https://json-schema.org/draft/2020-12/schema", - "baseDialect": "https://json-schema.org/draft/2020-12/schema" + "baseDialect": "https://json-schema.org/draft/2020-12/schema", + "propertyName": false }, "https://www.sourcemeta.com/test#/properties": { "parent": "", @@ -1896,7 +1948,8 @@ TEST(JSONSchema_frame, to_json_mode_references) { "position": null, "relativePointer": "/properties", "dialect": "https://json-schema.org/draft/2020-12/schema", - "baseDialect": "https://json-schema.org/draft/2020-12/schema" + "baseDialect": "https://json-schema.org/draft/2020-12/schema", + "propertyName": false }, "https://www.sourcemeta.com/test#/properties/bar": { "parent": "", @@ -1907,7 +1960,8 @@ TEST(JSONSchema_frame, to_json_mode_references) { "position": null, "relativePointer": "", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/test#/properties/bar/$schema": { "parent": "/properties/bar", @@ -1918,7 +1972,8 @@ TEST(JSONSchema_frame, to_json_mode_references) { "position": null, "relativePointer": "/$schema", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/test#/properties/bar/id": { "parent": "/properties/bar", @@ -1929,7 +1984,8 @@ TEST(JSONSchema_frame, to_json_mode_references) { "position": null, "relativePointer": "/id", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/test#/properties/bar/type": { "parent": "/properties/bar", @@ -1940,7 +1996,8 @@ TEST(JSONSchema_frame, to_json_mode_references) { "position": null, "relativePointer": "/type", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/test#/properties/foo": { "parent": "", @@ -1951,7 +2008,8 @@ TEST(JSONSchema_frame, to_json_mode_references) { "position": null, "relativePointer": "/properties/foo", "dialect": "https://json-schema.org/draft/2020-12/schema", - "baseDialect": "https://json-schema.org/draft/2020-12/schema" + "baseDialect": "https://json-schema.org/draft/2020-12/schema", + "propertyName": false }, "https://www.sourcemeta.com/test#/properties/foo/$ref": { "parent": "/properties/foo", @@ -1962,7 +2020,8 @@ TEST(JSONSchema_frame, to_json_mode_references) { "position": null, "relativePointer": "/properties/foo/$ref", "dialect": "https://json-schema.org/draft/2020-12/schema", - "baseDialect": "https://json-schema.org/draft/2020-12/schema" + "baseDialect": "https://json-schema.org/draft/2020-12/schema", + "propertyName": false } }, "dynamic": {} @@ -2033,7 +2092,8 @@ TEST(JSONSchema_frame, to_json_mode_locations) { "position": null, "relativePointer": "", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/bar#/$schema": { "parent": "/properties/bar", @@ -2044,7 +2104,8 @@ TEST(JSONSchema_frame, to_json_mode_locations) { "position": null, "relativePointer": "/$schema", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/bar#/id": { "parent": "/properties/bar", @@ -2055,7 +2116,8 @@ TEST(JSONSchema_frame, to_json_mode_locations) { "position": null, "relativePointer": "/id", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/bar#/type": { "parent": "/properties/bar", @@ -2066,7 +2128,8 @@ TEST(JSONSchema_frame, to_json_mode_locations) { "position": null, "relativePointer": "/type", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/test": { "parent": null, @@ -2077,7 +2140,8 @@ TEST(JSONSchema_frame, to_json_mode_locations) { "position": null, "relativePointer": "", "dialect": "https://json-schema.org/draft/2020-12/schema", - "baseDialect": "https://json-schema.org/draft/2020-12/schema" + "baseDialect": "https://json-schema.org/draft/2020-12/schema", + "propertyName": false }, "https://www.sourcemeta.com/test#/$id": { "parent": "", @@ -2088,7 +2152,8 @@ TEST(JSONSchema_frame, to_json_mode_locations) { "position": null, "relativePointer": "/$id", "dialect": "https://json-schema.org/draft/2020-12/schema", - "baseDialect": "https://json-schema.org/draft/2020-12/schema" + "baseDialect": "https://json-schema.org/draft/2020-12/schema", + "propertyName": false }, "https://www.sourcemeta.com/test#/$schema": { "parent": "", @@ -2099,7 +2164,8 @@ TEST(JSONSchema_frame, to_json_mode_locations) { "position": null, "relativePointer": "/$schema", "dialect": "https://json-schema.org/draft/2020-12/schema", - "baseDialect": "https://json-schema.org/draft/2020-12/schema" + "baseDialect": "https://json-schema.org/draft/2020-12/schema", + "propertyName": false }, "https://www.sourcemeta.com/test#/properties": { "parent": "", @@ -2110,7 +2176,8 @@ TEST(JSONSchema_frame, to_json_mode_locations) { "position": null, "relativePointer": "/properties", "dialect": "https://json-schema.org/draft/2020-12/schema", - "baseDialect": "https://json-schema.org/draft/2020-12/schema" + "baseDialect": "https://json-schema.org/draft/2020-12/schema", + "propertyName": false }, "https://www.sourcemeta.com/test#/properties/bar": { "parent": "", @@ -2121,7 +2188,8 @@ TEST(JSONSchema_frame, to_json_mode_locations) { "position": null, "relativePointer": "", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/test#/properties/bar/$schema": { "parent": "/properties/bar", @@ -2132,7 +2200,8 @@ TEST(JSONSchema_frame, to_json_mode_locations) { "position": null, "relativePointer": "/$schema", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/test#/properties/bar/id": { "parent": "/properties/bar", @@ -2143,7 +2212,8 @@ TEST(JSONSchema_frame, to_json_mode_locations) { "position": null, "relativePointer": "/id", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/test#/properties/bar/type": { "parent": "/properties/bar", @@ -2154,7 +2224,8 @@ TEST(JSONSchema_frame, to_json_mode_locations) { "position": null, "relativePointer": "/type", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/test#/properties/foo": { "parent": "", @@ -2165,7 +2236,8 @@ TEST(JSONSchema_frame, to_json_mode_locations) { "position": null, "relativePointer": "/properties/foo", "dialect": "https://json-schema.org/draft/2020-12/schema", - "baseDialect": "https://json-schema.org/draft/2020-12/schema" + "baseDialect": "https://json-schema.org/draft/2020-12/schema", + "propertyName": false }, "https://www.sourcemeta.com/test#/properties/foo/$ref": { "parent": "/properties/foo", @@ -2176,7 +2248,8 @@ TEST(JSONSchema_frame, to_json_mode_locations) { "position": null, "relativePointer": "/properties/foo/$ref", "dialect": "https://json-schema.org/draft/2020-12/schema", - "baseDialect": "https://json-schema.org/draft/2020-12/schema" + "baseDialect": "https://json-schema.org/draft/2020-12/schema", + "propertyName": false } }, "dynamic": {} @@ -2225,7 +2298,8 @@ TEST(JSONSchema_frame, to_json_mode_references_with_tracking) { "position": [ 8, 7, 12, 7 ], "relativePointer": "", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/bar#/$schema": { "parent": "/properties/bar", @@ -2236,7 +2310,8 @@ TEST(JSONSchema_frame, to_json_mode_references_with_tracking) { "position": [ 10, 9, 10, 60 ], "relativePointer": "/$schema", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/bar#/id": { "parent": "/properties/bar", @@ -2247,7 +2322,8 @@ TEST(JSONSchema_frame, to_json_mode_references_with_tracking) { "position": [ 9, 9, 9, 19 ], "relativePointer": "/id", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/bar#/type": { "parent": "/properties/bar", @@ -2258,7 +2334,8 @@ TEST(JSONSchema_frame, to_json_mode_references_with_tracking) { "position": [ 11, 9, 11, 24 ], "relativePointer": "/type", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/test": { "parent": null, @@ -2269,7 +2346,8 @@ TEST(JSONSchema_frame, to_json_mode_references_with_tracking) { "position": [ 1, 1, 14, 3 ], "relativePointer": "", "dialect": "https://json-schema.org/draft/2020-12/schema", - "baseDialect": "https://json-schema.org/draft/2020-12/schema" + "baseDialect": "https://json-schema.org/draft/2020-12/schema", + "propertyName": false }, "https://www.sourcemeta.com/test#/$id": { "parent": "", @@ -2280,7 +2358,8 @@ TEST(JSONSchema_frame, to_json_mode_references_with_tracking) { "position": [ 2, 5, 2, 44 ], "relativePointer": "/$id", "dialect": "https://json-schema.org/draft/2020-12/schema", - "baseDialect": "https://json-schema.org/draft/2020-12/schema" + "baseDialect": "https://json-schema.org/draft/2020-12/schema", + "propertyName": false }, "https://www.sourcemeta.com/test#/$schema": { "parent": "", @@ -2291,7 +2370,8 @@ TEST(JSONSchema_frame, to_json_mode_references_with_tracking) { "position": [ 3, 5, 3, 61 ], "relativePointer": "/$schema", "dialect": "https://json-schema.org/draft/2020-12/schema", - "baseDialect": "https://json-schema.org/draft/2020-12/schema" + "baseDialect": "https://json-schema.org/draft/2020-12/schema", + "propertyName": false }, "https://www.sourcemeta.com/test#/properties": { "parent": "", @@ -2302,7 +2382,8 @@ TEST(JSONSchema_frame, to_json_mode_references_with_tracking) { "position": [ 4, 5, 13, 5 ], "relativePointer": "/properties", "dialect": "https://json-schema.org/draft/2020-12/schema", - "baseDialect": "https://json-schema.org/draft/2020-12/schema" + "baseDialect": "https://json-schema.org/draft/2020-12/schema", + "propertyName": false }, "https://www.sourcemeta.com/test#/properties/bar": { "parent": "", @@ -2313,7 +2394,8 @@ TEST(JSONSchema_frame, to_json_mode_references_with_tracking) { "position": [ 8, 7, 12, 7 ], "relativePointer": "", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/test#/properties/bar/$schema": { "parent": "/properties/bar", @@ -2324,7 +2406,8 @@ TEST(JSONSchema_frame, to_json_mode_references_with_tracking) { "position": [ 10, 9, 10, 60 ], "relativePointer": "/$schema", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/test#/properties/bar/id": { "parent": "/properties/bar", @@ -2335,7 +2418,8 @@ TEST(JSONSchema_frame, to_json_mode_references_with_tracking) { "position": [ 9, 9, 9, 19 ], "relativePointer": "/id", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/test#/properties/bar/type": { "parent": "/properties/bar", @@ -2346,7 +2430,8 @@ TEST(JSONSchema_frame, to_json_mode_references_with_tracking) { "position": [ 11, 9, 11, 24 ], "relativePointer": "/type", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/test#/properties/foo": { "parent": "", @@ -2357,7 +2442,8 @@ TEST(JSONSchema_frame, to_json_mode_references_with_tracking) { "position": [ 5, 7, 7, 7 ], "relativePointer": "/properties/foo", "dialect": "https://json-schema.org/draft/2020-12/schema", - "baseDialect": "https://json-schema.org/draft/2020-12/schema" + "baseDialect": "https://json-schema.org/draft/2020-12/schema", + "propertyName": false }, "https://www.sourcemeta.com/test#/properties/foo/$ref": { "parent": "/properties/foo", @@ -2368,7 +2454,8 @@ TEST(JSONSchema_frame, to_json_mode_references_with_tracking) { "position": [ 6, 9, 6, 21 ], "relativePointer": "/properties/foo/$ref", "dialect": "https://json-schema.org/draft/2020-12/schema", - "baseDialect": "https://json-schema.org/draft/2020-12/schema" + "baseDialect": "https://json-schema.org/draft/2020-12/schema", + "propertyName": false } }, "dynamic": {} @@ -2442,7 +2529,8 @@ TEST(JSONSchema_frame, to_json_mode_references_with_tracking_empty) { "position": null, "relativePointer": "", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/bar#/$schema": { "parent": "/properties/bar", @@ -2453,7 +2541,8 @@ TEST(JSONSchema_frame, to_json_mode_references_with_tracking_empty) { "position": null, "relativePointer": "/$schema", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/bar#/id": { "parent": "/properties/bar", @@ -2464,7 +2553,8 @@ TEST(JSONSchema_frame, to_json_mode_references_with_tracking_empty) { "position": null, "relativePointer": "/id", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/bar#/type": { "parent": "/properties/bar", @@ -2475,7 +2565,8 @@ TEST(JSONSchema_frame, to_json_mode_references_with_tracking_empty) { "position": null, "relativePointer": "/type", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/test": { "parent": null, @@ -2486,7 +2577,8 @@ TEST(JSONSchema_frame, to_json_mode_references_with_tracking_empty) { "position": null, "relativePointer": "", "dialect": "https://json-schema.org/draft/2020-12/schema", - "baseDialect": "https://json-schema.org/draft/2020-12/schema" + "baseDialect": "https://json-schema.org/draft/2020-12/schema", + "propertyName": false }, "https://www.sourcemeta.com/test#/$id": { "parent": "", @@ -2497,7 +2589,8 @@ TEST(JSONSchema_frame, to_json_mode_references_with_tracking_empty) { "position": null, "relativePointer": "/$id", "dialect": "https://json-schema.org/draft/2020-12/schema", - "baseDialect": "https://json-schema.org/draft/2020-12/schema" + "baseDialect": "https://json-schema.org/draft/2020-12/schema", + "propertyName": false }, "https://www.sourcemeta.com/test#/$schema": { "parent": "", @@ -2508,7 +2601,8 @@ TEST(JSONSchema_frame, to_json_mode_references_with_tracking_empty) { "position": null, "relativePointer": "/$schema", "dialect": "https://json-schema.org/draft/2020-12/schema", - "baseDialect": "https://json-schema.org/draft/2020-12/schema" + "baseDialect": "https://json-schema.org/draft/2020-12/schema", + "propertyName": false }, "https://www.sourcemeta.com/test#/properties": { "parent": "", @@ -2519,7 +2613,8 @@ TEST(JSONSchema_frame, to_json_mode_references_with_tracking_empty) { "position": null, "relativePointer": "/properties", "dialect": "https://json-schema.org/draft/2020-12/schema", - "baseDialect": "https://json-schema.org/draft/2020-12/schema" + "baseDialect": "https://json-schema.org/draft/2020-12/schema", + "propertyName": false }, "https://www.sourcemeta.com/test#/properties/bar": { "parent": "", @@ -2530,7 +2625,8 @@ TEST(JSONSchema_frame, to_json_mode_references_with_tracking_empty) { "position": null, "relativePointer": "", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/test#/properties/bar/$schema": { "parent": "/properties/bar", @@ -2541,7 +2637,8 @@ TEST(JSONSchema_frame, to_json_mode_references_with_tracking_empty) { "position": null, "relativePointer": "/$schema", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/test#/properties/bar/id": { "parent": "/properties/bar", @@ -2552,7 +2649,8 @@ TEST(JSONSchema_frame, to_json_mode_references_with_tracking_empty) { "position": null, "relativePointer": "/id", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/test#/properties/bar/type": { "parent": "/properties/bar", @@ -2563,7 +2661,8 @@ TEST(JSONSchema_frame, to_json_mode_references_with_tracking_empty) { "position": null, "relativePointer": "/type", "dialect": "http://json-schema.org/draft-04/schema#", - "baseDialect": "http://json-schema.org/draft-04/schema#" + "baseDialect": "http://json-schema.org/draft-04/schema#", + "propertyName": false }, "https://www.sourcemeta.com/test#/properties/foo": { "parent": "", @@ -2574,7 +2673,8 @@ TEST(JSONSchema_frame, to_json_mode_references_with_tracking_empty) { "position": null, "relativePointer": "/properties/foo", "dialect": "https://json-schema.org/draft/2020-12/schema", - "baseDialect": "https://json-schema.org/draft/2020-12/schema" + "baseDialect": "https://json-schema.org/draft/2020-12/schema", + "propertyName": false }, "https://www.sourcemeta.com/test#/properties/foo/$ref": { "parent": "/properties/foo", @@ -2585,7 +2685,8 @@ TEST(JSONSchema_frame, to_json_mode_references_with_tracking_empty) { "position": null, "relativePointer": "/properties/foo/$ref", "dialect": "https://json-schema.org/draft/2020-12/schema", - "baseDialect": "https://json-schema.org/draft/2020-12/schema" + "baseDialect": "https://json-schema.org/draft/2020-12/schema", + "propertyName": false } }, "dynamic": {} diff --git a/test/jsonschema/jsonschema_test_utils.h b/test/jsonschema/jsonschema_test_utils.h index 56c945713..7f6463580 100644 --- a/test/jsonschema/jsonschema_test_utils.h +++ b/test/jsonschema/jsonschema_test_utils.h @@ -49,10 +49,10 @@ #define TO_POINTER(pointer_string) \ sourcemeta::core::to_pointer((pointer_string)) -#define EXPECT_FRAME(frame, expected_type, reference, root_id, \ - expected_pointer, expected_dialect, \ - expected_base_dialect, expected_base, \ - expected_relative_pointer, expected_parent) \ +#define EXPECT_FRAME( \ + frame, expected_type, reference, root_id, expected_pointer, \ + expected_dialect, expected_base_dialect, expected_base, \ + expected_relative_pointer, expected_parent, expected_property_name) \ EXPECT_TRUE((frame).locations().contains({(expected_type), (reference)})); \ EXPECT_EQ((frame).root(), (root_id)); \ EXPECT_EQ( \ @@ -76,24 +76,29 @@ (expected_relative_pointer)); \ EXPECT_OPTIONAL_POINTER( \ (frame).locations().at({(expected_type), (reference)}).parent, \ - expected_parent); + expected_parent); \ + EXPECT_EQ( \ + (frame).locations().at({(expected_type), (reference)}).property_name, \ + (expected_property_name)); #define EXPECT_FRAME_STATIC(frame, reference, root_id, expected_pointer, \ expected_dialect, expected_base_dialect, \ expected_base, expected_relative_pointer, \ - expected_parent) \ + expected_parent, expected_property_name) \ EXPECT_FRAME(frame, sourcemeta::core::SchemaReferenceType::Static, \ reference, root_id, expected_pointer, expected_dialect, \ expected_base_dialect, expected_base, \ - expected_relative_pointer, expected_parent) + expected_relative_pointer, expected_parent, \ + expected_property_name) #define EXPECT_FRAME_STATIC_RESOURCE( \ frame, reference, root_id, expected_pointer, expected_dialect, \ expected_base_dialect, expected_base, expected_relative_pointer, \ - expected_parent) \ + expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC(frame, reference, root_id, expected_pointer, \ expected_dialect, expected_base_dialect, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, \ + expected_property_name) \ EXPECT_EQ( \ (frame) \ .locations() \ @@ -104,10 +109,11 @@ #define EXPECT_FRAME_STATIC_POINTER( \ frame, reference, root_id, expected_pointer, expected_dialect, \ expected_base_dialect, expected_base, expected_relative_pointer, \ - expected_parent) \ + expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC(frame, reference, root_id, expected_pointer, \ expected_dialect, expected_base_dialect, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, \ + expected_property_name) \ EXPECT_EQ( \ (frame) \ .locations() \ @@ -118,10 +124,11 @@ #define EXPECT_FRAME_STATIC_SUBSCHEMA( \ frame, reference, root_id, expected_pointer, expected_dialect, \ expected_base_dialect, expected_base, expected_relative_pointer, \ - expected_parent) \ + expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC(frame, reference, root_id, expected_pointer, \ expected_dialect, expected_base_dialect, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, \ + expected_property_name) \ EXPECT_EQ( \ (frame) \ .locations() \ @@ -129,13 +136,14 @@ .type, \ sourcemeta::core::SchemaFrame::LocationType::Subschema); -#define EXPECT_FRAME_STATIC_ANCHOR(frame, reference, root_id, \ - expected_pointer, expected_dialect, \ - expected_base_dialect, expected_base, \ - expected_relative_pointer, expected_parent) \ +#define EXPECT_FRAME_STATIC_ANCHOR( \ + frame, reference, root_id, expected_pointer, expected_dialect, \ + expected_base_dialect, expected_base, expected_relative_pointer, \ + expected_parent, expected_property_name) \ EXPECT_FRAME_STATIC(frame, reference, root_id, expected_pointer, \ expected_dialect, expected_base_dialect, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, \ + expected_property_name) \ EXPECT_EQ( \ (frame) \ .locations() \ @@ -146,10 +154,11 @@ #define EXPECT_FRAME_DYNAMIC_ANCHOR( \ frame, reference, root_id, expected_pointer, expected_dialect, \ expected_base_dialect, expected_base, expected_relative_pointer, \ - expected_parent) \ + expected_parent, expected_property_name) \ EXPECT_FRAME_DYNAMIC(frame, reference, root_id, expected_pointer, \ expected_dialect, expected_base_dialect, expected_base, \ - expected_relative_pointer, expected_parent) \ + expected_relative_pointer, expected_parent, \ + expected_property_name) \ EXPECT_EQ( \ (frame) \ .locations() \ @@ -160,15 +169,16 @@ #define EXPECT_FRAME_DYNAMIC(frame, reference, root_id, expected_pointer, \ expected_dialect, expected_base_dialect, \ expected_base, expected_relative_pointer, \ - expected_parent) \ + expected_parent, expected_property_name) \ EXPECT_FRAME(frame, sourcemeta::core::SchemaReferenceType::Dynamic, \ reference, root_id, expected_pointer, expected_dialect, \ expected_base_dialect, expected_base, \ - expected_relative_pointer, expected_parent) + expected_relative_pointer, expected_parent, \ + expected_property_name) -#define __EXPECT_ANONYMOUS_FRAME(frame, expected_type, reference, \ - expected_pointer, expected_dialect, \ - expected_base_dialect, expected_parent) \ +#define __EXPECT_ANONYMOUS_FRAME( \ + frame, expected_type, reference, expected_pointer, expected_dialect, \ + expected_base_dialect, expected_parent, expected_property_name) \ EXPECT_TRUE((frame).locations().contains({(expected_type), (reference)})); \ EXPECT_TRUE((frame).root().empty()); \ EXPECT_EQ( \ @@ -182,23 +192,26 @@ sourcemeta::core::SchemaBaseDialect::expected_base_dialect); \ EXPECT_OPTIONAL_POINTER( \ (frame).locations().at({(expected_type), (reference)}).parent, \ - expected_parent); + expected_parent); \ + EXPECT_EQ( \ + (frame).locations().at({(expected_type), (reference)}).property_name, \ + (expected_property_name)); #define EXPECT_ANONYMOUS_FRAME_STATIC(frame, reference, expected_pointer, \ expected_dialect, expected_base_dialect, \ - expected_parent) \ - __EXPECT_ANONYMOUS_FRAME(frame, \ - sourcemeta::core::SchemaReferenceType::Static, \ - reference, expected_pointer, expected_dialect, \ - expected_base_dialect, expected_parent) + expected_parent, expected_property_name) \ + __EXPECT_ANONYMOUS_FRAME( \ + frame, sourcemeta::core::SchemaReferenceType::Static, reference, \ + expected_pointer, expected_dialect, expected_base_dialect, \ + expected_parent, expected_property_name) #define EXPECT_ANONYMOUS_FRAME_STATIC_RESOURCE( \ frame, reference, expected_pointer, expected_dialect, \ - expected_base_dialect, expected_parent) \ - __EXPECT_ANONYMOUS_FRAME(frame, \ - sourcemeta::core::SchemaReferenceType::Static, \ - reference, expected_pointer, expected_dialect, \ - expected_base_dialect, expected_parent) \ + expected_base_dialect, expected_parent, expected_property_name) \ + __EXPECT_ANONYMOUS_FRAME( \ + frame, sourcemeta::core::SchemaReferenceType::Static, reference, \ + expected_pointer, expected_dialect, expected_base_dialect, \ + expected_parent, expected_property_name) \ EXPECT_EQ( \ (frame) \ .locations() \ @@ -208,11 +221,11 @@ #define EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( \ frame, reference, expected_pointer, expected_dialect, \ - expected_base_dialect, expected_parent) \ - __EXPECT_ANONYMOUS_FRAME(frame, \ - sourcemeta::core::SchemaReferenceType::Static, \ - reference, expected_pointer, expected_dialect, \ - expected_base_dialect, expected_parent) \ + expected_base_dialect, expected_parent, expected_property_name) \ + __EXPECT_ANONYMOUS_FRAME( \ + frame, sourcemeta::core::SchemaReferenceType::Static, reference, \ + expected_pointer, expected_dialect, expected_base_dialect, \ + expected_parent, expected_property_name) \ EXPECT_EQ( \ (frame) \ .locations() \ @@ -222,11 +235,11 @@ #define EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( \ frame, reference, expected_pointer, expected_dialect, \ - expected_base_dialect, expected_parent) \ - __EXPECT_ANONYMOUS_FRAME(frame, \ - sourcemeta::core::SchemaReferenceType::Static, \ - reference, expected_pointer, expected_dialect, \ - expected_base_dialect, expected_parent) \ + expected_base_dialect, expected_parent, expected_property_name) \ + __EXPECT_ANONYMOUS_FRAME( \ + frame, sourcemeta::core::SchemaReferenceType::Static, reference, \ + expected_pointer, expected_dialect, expected_base_dialect, \ + expected_parent, expected_property_name) \ EXPECT_EQ( \ (frame) \ .locations() \ @@ -236,11 +249,11 @@ #define EXPECT_ANONYMOUS_FRAME_STATIC_ANCHOR( \ frame, reference, expected_pointer, expected_dialect, \ - expected_base_dialect, expected_parent) \ - __EXPECT_ANONYMOUS_FRAME(frame, \ - sourcemeta::core::SchemaReferenceType::Static, \ - reference, expected_pointer, expected_dialect, \ - expected_base_dialect, expected_parent) \ + expected_base_dialect, expected_parent, expected_property_name) \ + __EXPECT_ANONYMOUS_FRAME( \ + frame, sourcemeta::core::SchemaReferenceType::Static, reference, \ + expected_pointer, expected_dialect, expected_base_dialect, \ + expected_parent, expected_property_name) \ EXPECT_EQ( \ (frame) \ .locations() \ @@ -250,11 +263,11 @@ #define EXPECT_ANONYMOUS_FRAME_DYNAMIC_ANCHOR( \ frame, reference, expected_pointer, expected_dialect, \ - expected_base_dialect, expected_parent) \ - __EXPECT_ANONYMOUS_FRAME(frame, \ - sourcemeta::core::SchemaReferenceType::Dynamic, \ - reference, expected_pointer, expected_dialect, \ - expected_base_dialect, expected_parent) \ + expected_base_dialect, expected_parent, expected_property_name) \ + __EXPECT_ANONYMOUS_FRAME( \ + frame, sourcemeta::core::SchemaReferenceType::Dynamic, reference, \ + expected_pointer, expected_dialect, expected_base_dialect, \ + expected_parent, expected_property_name) \ EXPECT_EQ( \ (frame) \ .locations() \ @@ -357,7 +370,8 @@ expected_parent_location, \ "http://json-schema.org/draft-06/schema#", \ "http://json-schema.org/draft-06/schema#"); \ - EXPECT_FALSE(entries.at(index).orphan); + EXPECT_FALSE(entries.at(index).orphan); \ + EXPECT_FALSE(entries.at(index).property_name); #define EXPECT_WALKER_ENTRY_DRAFT6_ORPHAN( \ entries, index, expected_schema_location, expected_parent_location) \ @@ -365,7 +379,17 @@ expected_parent_location, \ "http://json-schema.org/draft-06/schema#", \ "http://json-schema.org/draft-06/schema#"); \ - EXPECT_TRUE(entries.at(index).orphan); + EXPECT_TRUE(entries.at(index).orphan); \ + EXPECT_FALSE(entries.at(index).property_name); + +#define EXPECT_WALKER_ENTRY_DRAFT6_PROPERTY_NAME( \ + entries, index, expected_schema_location, expected_parent_location) \ + __EXPECT_WALKER_ENTRY(entries, index, expected_schema_location, \ + expected_parent_location, \ + "http://json-schema.org/draft-06/schema#", \ + "http://json-schema.org/draft-06/schema#"); \ + EXPECT_FALSE(entries.at(index).orphan); \ + EXPECT_TRUE(entries.at(index).property_name); #define EXPECT_WALKER_ENTRY_DRAFT4(entries, index, expected_schema_location, \ expected_parent_location) \ diff --git a/test/jsonschema/jsonschema_walker_draft6_test.cc b/test/jsonschema/jsonschema_walker_draft6_test.cc index c78189bba..8ee4be7ca 100644 --- a/test/jsonschema/jsonschema_walker_draft6_test.cc +++ b/test/jsonschema/jsonschema_walker_draft6_test.cc @@ -838,7 +838,7 @@ TEST(JSONSchema_walker_draft6, instance_locations) { EXPECT_WALKER_ENTRY_DRAFT6(entries, 9, "/patternProperties/^f", ""); EXPECT_WALKER_ENTRY_DRAFT6(entries, 10, "/patternProperties/x$", ""); EXPECT_WALKER_ENTRY_DRAFT6(entries, 11, "/dependencies/baz", ""); - EXPECT_WALKER_ENTRY_DRAFT6(entries, 12, "/propertyNames", ""); + EXPECT_WALKER_ENTRY_DRAFT6_PROPERTY_NAME(entries, 12, "/propertyNames", ""); // Applicators (array) EXPECT_WALKER_ENTRY_DRAFT6(entries, 13, "/contains", ""); @@ -884,3 +884,43 @@ TEST(JSONSchema_walker_draft6, definitions_subschemas) { entries, 3, "/definitions/foo/properties/bar/additionalProperties", "/definitions/foo/properties/bar"); } + +TEST(JSONSchema_walker_draft6, propertyNames_targets) { + const sourcemeta::core::JSON document = sourcemeta::core::parse_json(R"JSON({ + "$schema": "http://json-schema.org/draft-06/schema#", + "propertyNames": { + "anyOf": [ + { "minLength": 1 }, + { "maxLength": 10 } + ], + "additionalProperties": { + "type": "boolean" + }, + "definitions": { + "test": { + "type": "string" + } + } + } + })JSON"); + + std::vector entries; + for (const auto &entry : sourcemeta::core::SchemaIterator( + document, sourcemeta::core::schema_walker, + sourcemeta::core::schema_resolver)) { + entries.push_back(entry); + } + + EXPECT_EQ(entries.size(), 6); + + EXPECT_WALKER_ENTRY_DRAFT6(entries, 0, "", std::nullopt); + EXPECT_WALKER_ENTRY_DRAFT6_PROPERTY_NAME(entries, 1, "/propertyNames", ""); + EXPECT_WALKER_ENTRY_DRAFT6_PROPERTY_NAME(entries, 2, "/propertyNames/anyOf/0", + "/propertyNames"); + EXPECT_WALKER_ENTRY_DRAFT6_PROPERTY_NAME(entries, 3, "/propertyNames/anyOf/1", + "/propertyNames"); + EXPECT_WALKER_ENTRY_DRAFT6(entries, 4, "/propertyNames/additionalProperties", + "/propertyNames"); + EXPECT_WALKER_ENTRY_DRAFT6_ORPHAN( + entries, 5, "/propertyNames/definitions/test", "/propertyNames"); +}