diff --git a/src/core/jsonschema/frame.cc b/src/core/jsonschema/frame.cc index f4293a227..a39ac6735 100644 --- a/src/core/jsonschema/frame.cc +++ b/src/core/jsonschema/frame.cc @@ -228,9 +228,6 @@ static auto traverse_origin_instance_locations( destination.push_back(current.value()); } - // TODO: This whole algorithm gets simpler if let Pointer locations - // point to parents, as we can get the Pointer location from a reference - for (const auto &reference : references) { if (reference.first.second.back().to_property() == "$schema") { continue; @@ -258,13 +255,15 @@ static auto traverse_origin_instance_locations( } for (const auto &location : frame) { + // TODO: Simplify this logic given that Pointers now have parents. We can + // stop looking for .initial(), and if the location is not a subschema or + // resource, we just get the parent if (location.second.type != sourcemeta::core::SchemaFrame::LocationType::Resource && location.second.type != sourcemeta::core::SchemaFrame::LocationType::Subschema) { continue; } - if (location.second.pointer != reference.first.second.initial()) { continue; } @@ -715,8 +714,7 @@ auto SchemaFrame::analyse(const JSON &schema, const SchemaWalker &walker, current_base, pointer, pointer.resolve_from(nearest_bases.second), dialects.first.front(), current_base_dialect, {}, - // TODO: Get real parent - std::nullopt); + dialects.second); } } } @@ -900,6 +898,8 @@ auto SchemaFrame::analyse(const JSON &schema, const SchemaWalker &walker, } // This is guaranteed to be top-down + // TODO: Looping over the subschemas array means we never fix-up + // instance locations for anchors for (auto &entry : subschemas) { repopulate_instance_locations( this->instances_, subschemas, this->locations_, entry.first, diff --git a/test/jsonschema/jsonschema_frame_2019_09_test.cc b/test/jsonschema/jsonschema_frame_2019_09_test.cc index 5e382e35b..c9abfb3b3 100644 --- a/test/jsonschema/jsonschema_frame_2019_09_test.cc +++ b/test/jsonschema/jsonschema_frame_2019_09_test.cc @@ -75,14 +75,15 @@ TEST(JSONSchema_frame_2019_09, anonymous_with_nested_schema_resource) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/$id", "/additionalProperties/$id", "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", {}, + "/additionalProperties"); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "https://json-schema.org/draft/2019-09/schema", "https://json-schema.org/draft/2019-09/schema", {""}, std::nullopt); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$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", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalProperties", "/additionalProperties", "https://json-schema.org/draft/2019-09/schema", @@ -90,7 +91,8 @@ TEST(JSONSchema_frame_2019_09, anonymous_with_nested_schema_resource) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalProperties/$id", "/additionalProperties/$id", "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", {}, + "/additionalProperties"); // References @@ -123,11 +125,11 @@ TEST(JSONSchema_frame_2019_09, empty_schema) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); // References @@ -160,11 +162,11 @@ TEST(JSONSchema_frame_2019_09, empty_schema_trailing_hash) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); // References @@ -201,11 +203,11 @@ TEST(JSONSchema_frame_2019_09, one_level_applicators_without_identifiers) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", @@ -213,11 +215,11 @@ TEST(JSONSchema_frame_2019_09, one_level_applicators_without_identifiers) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/items/type", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/properties", {}, ""); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", @@ -226,7 +228,7 @@ TEST(JSONSchema_frame_2019_09, one_level_applicators_without_identifiers) { 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", {}, - std::nullopt); + "/properties/foo"); // References @@ -275,11 +277,11 @@ TEST(JSONSchema_frame_2019_09, one_level_applicators_with_identifiers) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/test/qux", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/test/qux", "/$schema", {}, ""); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/test/qux#/items", "https://www.sourcemeta.com/test/qux", "/items", @@ -287,15 +289,15 @@ TEST(JSONSchema_frame_2019_09, one_level_applicators_with_identifiers) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/$id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/test/qux", "/properties", {}, ""); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/test/qux#/properties/foo", "https://www.sourcemeta.com/test/qux", "/properties/foo", @@ -304,21 +306,21 @@ TEST(JSONSchema_frame_2019_09, one_level_applicators_with_identifiers) { 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", {}, - std::nullopt); + "/properties/foo"); 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", {}, - std::nullopt); + "/properties/foo"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/$id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); // References @@ -359,11 +361,11 @@ TEST(JSONSchema_frame_2019_09, subschema_absolute_identifier) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", @@ -371,19 +373,19 @@ TEST(JSONSchema_frame_2019_09, subschema_absolute_identifier) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/$id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/$id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); // References @@ -460,15 +462,15 @@ TEST(JSONSchema_frame_2019_09, nested_schemas) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/properties", {}, ""); // foo EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( @@ -478,11 +480,11 @@ TEST(JSONSchema_frame_2019_09, nested_schemas) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/$id", {}, "/properties/foo"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/$anchor", {}, "/properties/foo"); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo/items", "https://www.sourcemeta.com/schema", "/properties/foo/items", @@ -490,16 +492,16 @@ TEST(JSONSchema_frame_2019_09, nested_schemas) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/qux", "/$id", {}, "/properties/foo/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/$id", {}, "/properties/foo"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/$anchor", {}, "/properties/foo"); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/foo#/items", "https://www.sourcemeta.com/schema", "/properties/foo/items", @@ -507,11 +509,11 @@ TEST(JSONSchema_frame_2019_09, nested_schemas) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/qux", "/$id", {}, "/properties/foo/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/qux", "/$id", {}, "/properties/foo/items"); // bar EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( @@ -521,11 +523,11 @@ TEST(JSONSchema_frame_2019_09, nested_schemas) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/bar", "/$id", {}, "/properties/bar"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/bar", "/$id", {}, "/properties/bar"); // baz EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( @@ -535,7 +537,7 @@ TEST(JSONSchema_frame_2019_09, nested_schemas) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/baz", "/$id", {}, "/properties/baz"); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/baz/items", "https://www.sourcemeta.com/schema", "/properties/baz/items", @@ -544,12 +546,13 @@ TEST(JSONSchema_frame_2019_09, nested_schemas) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/baz", "/items/$anchor", {}, + "/properties/baz/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/baz", "/$id", {}, "/properties/baz"); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/baz#/items", "https://www.sourcemeta.com/schema", "/properties/baz/items", @@ -558,7 +561,8 @@ TEST(JSONSchema_frame_2019_09, nested_schemas) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/baz", "/items/$anchor", {}, + "/properties/baz/items"); // References @@ -622,11 +626,11 @@ TEST(JSONSchema_frame_2019_09, explicit_argument_id_same) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); // References @@ -658,15 +662,15 @@ TEST(JSONSchema_frame_2019_09, anchor_top_level) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$anchor", {}, ""); // Anchors @@ -757,11 +761,11 @@ TEST(JSONSchema_frame_2019_09, explicit_argument_id_different) { EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", "https://www.example.com", - "/$id", {}, std::nullopt); + "/$id", {}, ""); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.example.com", "/$schema", {}, std::nullopt); + "https://www.example.com", "/$schema", {}, ""); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", "https://www.example.com", @@ -769,11 +773,11 @@ TEST(JSONSchema_frame_2019_09, explicit_argument_id_different) { EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/items/$anchor", "https://www.sourcemeta.com/schema", "/items/$anchor", - "https://www.example.com", "/items/$anchor", {}, std::nullopt); + "https://www.example.com", "/items/$anchor", {}, "/items"); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.example.com", "/properties", {}, std::nullopt); + "https://www.example.com", "/properties", {}, ""); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/one", "https://www.sourcemeta.com/schema", "/properties/one", @@ -781,11 +785,11 @@ TEST(JSONSchema_frame_2019_09, explicit_argument_id_different) { 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.example.com/test", "/$id", {}, std::nullopt); + "https://www.example.com/test", "/$id", {}, "/properties/one"); 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.example.com/test", "/$anchor", {}, std::nullopt); + "https://www.example.com/test", "/$anchor", {}, "/properties/one"); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/two", "https://www.sourcemeta.com/schema", "/properties/two", @@ -793,26 +797,27 @@ TEST(JSONSchema_frame_2019_09, explicit_argument_id_different) { 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", {}, std::nullopt); + "https://www.test.com", "/$id", {}, "/properties/two"); 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", {}, std::nullopt); + "https://www.test.com", "/$anchor", {}, "/properties/two"); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/test#/$id", "https://www.sourcemeta.com/schema", "/properties/one/$id", - "https://www.example.com/test", "/$id", {}, std::nullopt); + "https://www.example.com/test", "/$id", {}, "/properties/one"); EXPECT_FRAME_STATIC_2019_09_POINTER( frame, "https://www.sourcemeta.com/test#/$anchor", "https://www.sourcemeta.com/schema", "/properties/one/$anchor", - "https://www.example.com/test", "/$anchor", {}, std::nullopt); + "https://www.example.com/test", "/$anchor", {}, "/properties/one"); 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", {}, std::nullopt); + "/properties/two/$id", "https://www.test.com", "/$id", {}, + "/properties/two"); 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", {}, std::nullopt); + "https://www.test.com", "/$anchor", {}, "/properties/two"); // References @@ -842,10 +847,10 @@ TEST(JSONSchema_frame_2019_09, ref_metaschema) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$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", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "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", {}, ""); // References @@ -913,16 +918,15 @@ TEST(JSONSchema_frame_2019_09, recursive_anchor_true_with_id) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); 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", {}, - std::nullopt); + "https://www.sourcemeta.com/schema", "/$recursiveAnchor", {}, ""); // References @@ -959,16 +963,15 @@ TEST(JSONSchema_frame_2019_09, recursive_anchor_false_with_id) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); 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", {}, - std::nullopt); + "https://www.sourcemeta.com/schema", "/$recursiveAnchor", {}, ""); // References @@ -1011,11 +1014,11 @@ TEST(JSONSchema_frame_2019_09, recursive_anchor_true_without_id) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$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", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties", "/properties", "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", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/properties/foo", "/properties/foo", "https://json-schema.org/draft/2019-09/schema", @@ -1024,7 +1027,7 @@ TEST(JSONSchema_frame_2019_09, recursive_anchor_true_without_id) { frame, "#/properties/foo/$recursiveAnchor", "/properties/foo/$recursiveAnchor", "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", {}, "/properties/foo"); // References @@ -1060,11 +1063,11 @@ TEST(JSONSchema_frame_2019_09, recursive_anchor_false_without_id) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$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", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties", "/properties", "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", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/properties/foo", "/properties/foo", "https://json-schema.org/draft/2019-09/schema", @@ -1073,7 +1076,7 @@ TEST(JSONSchema_frame_2019_09, recursive_anchor_false_without_id) { frame, "#/properties/foo/$recursiveAnchor", "/properties/foo/$recursiveAnchor", "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", {}, "/properties/foo"); // References @@ -1106,7 +1109,7 @@ TEST(JSONSchema_frame_2019_09, recursive_ref_no_recursive_anchor_anonymous) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$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", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalItems", "/additionalItems", "https://json-schema.org/draft/2019-09/schema", @@ -1115,7 +1118,7 @@ TEST(JSONSchema_frame_2019_09, recursive_ref_no_recursive_anchor_anonymous) { frame, "#/additionalItems/$recursiveRef", "/additionalItems/$recursiveRef", "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", {}, "/additionalItems"); // References @@ -1153,11 +1156,11 @@ TEST(JSONSchema_frame_2019_09, recursive_ref_no_recursive_anchor) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/additionalItems", "https://www.sourcemeta.com/schema", "/additionalItems", @@ -1166,7 +1169,7 @@ TEST(JSONSchema_frame_2019_09, recursive_ref_no_recursive_anchor) { frame, "https://www.sourcemeta.com/schema#/additionalItems/$recursiveRef", "https://www.sourcemeta.com/schema", "/additionalItems/$recursiveRef", "https://www.sourcemeta.com/schema", "/additionalItems/$recursiveRef", {}, - std::nullopt); + "/additionalItems"); // References @@ -1203,11 +1206,11 @@ TEST(JSONSchema_frame_2019_09, recursive_ref_recursive_anchor_false_anonymous) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$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", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$recursiveAnchor", "/$recursiveAnchor", "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", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalItems", "/additionalItems", "https://json-schema.org/draft/2019-09/schema", @@ -1216,7 +1219,7 @@ TEST(JSONSchema_frame_2019_09, recursive_ref_recursive_anchor_false_anonymous) { frame, "#/additionalItems/$recursiveRef", "/additionalItems/$recursiveRef", "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", {}, "/additionalItems"); // References @@ -1255,16 +1258,15 @@ TEST(JSONSchema_frame_2019_09, recursive_ref_recursive_anchor_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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); 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", {}, - std::nullopt); + "https://www.sourcemeta.com/schema", "/$recursiveAnchor", {}, ""); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/additionalItems", "https://www.sourcemeta.com/schema", "/additionalItems", @@ -1273,7 +1275,7 @@ TEST(JSONSchema_frame_2019_09, recursive_ref_recursive_anchor_false) { frame, "https://www.sourcemeta.com/schema#/additionalItems/$recursiveRef", "https://www.sourcemeta.com/schema", "/additionalItems/$recursiveRef", "https://www.sourcemeta.com/schema", "/additionalItems/$recursiveRef", {}, - std::nullopt); + "/additionalItems"); // References @@ -1310,11 +1312,11 @@ TEST(JSONSchema_frame_2019_09, recursive_ref_recursive_anchor_true_anonymous) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$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", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$recursiveAnchor", "/$recursiveAnchor", "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", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalItems", "/additionalItems", "https://json-schema.org/draft/2019-09/schema", @@ -1323,7 +1325,7 @@ TEST(JSONSchema_frame_2019_09, recursive_ref_recursive_anchor_true_anonymous) { frame, "#/additionalItems/$recursiveRef", "/additionalItems/$recursiveRef", "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", {}, "/additionalItems"); // Anchors @@ -1369,16 +1371,15 @@ TEST(JSONSchema_frame_2019_09, recursive_ref_recursive_anchor_true) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); 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", {}, - std::nullopt); + "https://www.sourcemeta.com/schema", "/$recursiveAnchor", {}, ""); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/additionalItems", "https://www.sourcemeta.com/schema", "/additionalItems", @@ -1387,7 +1388,7 @@ TEST(JSONSchema_frame_2019_09, recursive_ref_recursive_anchor_true) { frame, "https://www.sourcemeta.com/schema#/additionalItems/$recursiveRef", "https://www.sourcemeta.com/schema", "/additionalItems/$recursiveRef", "https://www.sourcemeta.com/schema", "/additionalItems/$recursiveRef", {}, - std::nullopt); + "/additionalItems"); // Anchors @@ -1438,7 +1439,7 @@ TEST(JSONSchema_frame_2019_09, EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$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", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalItems", "/additionalItems", "https://json-schema.org/draft/2019-09/schema", @@ -1446,32 +1447,32 @@ TEST(JSONSchema_frame_2019_09, EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalItems/$id", "/additionalItems/$id", "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", {}, "/additionalItems"); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalItems/$recursiveAnchor", "/additionalItems/$recursiveAnchor", "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", {}, "/additionalItems"); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalItems/$recursiveRef", "/additionalItems/$recursiveRef", "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", {}, "/additionalItems"); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/$id", "/additionalItems/$id", "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", {}, "/additionalItems"); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/$recursiveAnchor", "/additionalItems/$recursiveAnchor", "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", {}, "/additionalItems"); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/$recursiveRef", "/additionalItems/$recursiveRef", "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", {}, "/additionalItems"); // References @@ -1514,7 +1515,7 @@ TEST(JSONSchema_frame_2019_09, EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$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", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalItems", "/additionalItems", "https://json-schema.org/draft/2019-09/schema", @@ -1522,32 +1523,32 @@ TEST(JSONSchema_frame_2019_09, EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalItems/$id", "/additionalItems/$id", "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", {}, "/additionalItems"); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalItems/$recursiveAnchor", "/additionalItems/$recursiveAnchor", "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", {}, "/additionalItems"); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalItems/$recursiveRef", "/additionalItems/$recursiveRef", "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", {}, "/additionalItems"); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/$id", "/additionalItems/$id", "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", {}, "/additionalItems"); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/$recursiveAnchor", "/additionalItems/$recursiveAnchor", "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", {}, "/additionalItems"); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/$recursiveRef", "/additionalItems/$recursiveRef", "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", {}, "/additionalItems"); // Anchors @@ -1594,17 +1595,17 @@ TEST(JSONSchema_frame_2019_09, recursive_ref_nested_recursive_anchor_true) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); 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", - {}, std::nullopt); + {}, "/additionalItems"); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/additionalItems", "https://www.sourcemeta.com/schema", "/additionalItems", @@ -1613,7 +1614,7 @@ TEST(JSONSchema_frame_2019_09, recursive_ref_nested_recursive_anchor_true) { frame, "https://www.sourcemeta.com/schema#/additionalItems/$recursiveRef", "https://www.sourcemeta.com/schema", "/additionalItems/$recursiveRef", "https://www.sourcemeta.com/schema", "/additionalItems/$recursiveRef", {}, - std::nullopt); + "/additionalItems"); // Anchors @@ -1665,16 +1666,15 @@ TEST(JSONSchema_frame_2019_09, recursive_ref_multiple_recursive_anchor_true) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); 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", {}, - std::nullopt); + "https://www.sourcemeta.com/schema", "/$recursiveAnchor", {}, ""); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/additionalItems", "https://www.sourcemeta.com/schema", "/additionalItems", @@ -1682,31 +1682,33 @@ TEST(JSONSchema_frame_2019_09, recursive_ref_multiple_recursive_anchor_true) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/nested", "/$id", {}, "/additionalItems"); 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", {}, - std::nullopt); + "/additionalItems"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/nested", "/$recursiveRef", {}, + "/additionalItems"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/nested", "/$id", {}, "/additionalItems"); 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", {}, - std::nullopt); + "/additionalItems"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/nested", "/$recursiveRef", {}, + "/additionalItems"); // Anchors @@ -1795,11 +1797,11 @@ TEST(JSONSchema_frame_2019_09, recursive_anchor_on_relative_id) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$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", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$recursiveAnchor", "/$recursiveAnchor", "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", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalItems", "/additionalItems", @@ -1808,16 +1810,16 @@ TEST(JSONSchema_frame_2019_09, recursive_anchor_on_relative_id) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalItems/$id", "/additionalItems/$id", "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", {}, "/additionalItems"); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalItems/$recursiveAnchor", "/additionalItems/$recursiveAnchor", "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", {}, "/additionalItems"); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "middle#/$recursiveAnchor", "/additionalItems/$recursiveAnchor", "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", {}, "/additionalItems"); // Anchors @@ -1865,19 +1867,19 @@ TEST(JSONSchema_frame_2019_09, ref_with_id) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$ref", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$defs", {}, ""); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/$defs/string", "https://www.sourcemeta.com/schema", "/$defs/string", @@ -1886,7 +1888,7 @@ TEST(JSONSchema_frame_2019_09, ref_with_id) { 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", {}, - std::nullopt); + "/$defs/string"); // References @@ -1928,19 +1930,19 @@ TEST(JSONSchema_frame_2019_09, ref_from_definitions) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$ref", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/definitions", {}, ""); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/definitions/middle", "https://www.sourcemeta.com/schema", "/definitions/middle", @@ -1949,7 +1951,7 @@ TEST(JSONSchema_frame_2019_09, ref_from_definitions) { 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", {}, - std::nullopt); + "/definitions/middle"); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/definitions/string", "https://www.sourcemeta.com/schema", "/definitions/string", @@ -1958,7 +1960,7 @@ TEST(JSONSchema_frame_2019_09, ref_from_definitions) { 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", {}, - std::nullopt); + "/definitions/string"); // References @@ -1995,10 +1997,9 @@ TEST(JSONSchema_frame_2019_09, relative_base_uri_without_ref) { // JSON Pointers EXPECT_FRAME_STATIC_2019_09_POINTER(frame, "common#/$schema", "common", - "/$schema", "common", "/$schema", {}, - std::nullopt); + "/$schema", "common", "/$schema", {}, ""); EXPECT_FRAME_STATIC_2019_09_POINTER(frame, "common#/$id", "common", "/$id", - "common", "/$id", {}, std::nullopt); + "common", "/$id", {}, ""); // References @@ -2039,28 +2040,25 @@ TEST(JSONSchema_frame_2019_09, relative_base_uri_with_ref) { // JSON Pointers EXPECT_FRAME_STATIC_2019_09_POINTER(frame, "common#/$schema", "common", - "/$schema", "common", "/$schema", {}, - std::nullopt); + "/$schema", "common", "/$schema", {}, ""); EXPECT_FRAME_STATIC_2019_09_POINTER(frame, "common#/$id", "common", "/$id", - "common", "/$id", {}, std::nullopt); + "common", "/$id", {}, ""); EXPECT_FRAME_STATIC_2019_09_POINTER(frame, "common#/allOf", "common", - "/allOf", "common", "/allOf", {}, - std::nullopt); + "/allOf", "common", "/allOf", {}, ""); EXPECT_FRAME_STATIC_2019_09_SUBSCHEMA(frame, "common#/allOf/0", "common", "/allOf/0", "common", "/allOf/0", {""}, ""); EXPECT_FRAME_STATIC_2019_09_POINTER(frame, "common#/allOf/0/$ref", "common", "/allOf/0/$ref", "common", - "/allOf/0/$ref", {}, std::nullopt); + "/allOf/0/$ref", {}, "/allOf/0"); EXPECT_FRAME_STATIC_2019_09_POINTER(frame, "common#/$defs", "common", - "/$defs", "common", "/$defs", {}, - std::nullopt); + "/$defs", "common", "/$defs", {}, ""); 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", {}, std::nullopt); + "/$defs/foo/$anchor", {}, "/$defs/foo"); // References @@ -2091,10 +2089,9 @@ TEST(JSONSchema_frame_2019_09, relative_id_leading_slash) { // JSON Pointers EXPECT_FRAME_STATIC_2019_09_POINTER(frame, "/base#/$id", "/base", "/$id", - "/base", "/$id", {}, std::nullopt); + "/base", "/$id", {}, ""); EXPECT_FRAME_STATIC_2019_09_POINTER(frame, "/base#/$schema", "/base", - "/$schema", "/base", "/$schema", {}, - std::nullopt); + "/$schema", "/base", "/$schema", {}, ""); // References diff --git a/test/jsonschema/jsonschema_frame_2020_12_test.cc b/test/jsonschema/jsonschema_frame_2020_12_test.cc index b4f6309d0..90c373288 100644 --- a/test/jsonschema/jsonschema_frame_2020_12_test.cc +++ b/test/jsonschema/jsonschema_frame_2020_12_test.cc @@ -72,7 +72,8 @@ TEST(JSONSchema_frame_2020_12, anonymous_with_nested_schema_resource) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/$id", "/additionalProperties/$id", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", {}, std::nullopt); + "https://json-schema.org/draft/2020-12/schema", {}, + "/additionalProperties"); // JSON Pointers @@ -82,7 +83,7 @@ TEST(JSONSchema_frame_2020_12, anonymous_with_nested_schema_resource) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", {}, std::nullopt); + "https://json-schema.org/draft/2020-12/schema", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalProperties", "/additionalProperties", "https://json-schema.org/draft/2020-12/schema", @@ -90,7 +91,8 @@ TEST(JSONSchema_frame_2020_12, anonymous_with_nested_schema_resource) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalProperties/$id", "/additionalProperties/$id", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", {}, std::nullopt); + "https://json-schema.org/draft/2020-12/schema", {}, + "/additionalProperties"); // References @@ -123,11 +125,11 @@ TEST(JSONSchema_frame_2020_12, empty_schema) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); // References @@ -160,11 +162,11 @@ TEST(JSONSchema_frame_2020_12, empty_schema_trailing_hash) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); // References @@ -201,11 +203,11 @@ TEST(JSONSchema_frame_2020_12, one_level_applicators_without_identifiers) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", @@ -213,11 +215,11 @@ TEST(JSONSchema_frame_2020_12, one_level_applicators_without_identifiers) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/items/type", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/properties", {}, ""); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", @@ -226,7 +228,7 @@ TEST(JSONSchema_frame_2020_12, one_level_applicators_without_identifiers) { 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", {}, - std::nullopt); + "/properties/foo"); // References @@ -274,11 +276,11 @@ TEST(JSONSchema_frame_2020_12, one_level_applicators_with_identifiers) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/test/qux", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/test/qux", "/$schema", {}, ""); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/test/qux#/items", "https://www.sourcemeta.com/test/qux", "/items", @@ -286,15 +288,15 @@ TEST(JSONSchema_frame_2020_12, one_level_applicators_with_identifiers) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/$id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/test/qux", "/properties", {}, ""); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/test/qux#/properties/foo", "https://www.sourcemeta.com/test/qux", "/properties/foo", @@ -303,21 +305,21 @@ TEST(JSONSchema_frame_2020_12, one_level_applicators_with_identifiers) { 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", {}, - std::nullopt); + "/properties/foo"); 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", {}, - std::nullopt); + "/properties/foo"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/$id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); // References @@ -358,11 +360,11 @@ TEST(JSONSchema_frame_2020_12, subschema_absolute_identifier) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", @@ -370,11 +372,11 @@ TEST(JSONSchema_frame_2020_12, subschema_absolute_identifier) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/$id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); // References @@ -451,15 +453,15 @@ TEST(JSONSchema_frame_2020_12, nested_schemas) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/properties", {}, ""); // foo EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( @@ -469,11 +471,11 @@ TEST(JSONSchema_frame_2020_12, nested_schemas) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/$id", {}, "/properties/foo"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/$anchor", {}, "/properties/foo"); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo/items", "https://www.sourcemeta.com/schema", "/properties/foo/items", @@ -481,16 +483,16 @@ TEST(JSONSchema_frame_2020_12, nested_schemas) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/qux", "/$id", {}, "/properties/foo/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/$id", {}, "/properties/foo"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/$anchor", {}, "/properties/foo"); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/foo#/items", "https://www.sourcemeta.com/schema", "/properties/foo/items", @@ -498,11 +500,11 @@ TEST(JSONSchema_frame_2020_12, nested_schemas) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/qux", "/$id", {}, "/properties/foo/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/qux", "/$id", {}, "/properties/foo/items"); // bar EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( @@ -512,11 +514,11 @@ TEST(JSONSchema_frame_2020_12, nested_schemas) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/bar", "/$id", {}, "/properties/bar"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/bar", "/$id", {}, "/properties/bar"); // baz EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( @@ -526,7 +528,7 @@ TEST(JSONSchema_frame_2020_12, nested_schemas) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/baz", "/$id", {}, "/properties/baz"); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/baz/items", "https://www.sourcemeta.com/schema", "/properties/baz/items", @@ -535,12 +537,13 @@ TEST(JSONSchema_frame_2020_12, nested_schemas) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/baz", "/items/$anchor", {}, + "/properties/baz/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/baz", "/$id", {}, "/properties/baz"); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/baz#/items", "https://www.sourcemeta.com/schema", "/properties/baz/items", @@ -549,7 +552,8 @@ TEST(JSONSchema_frame_2020_12, nested_schemas) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/baz", "/items/$anchor", {}, + "/properties/baz/items"); // References @@ -613,11 +617,11 @@ TEST(JSONSchema_frame_2020_12, explicit_argument_id_same) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); // References @@ -649,15 +653,15 @@ TEST(JSONSchema_frame_2020_12, anchor_top_level) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$anchor", {}, ""); // Anchors @@ -748,11 +752,11 @@ TEST(JSONSchema_frame_2020_12, explicit_argument_id_different) { EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", "https://www.example.com", - "/$id", {}, std::nullopt); + "/$id", {}, ""); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.example.com", "/$schema", {}, std::nullopt); + "https://www.example.com", "/$schema", {}, ""); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", "https://www.example.com", @@ -760,11 +764,11 @@ TEST(JSONSchema_frame_2020_12, explicit_argument_id_different) { EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/items/$anchor", "https://www.sourcemeta.com/schema", "/items/$anchor", - "https://www.example.com", "/items/$anchor", {}, std::nullopt); + "https://www.example.com", "/items/$anchor", {}, "/items"); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.example.com", "/properties", {}, std::nullopt); + "https://www.example.com", "/properties", {}, ""); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/one", "https://www.sourcemeta.com/schema", "/properties/one", @@ -772,11 +776,11 @@ TEST(JSONSchema_frame_2020_12, explicit_argument_id_different) { 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.example.com/test", "/$id", {}, std::nullopt); + "https://www.example.com/test", "/$id", {}, "/properties/one"); 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.example.com/test", "/$anchor", {}, std::nullopt); + "https://www.example.com/test", "/$anchor", {}, "/properties/one"); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/two", "https://www.sourcemeta.com/schema", "/properties/two", @@ -784,26 +788,27 @@ TEST(JSONSchema_frame_2020_12, explicit_argument_id_different) { 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", {}, std::nullopt); + "https://www.test.com", "/$id", {}, "/properties/two"); 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", {}, std::nullopt); + "https://www.test.com", "/$anchor", {}, "/properties/two"); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/test#/$id", "https://www.sourcemeta.com/schema", "/properties/one/$id", - "https://www.example.com/test", "/$id", {}, std::nullopt); + "https://www.example.com/test", "/$id", {}, "/properties/one"); EXPECT_FRAME_STATIC_2020_12_POINTER( frame, "https://www.sourcemeta.com/test#/$anchor", "https://www.sourcemeta.com/schema", "/properties/one/$anchor", - "https://www.example.com/test", "/$anchor", {}, std::nullopt); + "https://www.example.com/test", "/$anchor", {}, "/properties/one"); 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", {}, std::nullopt); + "/properties/two/$id", "https://www.test.com", "/$id", {}, + "/properties/two"); 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", {}, std::nullopt); + "https://www.test.com", "/$anchor", {}, "/properties/two"); // References @@ -1099,19 +1104,19 @@ TEST(JSONSchema_frame_2020_12, dynamic_anchor_with_id) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$dynamicAnchor", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/properties", {}, ""); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", @@ -1120,7 +1125,7 @@ TEST(JSONSchema_frame_2020_12, dynamic_anchor_with_id) { 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", {}, - std::nullopt); + "/properties/foo"); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/bar", "https://www.sourcemeta.com/schema", "/properties/bar", @@ -1128,27 +1133,29 @@ TEST(JSONSchema_frame_2020_12, dynamic_anchor_with_id) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/bar", "/$id", {}, "/properties/bar"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/bar", "/$dynamicAnchor", {}, + "/properties/bar"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/bar", "/$anchor", {}, "/properties/bar"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/bar", "/$id", {}, "/properties/bar"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/bar", "/$dynamicAnchor", {}, + "/properties/bar"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/bar", "/$anchor", {}, "/properties/bar"); // References @@ -1195,11 +1202,11 @@ TEST(JSONSchema_frame_2020_12, dynamic_anchor_without_id) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", {}, std::nullopt); + "https://json-schema.org/draft/2020-12/schema", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties", "/properties", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", {}, std::nullopt); + "https://json-schema.org/draft/2020-12/schema", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/properties/foo", "/properties/foo", "https://json-schema.org/draft/2020-12/schema", @@ -1208,7 +1215,7 @@ TEST(JSONSchema_frame_2020_12, dynamic_anchor_without_id) { frame, "#/properties/foo/$dynamicAnchor", "/properties/foo/$dynamicAnchor", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", {}, std::nullopt); + "https://json-schema.org/draft/2020-12/schema", {}, "/properties/foo"); // References @@ -1257,15 +1264,15 @@ TEST(JSONSchema_frame_2020_12, EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", {}, std::nullopt); + "https://json-schema.org/draft/2020-12/schema", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$dynamicRef", "/$dynamicRef", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", {}, std::nullopt); + "https://json-schema.org/draft/2020-12/schema", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$defs", "/$defs", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", {}, std::nullopt); + "https://json-schema.org/draft/2020-12/schema", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/$defs/test", "/$defs/test", "https://json-schema.org/draft/2020-12/schema", @@ -1273,7 +1280,7 @@ TEST(JSONSchema_frame_2020_12, EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$defs/test/$dynamicAnchor", "/$defs/test/$dynamicAnchor", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", {}, std::nullopt); + "https://json-schema.org/draft/2020-12/schema", {}, "/$defs/test"); // References @@ -1325,15 +1332,15 @@ TEST(JSONSchema_frame_2020_12, dynamic_ref_to_single_dynamic_anchor_external) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", {}, std::nullopt); + "https://json-schema.org/draft/2020-12/schema", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$dynamicRef", "/$dynamicRef", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", {}, std::nullopt); + "https://json-schema.org/draft/2020-12/schema", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$defs", "/$defs", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", {}, std::nullopt); + "https://json-schema.org/draft/2020-12/schema", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/$defs/test", "/$defs/test", "https://json-schema.org/draft/2020-12/schema", @@ -1341,7 +1348,7 @@ TEST(JSONSchema_frame_2020_12, dynamic_ref_to_single_dynamic_anchor_external) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$defs/test/$dynamicAnchor", "/$defs/test/$dynamicAnchor", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", {}, std::nullopt); + "https://json-schema.org/draft/2020-12/schema", {}, "/$defs/test"); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/$defs/foo", "/$defs/foo", "https://json-schema.org/draft/2020-12/schema", @@ -1349,7 +1356,7 @@ TEST(JSONSchema_frame_2020_12, dynamic_ref_to_single_dynamic_anchor_external) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$defs/foo/$ref", "/$defs/foo/$ref", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", {}, std::nullopt); + "https://json-schema.org/draft/2020-12/schema", {}, "/$defs/foo"); // References @@ -1405,11 +1412,11 @@ TEST(JSONSchema_frame_2020_12, no_id_recursive_empty_pointer) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", {}, std::nullopt); + "https://json-schema.org/draft/2020-12/schema", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties", "/properties", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", {}, std::nullopt); + "https://json-schema.org/draft/2020-12/schema", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/properties/foo", "/properties/foo", "https://json-schema.org/draft/2020-12/schema", @@ -1417,7 +1424,7 @@ TEST(JSONSchema_frame_2020_12, no_id_recursive_empty_pointer) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/$ref", "/properties/foo/$ref", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", {}, std::nullopt); + "https://json-schema.org/draft/2020-12/schema", {}, "/properties/foo"); // References @@ -1449,10 +1456,10 @@ TEST(JSONSchema_frame_2020_12, ref_metaschema) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", {}, std::nullopt); + "https://json-schema.org/draft/2020-12/schema", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", {}, std::nullopt); + "https://json-schema.org/draft/2020-12/schema", {}, ""); // References @@ -1514,19 +1521,19 @@ TEST(JSONSchema_frame_2020_12, ref_with_id) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$ref", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$defs", {}, ""); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/$defs/string", "https://www.sourcemeta.com/schema", "/$defs/string", @@ -1535,7 +1542,7 @@ TEST(JSONSchema_frame_2020_12, ref_with_id) { 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", {}, - std::nullopt); + "/$defs/string"); // References @@ -1577,19 +1584,19 @@ TEST(JSONSchema_frame_2020_12, ref_from_definitions) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$ref", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/definitions", {}, ""); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/definitions/middle", "https://www.sourcemeta.com/schema", "/definitions/middle", @@ -1598,7 +1605,7 @@ TEST(JSONSchema_frame_2020_12, ref_from_definitions) { 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", {}, - std::nullopt); + "/definitions/middle"); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/definitions/string", "https://www.sourcemeta.com/schema", "/definitions/string", @@ -1607,7 +1614,7 @@ TEST(JSONSchema_frame_2020_12, ref_from_definitions) { 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", {}, - std::nullopt); + "/definitions/string"); // References @@ -1644,10 +1651,9 @@ TEST(JSONSchema_frame_2020_12, relative_base_uri_without_ref) { // JSON Pointers EXPECT_FRAME_STATIC_2020_12_POINTER(frame, "common#/$schema", "common", - "/$schema", "common", "/$schema", {}, - std::nullopt); + "/$schema", "common", "/$schema", {}, ""); EXPECT_FRAME_STATIC_2020_12_POINTER(frame, "common#/$id", "common", "/$id", - "common", "/$id", {}, std::nullopt); + "common", "/$id", {}, ""); // References @@ -1688,28 +1694,25 @@ TEST(JSONSchema_frame_2020_12, relative_base_uri_with_ref) { // JSON Pointers EXPECT_FRAME_STATIC_2020_12_POINTER(frame, "common#/$schema", "common", - "/$schema", "common", "/$schema", {}, - std::nullopt); + "/$schema", "common", "/$schema", {}, ""); EXPECT_FRAME_STATIC_2020_12_POINTER(frame, "common#/$id", "common", "/$id", - "common", "/$id", {}, std::nullopt); + "common", "/$id", {}, ""); EXPECT_FRAME_STATIC_2020_12_POINTER(frame, "common#/allOf", "common", - "/allOf", "common", "/allOf", {}, - std::nullopt); + "/allOf", "common", "/allOf", {}, ""); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA(frame, "common#/allOf/0", "common", "/allOf/0", "common", "/allOf/0", {""}, ""); EXPECT_FRAME_STATIC_2020_12_POINTER(frame, "common#/allOf/0/$ref", "common", "/allOf/0/$ref", "common", - "/allOf/0/$ref", {}, std::nullopt); + "/allOf/0/$ref", {}, "/allOf/0"); EXPECT_FRAME_STATIC_2020_12_POINTER(frame, "common#/$defs", "common", - "/$defs", "common", "/$defs", {}, - std::nullopt); + "/$defs", "common", "/$defs", {}, ""); 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", {}, std::nullopt); + "/$defs/foo/$anchor", {}, "/$defs/foo"); // References @@ -1754,19 +1757,19 @@ TEST(JSONSchema_frame_2020_12, idempotent_with_refs) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$ref", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$defs", {}, ""); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/$defs/string", "https://www.sourcemeta.com/schema", "/$defs/string", @@ -1848,16 +1851,16 @@ TEST(JSONSchema_frame_2020_12, properties_with_refs) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/properties", {}, ""); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", @@ -1867,7 +1870,7 @@ TEST(JSONSchema_frame_2020_12, properties_with_refs) { 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", {}, - std::nullopt); + "/properties/foo"); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/bar", @@ -1878,7 +1881,7 @@ TEST(JSONSchema_frame_2020_12, properties_with_refs) { 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", {}, - std::nullopt); + "/properties/bar"); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/baz", @@ -1893,7 +1896,7 @@ TEST(JSONSchema_frame_2020_12, properties_with_refs) { 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", {}, - std::nullopt); + "/properties/baz/items"); // References @@ -1952,16 +1955,16 @@ TEST(JSONSchema_frame_2020_12, property_ref_defs) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/properties", {}, ""); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", @@ -1970,7 +1973,7 @@ TEST(JSONSchema_frame_2020_12, property_ref_defs) { 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", {}, - std::nullopt); + "/properties/foo"); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/bar", "https://www.sourcemeta.com/schema", "/properties/bar", @@ -1979,12 +1982,12 @@ TEST(JSONSchema_frame_2020_12, property_ref_defs) { 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", {}, - std::nullopt); + "/properties/bar"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$defs", {}, ""); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/$defs/helper", "https://www.sourcemeta.com/schema", "/$defs/helper", @@ -2010,7 +2013,8 @@ TEST(JSONSchema_frame_2020_12, property_ref_defs) { "https://www.sourcemeta.com/schema", "/$defs/helper/items/additionalProperties/type", "https://www.sourcemeta.com/schema", - "/$defs/helper/items/additionalProperties/type", {}, std::nullopt); + "/$defs/helper/items/additionalProperties/type", {}, + "/$defs/helper/items/additionalProperties"); // References @@ -2061,16 +2065,16 @@ TEST(JSONSchema_frame_2020_12, property_cross_ref) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/properties", {}, ""); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", @@ -2079,7 +2083,7 @@ TEST(JSONSchema_frame_2020_12, property_cross_ref) { 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", {}, - std::nullopt); + "/properties/foo"); EXPECT_FRAME_STATIC_2020_12_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/bar", "https://www.sourcemeta.com/schema", "/properties/bar", diff --git a/test/jsonschema/jsonschema_frame_draft0_test.cc b/test/jsonschema/jsonschema_frame_draft0_test.cc index f19852494..a0b14ea5a 100644 --- a/test/jsonschema/jsonschema_frame_draft0_test.cc +++ b/test/jsonschema/jsonschema_frame_draft0_test.cc @@ -58,13 +58,14 @@ TEST(JSONSchema_frame_draft0, anonymous_with_nested_schema_resource) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/id", "/additionalProperties/id", "http://json-schema.org/draft-00/schema#", - "http://json-schema.org/draft-00/hyper-schema#", {}, std::nullopt); + "http://json-schema.org/draft-00/hyper-schema#", {}, + "/additionalProperties"); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-00/schema#", "http://json-schema.org/draft-00/hyper-schema#", {""}, std::nullopt); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-00/schema#", - "http://json-schema.org/draft-00/hyper-schema#", {}, std::nullopt); + "http://json-schema.org/draft-00/hyper-schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalProperties", "/additionalProperties", "http://json-schema.org/draft-00/schema#", @@ -72,7 +73,8 @@ TEST(JSONSchema_frame_draft0, anonymous_with_nested_schema_resource) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalProperties/id", "/additionalProperties/id", "http://json-schema.org/draft-00/schema#", - "http://json-schema.org/draft-00/hyper-schema#", {}, std::nullopt); + "http://json-schema.org/draft-00/hyper-schema#", {}, + "/additionalProperties"); // References @@ -105,11 +107,11 @@ TEST(JSONSchema_frame_draft0, empty_schema) { EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); // References @@ -142,11 +144,11 @@ TEST(JSONSchema_frame_draft0, empty_schema_trailing_hash) { EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); // References @@ -183,11 +185,11 @@ TEST(JSONSchema_frame_draft0, one_level_applicators_without_identifiers) { EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT0_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", @@ -195,11 +197,11 @@ TEST(JSONSchema_frame_draft0, one_level_applicators_without_identifiers) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/items/type", {}, "/items"); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/properties", {}, ""); EXPECT_FRAME_STATIC_DRAFT0_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", @@ -208,7 +210,7 @@ TEST(JSONSchema_frame_draft0, one_level_applicators_without_identifiers) { 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", {}, - std::nullopt); + "/properties/foo"); // References @@ -246,11 +248,11 @@ TEST(JSONSchema_frame_draft0, one_level_applicators_with_identifiers) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/test/qux", "/id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/test/qux", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT0_SUBSCHEMA( frame, "https://www.sourcemeta.com/test/qux#/items", "https://www.sourcemeta.com/test/qux", "/items", @@ -258,19 +260,19 @@ TEST(JSONSchema_frame_draft0, one_level_applicators_with_identifiers) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); // References @@ -311,11 +313,11 @@ TEST(JSONSchema_frame_draft0, subschema_absolute_identifier) { EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT0_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", @@ -323,19 +325,19 @@ TEST(JSONSchema_frame_draft0, subschema_absolute_identifier) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); // References @@ -384,11 +386,11 @@ TEST(JSONSchema_frame_draft0, explicit_argument_id_same) { EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); // References @@ -443,18 +445,18 @@ TEST(JSONSchema_frame_draft0, explicit_argument_id_different) { // JSON Pointers - EXPECT_FRAME_STATIC_DRAFT0_POINTER( - frame, "https://www.sourcemeta.com/schema#/id", - "https://www.sourcemeta.com/schema", "/id", "https://www.example.com", - "/id", {}, std::nullopt); + EXPECT_FRAME_STATIC_DRAFT0_POINTER(frame, + "https://www.sourcemeta.com/schema#/id", + "https://www.sourcemeta.com/schema", "/id", + "https://www.example.com", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.example.com", "/$schema", {}, std::nullopt); + "https://www.example.com", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.example.com", "/properties", {}, std::nullopt); + "https://www.example.com", "/properties", {}, ""); EXPECT_FRAME_STATIC_DRAFT0_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/one", "https://www.sourcemeta.com/schema", "/properties/one", @@ -462,7 +464,7 @@ TEST(JSONSchema_frame_draft0, explicit_argument_id_different) { EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/one/id", "https://www.sourcemeta.com/schema", "/properties/one/id", - "https://www.example.com/test", "/id", {}, std::nullopt); + "https://www.example.com/test", "/id", {}, "/properties/one"); EXPECT_FRAME_STATIC_DRAFT0_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/two", "https://www.sourcemeta.com/schema", "/properties/two", @@ -470,14 +472,15 @@ TEST(JSONSchema_frame_draft0, explicit_argument_id_different) { 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", {}, std::nullopt); + "https://www.test.com", "/id", {}, "/properties/two"); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.sourcemeta.com/test#/id", "https://www.sourcemeta.com/schema", "/properties/one/id", - "https://www.example.com/test", "/id", {}, std::nullopt); + "https://www.example.com/test", "/id", {}, "/properties/one"); EXPECT_FRAME_STATIC_DRAFT0_POINTER( frame, "https://www.test.com#/id", "https://www.sourcemeta.com/schema", - "/properties/two/id", "https://www.test.com", "/id", {}, std::nullopt); + "/properties/two/id", "https://www.test.com", "/id", {}, + "/properties/two"); // References @@ -506,10 +509,10 @@ TEST(JSONSchema_frame_draft0, ref_metaschema) { "http://json-schema.org/draft-00/hyper-schema#", {""}, std::nullopt); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-00/schema#", - "http://json-schema.org/draft-00/hyper-schema#", {}, std::nullopt); + "http://json-schema.org/draft-00/hyper-schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "http://json-schema.org/draft-00/schema#", - "http://json-schema.org/draft-00/hyper-schema#", {}, std::nullopt); + "http://json-schema.org/draft-00/hyper-schema#", {}, ""); // References diff --git a/test/jsonschema/jsonschema_frame_draft1_test.cc b/test/jsonschema/jsonschema_frame_draft1_test.cc index a863c1ae2..a404fad25 100644 --- a/test/jsonschema/jsonschema_frame_draft1_test.cc +++ b/test/jsonschema/jsonschema_frame_draft1_test.cc @@ -58,13 +58,14 @@ TEST(JSONSchema_frame_draft1, anonymous_with_nested_schema_resource) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/id", "/additionalProperties/id", "http://json-schema.org/draft-01/schema#", - "http://json-schema.org/draft-01/hyper-schema#", {}, std::nullopt); + "http://json-schema.org/draft-01/hyper-schema#", {}, + "/additionalProperties"); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-01/schema#", "http://json-schema.org/draft-01/hyper-schema#", {""}, std::nullopt); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-01/schema#", - "http://json-schema.org/draft-01/hyper-schema#", {}, std::nullopt); + "http://json-schema.org/draft-01/hyper-schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalProperties", "/additionalProperties", "http://json-schema.org/draft-01/schema#", @@ -72,7 +73,8 @@ TEST(JSONSchema_frame_draft1, anonymous_with_nested_schema_resource) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalProperties/id", "/additionalProperties/id", "http://json-schema.org/draft-01/schema#", - "http://json-schema.org/draft-01/hyper-schema#", {}, std::nullopt); + "http://json-schema.org/draft-01/hyper-schema#", {}, + "/additionalProperties"); // References @@ -105,11 +107,11 @@ TEST(JSONSchema_frame_draft1, empty_schema) { EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); // References @@ -142,11 +144,11 @@ TEST(JSONSchema_frame_draft1, empty_schema_trailing_hash) { EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); // References @@ -183,11 +185,11 @@ TEST(JSONSchema_frame_draft1, one_level_applicators_without_identifiers) { EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT1_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", @@ -195,11 +197,11 @@ TEST(JSONSchema_frame_draft1, one_level_applicators_without_identifiers) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/items/type", {}, "/items"); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/properties", {}, ""); EXPECT_FRAME_STATIC_DRAFT1_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", @@ -208,7 +210,7 @@ TEST(JSONSchema_frame_draft1, one_level_applicators_without_identifiers) { 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", {}, - std::nullopt); + "/properties/foo"); // References @@ -246,11 +248,11 @@ TEST(JSONSchema_frame_draft1, one_level_applicators_with_identifiers) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/test/qux", "/id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/test/qux", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT1_SUBSCHEMA( frame, "https://www.sourcemeta.com/test/qux#/items", "https://www.sourcemeta.com/test/qux", "/items", @@ -258,19 +260,19 @@ TEST(JSONSchema_frame_draft1, one_level_applicators_with_identifiers) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); // References @@ -311,11 +313,11 @@ TEST(JSONSchema_frame_draft1, subschema_absolute_identifier) { EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT1_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", @@ -323,19 +325,19 @@ TEST(JSONSchema_frame_draft1, subschema_absolute_identifier) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); // References @@ -384,11 +386,11 @@ TEST(JSONSchema_frame_draft1, explicit_argument_id_same) { EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); // References @@ -443,18 +445,18 @@ TEST(JSONSchema_frame_draft1, explicit_argument_id_different) { // JSON Pointers - EXPECT_FRAME_STATIC_DRAFT1_POINTER( - frame, "https://www.sourcemeta.com/schema#/id", - "https://www.sourcemeta.com/schema", "/id", "https://www.example.com", - "/id", {}, std::nullopt); + EXPECT_FRAME_STATIC_DRAFT1_POINTER(frame, + "https://www.sourcemeta.com/schema#/id", + "https://www.sourcemeta.com/schema", "/id", + "https://www.example.com", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.example.com", "/$schema", {}, std::nullopt); + "https://www.example.com", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.example.com", "/properties", {}, std::nullopt); + "https://www.example.com", "/properties", {}, ""); EXPECT_FRAME_STATIC_DRAFT1_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/one", "https://www.sourcemeta.com/schema", "/properties/one", @@ -462,7 +464,7 @@ TEST(JSONSchema_frame_draft1, explicit_argument_id_different) { EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/one/id", "https://www.sourcemeta.com/schema", "/properties/one/id", - "https://www.example.com/test", "/id", {}, std::nullopt); + "https://www.example.com/test", "/id", {}, "/properties/one"); EXPECT_FRAME_STATIC_DRAFT1_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/two", "https://www.sourcemeta.com/schema", "/properties/two", @@ -470,14 +472,15 @@ TEST(JSONSchema_frame_draft1, explicit_argument_id_different) { 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", {}, std::nullopt); + "https://www.test.com", "/id", {}, "/properties/two"); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.sourcemeta.com/test#/id", "https://www.sourcemeta.com/schema", "/properties/one/id", - "https://www.example.com/test", "/id", {}, std::nullopt); + "https://www.example.com/test", "/id", {}, "/properties/one"); EXPECT_FRAME_STATIC_DRAFT1_POINTER( frame, "https://www.test.com#/id", "https://www.sourcemeta.com/schema", - "/properties/two/id", "https://www.test.com", "/id", {}, std::nullopt); + "/properties/two/id", "https://www.test.com", "/id", {}, + "/properties/two"); // References @@ -506,10 +509,10 @@ TEST(JSONSchema_frame_draft1, ref_metaschema) { "http://json-schema.org/draft-01/hyper-schema#", {""}, std::nullopt); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-01/schema#", - "http://json-schema.org/draft-01/hyper-schema#", {}, std::nullopt); + "http://json-schema.org/draft-01/hyper-schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "http://json-schema.org/draft-01/schema#", - "http://json-schema.org/draft-01/hyper-schema#", {}, std::nullopt); + "http://json-schema.org/draft-01/hyper-schema#", {}, ""); // References diff --git a/test/jsonschema/jsonschema_frame_draft2_test.cc b/test/jsonschema/jsonschema_frame_draft2_test.cc index 8b1d9e017..c4b97590b 100644 --- a/test/jsonschema/jsonschema_frame_draft2_test.cc +++ b/test/jsonschema/jsonschema_frame_draft2_test.cc @@ -58,13 +58,14 @@ TEST(JSONSchema_frame_draft2, anonymous_with_nested_schema_resource) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/id", "/additionalProperties/id", "http://json-schema.org/draft-02/schema#", - "http://json-schema.org/draft-02/hyper-schema#", {}, std::nullopt); + "http://json-schema.org/draft-02/hyper-schema#", {}, + "/additionalProperties"); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-02/schema#", "http://json-schema.org/draft-02/hyper-schema#", {""}, std::nullopt); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-02/schema#", - "http://json-schema.org/draft-02/hyper-schema#", {}, std::nullopt); + "http://json-schema.org/draft-02/hyper-schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalProperties", "/additionalProperties", "http://json-schema.org/draft-02/schema#", @@ -72,7 +73,8 @@ TEST(JSONSchema_frame_draft2, anonymous_with_nested_schema_resource) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalProperties/id", "/additionalProperties/id", "http://json-schema.org/draft-02/schema#", - "http://json-schema.org/draft-02/hyper-schema#", {}, std::nullopt); + "http://json-schema.org/draft-02/hyper-schema#", {}, + "/additionalProperties"); // References @@ -105,11 +107,11 @@ TEST(JSONSchema_frame_draft2, empty_schema) { EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); // References @@ -142,11 +144,11 @@ TEST(JSONSchema_frame_draft2, empty_schema_trailing_hash) { EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); // References @@ -183,11 +185,11 @@ TEST(JSONSchema_frame_draft2, one_level_applicators_without_identifiers) { EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT2_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", @@ -195,11 +197,11 @@ TEST(JSONSchema_frame_draft2, one_level_applicators_without_identifiers) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/items/type", {}, "/items"); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/properties", {}, ""); EXPECT_FRAME_STATIC_DRAFT2_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", @@ -208,7 +210,7 @@ TEST(JSONSchema_frame_draft2, one_level_applicators_without_identifiers) { 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", {}, - std::nullopt); + "/properties/foo"); // References @@ -246,11 +248,11 @@ TEST(JSONSchema_frame_draft2, one_level_applicators_with_identifiers) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/test/qux", "/id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/test/qux", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT2_SUBSCHEMA( frame, "https://www.sourcemeta.com/test/qux#/items", "https://www.sourcemeta.com/test/qux", "/items", @@ -258,19 +260,19 @@ TEST(JSONSchema_frame_draft2, one_level_applicators_with_identifiers) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); // References @@ -311,11 +313,11 @@ TEST(JSONSchema_frame_draft2, subschema_absolute_identifier) { EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT2_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", @@ -323,19 +325,19 @@ TEST(JSONSchema_frame_draft2, subschema_absolute_identifier) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); // References @@ -384,11 +386,11 @@ TEST(JSONSchema_frame_draft2, explicit_argument_id_same) { EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); // References @@ -443,18 +445,18 @@ TEST(JSONSchema_frame_draft2, explicit_argument_id_different) { // JSON Pointers - EXPECT_FRAME_STATIC_DRAFT2_POINTER( - frame, "https://www.sourcemeta.com/schema#/id", - "https://www.sourcemeta.com/schema", "/id", "https://www.example.com", - "/id", {}, std::nullopt); + EXPECT_FRAME_STATIC_DRAFT2_POINTER(frame, + "https://www.sourcemeta.com/schema#/id", + "https://www.sourcemeta.com/schema", "/id", + "https://www.example.com", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.example.com", "/$schema", {}, std::nullopt); + "https://www.example.com", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.example.com", "/properties", {}, std::nullopt); + "https://www.example.com", "/properties", {}, ""); EXPECT_FRAME_STATIC_DRAFT2_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/one", "https://www.sourcemeta.com/schema", "/properties/one", @@ -462,7 +464,7 @@ TEST(JSONSchema_frame_draft2, explicit_argument_id_different) { EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/one/id", "https://www.sourcemeta.com/schema", "/properties/one/id", - "https://www.example.com/test", "/id", {}, std::nullopt); + "https://www.example.com/test", "/id", {}, "/properties/one"); EXPECT_FRAME_STATIC_DRAFT2_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/two", "https://www.sourcemeta.com/schema", "/properties/two", @@ -470,14 +472,15 @@ TEST(JSONSchema_frame_draft2, explicit_argument_id_different) { 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", {}, std::nullopt); + "https://www.test.com", "/id", {}, "/properties/two"); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.sourcemeta.com/test#/id", "https://www.sourcemeta.com/schema", "/properties/one/id", - "https://www.example.com/test", "/id", {}, std::nullopt); + "https://www.example.com/test", "/id", {}, "/properties/one"); EXPECT_FRAME_STATIC_DRAFT2_POINTER( frame, "https://www.test.com#/id", "https://www.sourcemeta.com/schema", - "/properties/two/id", "https://www.test.com", "/id", {}, std::nullopt); + "/properties/two/id", "https://www.test.com", "/id", {}, + "/properties/two"); // References @@ -506,10 +509,10 @@ TEST(JSONSchema_frame_draft2, ref_metaschema) { "http://json-schema.org/draft-02/hyper-schema#", {""}, std::nullopt); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-02/schema#", - "http://json-schema.org/draft-02/hyper-schema#", {}, std::nullopt); + "http://json-schema.org/draft-02/hyper-schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "http://json-schema.org/draft-02/schema#", - "http://json-schema.org/draft-02/hyper-schema#", {}, std::nullopt); + "http://json-schema.org/draft-02/hyper-schema#", {}, ""); // References diff --git a/test/jsonschema/jsonschema_frame_draft3_test.cc b/test/jsonschema/jsonschema_frame_draft3_test.cc index 430c2b4a4..e5f3d106d 100644 --- a/test/jsonschema/jsonschema_frame_draft3_test.cc +++ b/test/jsonschema/jsonschema_frame_draft3_test.cc @@ -56,13 +56,13 @@ TEST(JSONSchema_frame_draft3, anonymous_with_nested_schema_resource) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/id", "/additionalProperties/id", "http://json-schema.org/draft-03/schema#", - "http://json-schema.org/draft-03/schema#", {}, std::nullopt); + "http://json-schema.org/draft-03/schema#", {}, "/additionalProperties"); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-03/schema#", "http://json-schema.org/draft-03/schema#", {""}, std::nullopt); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-03/schema#", - "http://json-schema.org/draft-03/schema#", {}, std::nullopt); + "http://json-schema.org/draft-03/schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalProperties", "/additionalProperties", "http://json-schema.org/draft-03/schema#", @@ -70,7 +70,7 @@ TEST(JSONSchema_frame_draft3, anonymous_with_nested_schema_resource) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalProperties/id", "/additionalProperties/id", "http://json-schema.org/draft-03/schema#", - "http://json-schema.org/draft-03/schema#", {}, std::nullopt); + "http://json-schema.org/draft-03/schema#", {}, "/additionalProperties"); // References @@ -103,11 +103,11 @@ TEST(JSONSchema_frame_draft3, empty_schema) { EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); // References @@ -140,11 +140,11 @@ TEST(JSONSchema_frame_draft3, empty_schema_trailing_slash) { EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); // References @@ -181,11 +181,11 @@ TEST(JSONSchema_frame_draft3, one_level_applicators_without_identifiers) { EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT3_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", @@ -193,11 +193,11 @@ TEST(JSONSchema_frame_draft3, one_level_applicators_without_identifiers) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/items/type", {}, "/items"); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/properties", {}, ""); EXPECT_FRAME_STATIC_DRAFT3_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", @@ -206,7 +206,7 @@ TEST(JSONSchema_frame_draft3, one_level_applicators_without_identifiers) { 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", {}, - std::nullopt); + "/properties/foo"); // References @@ -244,11 +244,11 @@ TEST(JSONSchema_frame_draft3, one_level_applicators_with_identifiers) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/test/qux", "/id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/test/qux", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT3_SUBSCHEMA( frame, "https://www.sourcemeta.com/test/qux#/items", "https://www.sourcemeta.com/test/qux", "/items", @@ -256,19 +256,19 @@ TEST(JSONSchema_frame_draft3, one_level_applicators_with_identifiers) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); // References @@ -309,11 +309,11 @@ TEST(JSONSchema_frame_draft3, subschema_absolute_identifier) { EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT3_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", @@ -321,19 +321,19 @@ TEST(JSONSchema_frame_draft3, subschema_absolute_identifier) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); // References @@ -382,11 +382,11 @@ TEST(JSONSchema_frame_draft3, explicit_argument_id_same) { EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); // References @@ -441,18 +441,18 @@ TEST(JSONSchema_frame_draft3, explicit_argument_id_different) { // JSON Pointers - EXPECT_FRAME_STATIC_DRAFT3_POINTER( - frame, "https://www.sourcemeta.com/schema#/id", - "https://www.sourcemeta.com/schema", "/id", "https://www.example.com", - "/id", {}, std::nullopt); + EXPECT_FRAME_STATIC_DRAFT3_POINTER(frame, + "https://www.sourcemeta.com/schema#/id", + "https://www.sourcemeta.com/schema", "/id", + "https://www.example.com", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.example.com", "/$schema", {}, std::nullopt); + "https://www.example.com", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.example.com", "/properties", {}, std::nullopt); + "https://www.example.com", "/properties", {}, ""); EXPECT_FRAME_STATIC_DRAFT3_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/one", "https://www.sourcemeta.com/schema", "/properties/one", @@ -460,7 +460,7 @@ TEST(JSONSchema_frame_draft3, explicit_argument_id_different) { EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/one/id", "https://www.sourcemeta.com/schema", "/properties/one/id", - "https://www.example.com/test", "/id", {}, std::nullopt); + "https://www.example.com/test", "/id", {}, "/properties/one"); EXPECT_FRAME_STATIC_DRAFT3_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/two", "https://www.sourcemeta.com/schema", "/properties/two", @@ -468,14 +468,15 @@ TEST(JSONSchema_frame_draft3, explicit_argument_id_different) { 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", {}, std::nullopt); + "https://www.test.com", "/id", {}, "/properties/two"); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.sourcemeta.com/test#/id", "https://www.sourcemeta.com/schema", "/properties/one/id", - "https://www.example.com/test", "/id", {}, std::nullopt); + "https://www.example.com/test", "/id", {}, "/properties/one"); EXPECT_FRAME_STATIC_DRAFT3_POINTER( frame, "https://www.test.com#/id", "https://www.sourcemeta.com/schema", - "/properties/two/id", "https://www.test.com", "/id", {}, std::nullopt); + "/properties/two/id", "https://www.test.com", "/id", {}, + "/properties/two"); // References @@ -504,10 +505,10 @@ TEST(JSONSchema_frame_draft3, ref_metaschema) { "http://json-schema.org/draft-03/schema#", {""}, std::nullopt); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-03/schema#", - "http://json-schema.org/draft-03/schema#", {}, std::nullopt); + "http://json-schema.org/draft-03/schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "http://json-schema.org/draft-03/schema#", - "http://json-schema.org/draft-03/schema#", {}, std::nullopt); + "http://json-schema.org/draft-03/schema#", {}, ""); // References @@ -542,13 +543,13 @@ TEST(JSONSchema_frame_draft3, ref_with_id) { "http://json-schema.org/draft-03/schema#", {""}, std::nullopt); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/id", "/id", "http://json-schema.org/draft-03/schema#", - "http://json-schema.org/draft-03/schema#", {}, std::nullopt); + "http://json-schema.org/draft-03/schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-03/schema#", - "http://json-schema.org/draft-03/schema#", {}, std::nullopt); + "http://json-schema.org/draft-03/schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "http://json-schema.org/draft-03/schema#", - "http://json-schema.org/draft-03/schema#", {}, std::nullopt); + "http://json-schema.org/draft-03/schema#", {}, ""); // References diff --git a/test/jsonschema/jsonschema_frame_draft4_test.cc b/test/jsonschema/jsonschema_frame_draft4_test.cc index fbcb8186e..5b9ca5da7 100644 --- a/test/jsonschema/jsonschema_frame_draft4_test.cc +++ b/test/jsonschema/jsonschema_frame_draft4_test.cc @@ -65,13 +65,13 @@ TEST(JSONSchema_frame_draft4, anonymous_with_nested_schema_resource) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/id", "/additionalProperties/id", "http://json-schema.org/draft-04/schema#", - "http://json-schema.org/draft-04/schema#", {}, std::nullopt); + "http://json-schema.org/draft-04/schema#", {}, "/additionalProperties"); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-04/schema#", "http://json-schema.org/draft-04/schema#", {""}, std::nullopt); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-04/schema#", - "http://json-schema.org/draft-04/schema#", {}, std::nullopt); + "http://json-schema.org/draft-04/schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalProperties", "/additionalProperties", "http://json-schema.org/draft-04/schema#", @@ -79,7 +79,7 @@ TEST(JSONSchema_frame_draft4, anonymous_with_nested_schema_resource) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalProperties/id", "/additionalProperties/id", "http://json-schema.org/draft-04/schema#", - "http://json-schema.org/draft-04/schema#", {}, std::nullopt); + "http://json-schema.org/draft-04/schema#", {}, "/additionalProperties"); // References @@ -112,11 +112,11 @@ TEST(JSONSchema_frame_draft4, empty_schema) { EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); // References @@ -149,11 +149,11 @@ TEST(JSONSchema_frame_draft4, empty_schema_trailing_hash) { EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); // References @@ -190,11 +190,11 @@ TEST(JSONSchema_frame_draft4, one_level_applicators_without_identifiers) { EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT4_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", @@ -202,11 +202,11 @@ TEST(JSONSchema_frame_draft4, one_level_applicators_without_identifiers) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/items/type", {}, "/items"); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/properties", {}, ""); EXPECT_FRAME_STATIC_DRAFT4_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", @@ -215,7 +215,7 @@ TEST(JSONSchema_frame_draft4, one_level_applicators_without_identifiers) { 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", {}, - std::nullopt); + "/properties/foo"); // References @@ -253,11 +253,11 @@ TEST(JSONSchema_frame_draft4, one_level_applicators_with_identifiers) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/test/qux", "/id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/test/qux", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT4_SUBSCHEMA( frame, "https://www.sourcemeta.com/test/qux#/items", "https://www.sourcemeta.com/test/qux", "/items", @@ -265,19 +265,19 @@ TEST(JSONSchema_frame_draft4, one_level_applicators_with_identifiers) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); // References @@ -318,11 +318,11 @@ TEST(JSONSchema_frame_draft4, subschema_absolute_identifier) { EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT4_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", @@ -330,19 +330,19 @@ TEST(JSONSchema_frame_draft4, subschema_absolute_identifier) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); // References @@ -391,11 +391,11 @@ TEST(JSONSchema_frame_draft4, explicit_argument_id_same) { EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/id", "https://www.sourcemeta.com/schema", "/id", - "https://www.sourcemeta.com/schema", "/id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); // References @@ -450,18 +450,18 @@ TEST(JSONSchema_frame_draft4, explicit_argument_id_different) { // JSON Pointers - EXPECT_FRAME_STATIC_DRAFT4_POINTER( - frame, "https://www.sourcemeta.com/schema#/id", - "https://www.sourcemeta.com/schema", "/id", "https://www.example.com", - "/id", {}, std::nullopt); + EXPECT_FRAME_STATIC_DRAFT4_POINTER(frame, + "https://www.sourcemeta.com/schema#/id", + "https://www.sourcemeta.com/schema", "/id", + "https://www.example.com", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.example.com", "/$schema", {}, std::nullopt); + "https://www.example.com", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.example.com", "/properties", {}, std::nullopt); + "https://www.example.com", "/properties", {}, ""); EXPECT_FRAME_STATIC_DRAFT4_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/one", "https://www.sourcemeta.com/schema", "/properties/one", @@ -469,7 +469,7 @@ TEST(JSONSchema_frame_draft4, explicit_argument_id_different) { EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/one/id", "https://www.sourcemeta.com/schema", "/properties/one/id", - "https://www.example.com/test", "/id", {}, std::nullopt); + "https://www.example.com/test", "/id", {}, "/properties/one"); EXPECT_FRAME_STATIC_DRAFT4_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/two", "https://www.sourcemeta.com/schema", "/properties/two", @@ -477,14 +477,15 @@ TEST(JSONSchema_frame_draft4, explicit_argument_id_different) { 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", {}, std::nullopt); + "https://www.test.com", "/id", {}, "/properties/two"); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.sourcemeta.com/test#/id", "https://www.sourcemeta.com/schema", "/properties/one/id", - "https://www.example.com/test", "/id", {}, std::nullopt); + "https://www.example.com/test", "/id", {}, "/properties/one"); EXPECT_FRAME_STATIC_DRAFT4_POINTER( frame, "https://www.test.com#/id", "https://www.sourcemeta.com/schema", - "/properties/two/id", "https://www.test.com", "/id", {}, std::nullopt); + "/properties/two/id", "https://www.test.com", "/id", {}, + "/properties/two"); // References @@ -513,10 +514,10 @@ TEST(JSONSchema_frame_draft4, ref_metaschema) { "http://json-schema.org/draft-04/schema#", {""}, std::nullopt); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-04/schema#", - "http://json-schema.org/draft-04/schema#", {}, std::nullopt); + "http://json-schema.org/draft-04/schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "http://json-schema.org/draft-04/schema#", - "http://json-schema.org/draft-04/schema#", {}, std::nullopt); + "http://json-schema.org/draft-04/schema#", {}, ""); // References @@ -556,11 +557,11 @@ TEST(JSONSchema_frame_draft4, location_independent_identifier_anonymous) { "http://json-schema.org/draft-04/schema#", {""}, std::nullopt); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-04/schema#", - "http://json-schema.org/draft-04/schema#", {}, std::nullopt); + "http://json-schema.org/draft-04/schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions", "/definitions", "http://json-schema.org/draft-04/schema#", - "http://json-schema.org/draft-04/schema#", {}, std::nullopt); + "http://json-schema.org/draft-04/schema#", {}, ""); // Foo EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( @@ -570,7 +571,7 @@ TEST(JSONSchema_frame_draft4, location_independent_identifier_anonymous) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions/foo/id", "/definitions/foo/id", "http://json-schema.org/draft-04/schema#", - "http://json-schema.org/draft-04/schema#", {}, std::nullopt); + "http://json-schema.org/draft-04/schema#", {}, "/definitions/foo"); // Bar EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( @@ -580,7 +581,7 @@ TEST(JSONSchema_frame_draft4, location_independent_identifier_anonymous) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions/bar/$ref", "/definitions/bar/$ref", "http://json-schema.org/draft-04/schema#", - "http://json-schema.org/draft-04/schema#", {}, std::nullopt); + "http://json-schema.org/draft-04/schema#", {}, "/definitions/bar"); // Anchors EXPECT_ANONYMOUS_FRAME_STATIC_ANCHOR( @@ -623,17 +624,17 @@ TEST(JSONSchema_frame_draft4, ref_with_id) { "http://json-schema.org/draft-04/schema#", {""}, std::nullopt); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/id", "/id", "http://json-schema.org/draft-04/schema#", - "http://json-schema.org/draft-04/schema#", {}, std::nullopt); + "http://json-schema.org/draft-04/schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-04/schema#", - "http://json-schema.org/draft-04/schema#", {}, std::nullopt); + "http://json-schema.org/draft-04/schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "http://json-schema.org/draft-04/schema#", - "http://json-schema.org/draft-04/schema#", {}, std::nullopt); + "http://json-schema.org/draft-04/schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions", "/definitions", "http://json-schema.org/draft-04/schema#", - "http://json-schema.org/draft-04/schema#", {}, std::nullopt); + "http://json-schema.org/draft-04/schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/definitions/string", "/definitions/string", "http://json-schema.org/draft-04/schema#", @@ -641,7 +642,7 @@ TEST(JSONSchema_frame_draft4, ref_with_id) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions/string/type", "/definitions/string/type", "http://json-schema.org/draft-04/schema#", - "http://json-schema.org/draft-04/schema#", {}, std::nullopt); + "http://json-schema.org/draft-04/schema#", {}, "/definitions/string"); // References @@ -673,10 +674,9 @@ TEST(JSONSchema_frame_draft4, relative_base_uri_without_ref) { // JSON Pointers EXPECT_FRAME_STATIC_DRAFT4_POINTER(frame, "common#/$schema", "common", - "/$schema", "common", "/$schema", {}, - std::nullopt); + "/$schema", "common", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT4_POINTER(frame, "common#/id", "common", "/id", - "common", "/id", {}, std::nullopt); + "common", "/id", {}, ""); // References @@ -717,27 +717,26 @@ TEST(JSONSchema_frame_draft4, relative_base_uri_with_ref) { // JSON Pointers EXPECT_FRAME_STATIC_DRAFT4_POINTER(frame, "common#/$schema", "common", - "/$schema", "common", "/$schema", {}, - std::nullopt); + "/$schema", "common", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT4_POINTER(frame, "common#/id", "common", "/id", - "common", "/id", {}, std::nullopt); + "common", "/id", {}, ""); EXPECT_FRAME_STATIC_DRAFT4_POINTER(frame, "common#/allOf", "common", "/allOf", - "common", "/allOf", {}, std::nullopt); + "common", "/allOf", {}, ""); EXPECT_FRAME_STATIC_DRAFT4_SUBSCHEMA(frame, "common#/allOf/0", "common", "/allOf/0", "common", "/allOf/0", {""}, ""); EXPECT_FRAME_STATIC_DRAFT4_POINTER(frame, "common#/allOf/0/$ref", "common", "/allOf/0/$ref", "common", "/allOf/0/$ref", - {}, std::nullopt); + {}, "/allOf/0"); EXPECT_FRAME_STATIC_DRAFT4_POINTER(frame, "common#/definitions", "common", "/definitions", "common", "/definitions", - {}, std::nullopt); + {}, ""); 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", {}, std::nullopt); + EXPECT_FRAME_STATIC_DRAFT4_POINTER( + frame, "common#/definitions/foo/id", "common", "/definitions/foo/id", + "common", "/definitions/foo/id", {}, "/definitions/foo"); // References diff --git a/test/jsonschema/jsonschema_frame_draft6_test.cc b/test/jsonschema/jsonschema_frame_draft6_test.cc index 05a68ba2f..652c7eb41 100644 --- a/test/jsonschema/jsonschema_frame_draft6_test.cc +++ b/test/jsonschema/jsonschema_frame_draft6_test.cc @@ -62,7 +62,7 @@ TEST(JSONSchema_frame_draft6, anonymous_with_nested_schema_resource) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/$id", "/additionalProperties/$id", "http://json-schema.org/draft-06/schema#", - "http://json-schema.org/draft-06/schema#", {}, std::nullopt); + "http://json-schema.org/draft-06/schema#", {}, "/additionalProperties"); // JSON Pointers @@ -71,7 +71,7 @@ TEST(JSONSchema_frame_draft6, anonymous_with_nested_schema_resource) { "http://json-schema.org/draft-06/schema#", {""}, std::nullopt); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-06/schema#", - "http://json-schema.org/draft-06/schema#", {}, std::nullopt); + "http://json-schema.org/draft-06/schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalProperties", "/additionalProperties", "http://json-schema.org/draft-06/schema#", @@ -79,7 +79,7 @@ TEST(JSONSchema_frame_draft6, anonymous_with_nested_schema_resource) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalProperties/$id", "/additionalProperties/$id", "http://json-schema.org/draft-06/schema#", - "http://json-schema.org/draft-06/schema#", {}, std::nullopt); + "http://json-schema.org/draft-06/schema#", {}, "/additionalProperties"); // References @@ -112,11 +112,11 @@ TEST(JSONSchema_frame_draft6, empty_schema) { EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); // References @@ -149,11 +149,11 @@ TEST(JSONSchema_frame_draft6, empty_schema_trailing_hash) { EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); // References @@ -190,11 +190,11 @@ TEST(JSONSchema_frame_draft6, one_level_applicators_without_identifiers) { EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT6_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", @@ -202,11 +202,11 @@ TEST(JSONSchema_frame_draft6, one_level_applicators_without_identifiers) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/items/type", {}, "/items"); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/properties", {}, ""); EXPECT_FRAME_STATIC_DRAFT6_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", @@ -215,7 +215,7 @@ TEST(JSONSchema_frame_draft6, one_level_applicators_without_identifiers) { 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", {}, - std::nullopt); + "/properties/foo"); // References @@ -253,11 +253,11 @@ TEST(JSONSchema_frame_draft6, one_level_applicators_with_identifiers) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/test/qux", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/test/qux", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT6_SUBSCHEMA( frame, "https://www.sourcemeta.com/test/qux#/items", "https://www.sourcemeta.com/test/qux", "/items", @@ -265,19 +265,19 @@ TEST(JSONSchema_frame_draft6, one_level_applicators_with_identifiers) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/$id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/$id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); // References @@ -318,11 +318,11 @@ TEST(JSONSchema_frame_draft6, subschema_absolute_identifier) { EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT6_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", @@ -330,19 +330,19 @@ TEST(JSONSchema_frame_draft6, subschema_absolute_identifier) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/$id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/$id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); // References @@ -391,11 +391,11 @@ TEST(JSONSchema_frame_draft6, explicit_argument_id_same) { EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); // References @@ -453,15 +453,15 @@ TEST(JSONSchema_frame_draft6, explicit_argument_id_different) { EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", "https://www.example.com", - "/$id", {}, std::nullopt); + "/$id", {}, ""); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.example.com", "/$schema", {}, std::nullopt); + "https://www.example.com", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.example.com", "/properties", {}, std::nullopt); + "https://www.example.com", "/properties", {}, ""); EXPECT_FRAME_STATIC_DRAFT6_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/one", "https://www.sourcemeta.com/schema", "/properties/one", @@ -469,7 +469,7 @@ TEST(JSONSchema_frame_draft6, explicit_argument_id_different) { EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/one/$id", "https://www.sourcemeta.com/schema", "/properties/one/$id", - "https://www.example.com/test", "/$id", {}, std::nullopt); + "https://www.example.com/test", "/$id", {}, "/properties/one"); EXPECT_FRAME_STATIC_DRAFT6_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/two", "https://www.sourcemeta.com/schema", "/properties/two", @@ -477,14 +477,15 @@ TEST(JSONSchema_frame_draft6, explicit_argument_id_different) { 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", {}, std::nullopt); + "https://www.test.com", "/$id", {}, "/properties/two"); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.sourcemeta.com/test#/$id", "https://www.sourcemeta.com/schema", "/properties/one/$id", - "https://www.example.com/test", "/$id", {}, std::nullopt); + "https://www.example.com/test", "/$id", {}, "/properties/one"); EXPECT_FRAME_STATIC_DRAFT6_POINTER( frame, "https://www.test.com#/$id", "https://www.sourcemeta.com/schema", - "/properties/two/$id", "https://www.test.com", "/$id", {}, std::nullopt); + "/properties/two/$id", "https://www.test.com", "/$id", {}, + "/properties/two"); // References @@ -513,10 +514,10 @@ TEST(JSONSchema_frame_draft6, ref_metaschema) { "http://json-schema.org/draft-06/schema#", {""}, std::nullopt); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-06/schema#", - "http://json-schema.org/draft-06/schema#", {}, std::nullopt); + "http://json-schema.org/draft-06/schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "http://json-schema.org/draft-06/schema#", - "http://json-schema.org/draft-06/schema#", {}, std::nullopt); + "http://json-schema.org/draft-06/schema#", {}, ""); // References @@ -556,11 +557,11 @@ TEST(JSONSchema_frame_draft6, location_independent_identifier_anonymous) { "http://json-schema.org/draft-06/schema#", {""}, std::nullopt); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-06/schema#", - "http://json-schema.org/draft-06/schema#", {}, std::nullopt); + "http://json-schema.org/draft-06/schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions", "/definitions", "http://json-schema.org/draft-06/schema#", - "http://json-schema.org/draft-06/schema#", {}, std::nullopt); + "http://json-schema.org/draft-06/schema#", {}, ""); // Foo EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( @@ -570,7 +571,7 @@ TEST(JSONSchema_frame_draft6, location_independent_identifier_anonymous) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions/foo/$id", "/definitions/foo/$id", "http://json-schema.org/draft-06/schema#", - "http://json-schema.org/draft-06/schema#", {}, std::nullopt); + "http://json-schema.org/draft-06/schema#", {}, "/definitions/foo"); // Bar EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( @@ -580,7 +581,7 @@ TEST(JSONSchema_frame_draft6, location_independent_identifier_anonymous) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions/bar/$ref", "/definitions/bar/$ref", "http://json-schema.org/draft-06/schema#", - "http://json-schema.org/draft-06/schema#", {}, std::nullopt); + "http://json-schema.org/draft-06/schema#", {}, "/definitions/bar"); // Anchors EXPECT_ANONYMOUS_FRAME_STATIC_ANCHOR( @@ -623,17 +624,17 @@ TEST(JSONSchema_frame_draft6, ref_with_id) { "http://json-schema.org/draft-06/schema#", {""}, std::nullopt); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$id", "/$id", "http://json-schema.org/draft-06/schema#", - "http://json-schema.org/draft-06/schema#", {}, std::nullopt); + "http://json-schema.org/draft-06/schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-06/schema#", - "http://json-schema.org/draft-06/schema#", {}, std::nullopt); + "http://json-schema.org/draft-06/schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "http://json-schema.org/draft-06/schema#", - "http://json-schema.org/draft-06/schema#", {}, std::nullopt); + "http://json-schema.org/draft-06/schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions", "/definitions", "http://json-schema.org/draft-06/schema#", - "http://json-schema.org/draft-06/schema#", {}, std::nullopt); + "http://json-schema.org/draft-06/schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/definitions/string", "/definitions/string", "http://json-schema.org/draft-06/schema#", @@ -641,7 +642,7 @@ TEST(JSONSchema_frame_draft6, ref_with_id) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions/string/type", "/definitions/string/type", "http://json-schema.org/draft-06/schema#", - "http://json-schema.org/draft-06/schema#", {}, std::nullopt); + "http://json-schema.org/draft-06/schema#", {}, "/definitions/string"); // References @@ -673,10 +674,9 @@ TEST(JSONSchema_frame_draft6, relative_base_uri_without_ref) { // JSON Pointers EXPECT_FRAME_STATIC_DRAFT6_POINTER(frame, "common#/$schema", "common", - "/$schema", "common", "/$schema", {}, - std::nullopt); + "/$schema", "common", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT6_POINTER(frame, "common#/$id", "common", "/$id", - "common", "/$id", {}, std::nullopt); + "common", "/$id", {}, ""); // References @@ -717,27 +717,26 @@ TEST(JSONSchema_frame_draft6, relative_base_uri_with_ref) { // JSON Pointers EXPECT_FRAME_STATIC_DRAFT6_POINTER(frame, "common#/$schema", "common", - "/$schema", "common", "/$schema", {}, - std::nullopt); + "/$schema", "common", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT6_POINTER(frame, "common#/$id", "common", "/$id", - "common", "/$id", {}, std::nullopt); + "common", "/$id", {}, ""); EXPECT_FRAME_STATIC_DRAFT6_POINTER(frame, "common#/allOf", "common", "/allOf", - "common", "/allOf", {}, std::nullopt); + "common", "/allOf", {}, ""); EXPECT_FRAME_STATIC_DRAFT6_SUBSCHEMA(frame, "common#/allOf/0", "common", "/allOf/0", "common", "/allOf/0", {""}, ""); EXPECT_FRAME_STATIC_DRAFT6_POINTER(frame, "common#/allOf/0/$ref", "common", "/allOf/0/$ref", "common", "/allOf/0/$ref", - {}, std::nullopt); + {}, "/allOf/0"); EXPECT_FRAME_STATIC_DRAFT6_POINTER(frame, "common#/definitions", "common", "/definitions", "common", "/definitions", - {}, std::nullopt); + {}, ""); EXPECT_FRAME_STATIC_DRAFT6_SUBSCHEMA(frame, "common#/definitions/foo", "common", "/definitions/foo", "common", "/definitions/foo", {""}, ""); - EXPECT_FRAME_STATIC_DRAFT6_POINTER(frame, "common#/definitions/foo/$id", - "common", "/definitions/foo/$id", "common", - "/definitions/foo/$id", {}, std::nullopt); + EXPECT_FRAME_STATIC_DRAFT6_POINTER( + frame, "common#/definitions/foo/$id", "common", "/definitions/foo/$id", + "common", "/definitions/foo/$id", {}, "/definitions/foo"); // References diff --git a/test/jsonschema/jsonschema_frame_draft7_test.cc b/test/jsonschema/jsonschema_frame_draft7_test.cc index 1a174e452..bd4600945 100644 --- a/test/jsonschema/jsonschema_frame_draft7_test.cc +++ b/test/jsonschema/jsonschema_frame_draft7_test.cc @@ -65,13 +65,13 @@ TEST(JSONSchema_frame_draft7, anonymous_with_nested_schema_resource) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/$id", "/additionalProperties/$id", "http://json-schema.org/draft-07/schema#", - "http://json-schema.org/draft-07/schema#", {}, std::nullopt); + "http://json-schema.org/draft-07/schema#", {}, "/additionalProperties"); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "", "", "http://json-schema.org/draft-07/schema#", "http://json-schema.org/draft-07/schema#", {""}, std::nullopt); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-07/schema#", - "http://json-schema.org/draft-07/schema#", {}, std::nullopt); + "http://json-schema.org/draft-07/schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/additionalProperties", "/additionalProperties", "http://json-schema.org/draft-07/schema#", @@ -79,7 +79,7 @@ TEST(JSONSchema_frame_draft7, anonymous_with_nested_schema_resource) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/additionalProperties/$id", "/additionalProperties/$id", "http://json-schema.org/draft-07/schema#", - "http://json-schema.org/draft-07/schema#", {}, std::nullopt); + "http://json-schema.org/draft-07/schema#", {}, "/additionalProperties"); // References @@ -112,11 +112,11 @@ TEST(JSONSchema_frame_draft7, empty_schema) { EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); // References @@ -149,11 +149,11 @@ TEST(JSONSchema_frame_draft7, empty_schema_trailing_hash) { EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); // References @@ -190,11 +190,11 @@ TEST(JSONSchema_frame_draft7, one_level_applicators_without_identifiers) { EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT7_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", @@ -202,11 +202,11 @@ TEST(JSONSchema_frame_draft7, one_level_applicators_without_identifiers) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/items/type", {}, "/items"); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.sourcemeta.com/schema", "/properties", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/properties", {}, ""); EXPECT_FRAME_STATIC_DRAFT7_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/foo", "https://www.sourcemeta.com/schema", "/properties/foo", @@ -215,7 +215,7 @@ TEST(JSONSchema_frame_draft7, one_level_applicators_without_identifiers) { 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", {}, - std::nullopt); + "/properties/foo"); // References @@ -253,11 +253,11 @@ TEST(JSONSchema_frame_draft7, one_level_applicators_with_identifiers) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/test/qux", "/$id", {}, ""); 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", {}, std::nullopt); + "https://www.sourcemeta.com/test/qux", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT7_SUBSCHEMA( frame, "https://www.sourcemeta.com/test/qux#/items", "https://www.sourcemeta.com/test/qux", "/items", @@ -265,19 +265,19 @@ TEST(JSONSchema_frame_draft7, one_level_applicators_with_identifiers) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/$id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/$id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); // References @@ -318,11 +318,11 @@ TEST(JSONSchema_frame_draft7, subschema_absolute_identifier) { EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT7_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", @@ -330,19 +330,19 @@ TEST(JSONSchema_frame_draft7, subschema_absolute_identifier) { 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/$id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/$id", {}, "/items"); 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", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/type", {}, "/items"); // References @@ -391,11 +391,11 @@ TEST(JSONSchema_frame_draft7, explicit_argument_id_same) { EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", - "https://www.sourcemeta.com/schema", "/$id", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$id", {}, ""); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); // References @@ -453,15 +453,15 @@ TEST(JSONSchema_frame_draft7, explicit_argument_id_different) { EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/$id", "https://www.sourcemeta.com/schema", "/$id", "https://www.example.com", - "/$id", {}, std::nullopt); + "/$id", {}, ""); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/$schema", "https://www.sourcemeta.com/schema", "/$schema", - "https://www.example.com", "/$schema", {}, std::nullopt); + "https://www.example.com", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/properties", "https://www.sourcemeta.com/schema", "/properties", - "https://www.example.com", "/properties", {}, std::nullopt); + "https://www.example.com", "/properties", {}, ""); EXPECT_FRAME_STATIC_DRAFT7_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/one", "https://www.sourcemeta.com/schema", "/properties/one", @@ -469,7 +469,7 @@ TEST(JSONSchema_frame_draft7, explicit_argument_id_different) { EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/schema#/properties/one/$id", "https://www.sourcemeta.com/schema", "/properties/one/$id", - "https://www.example.com/test", "/$id", {}, std::nullopt); + "https://www.example.com/test", "/$id", {}, "/properties/one"); EXPECT_FRAME_STATIC_DRAFT7_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/properties/two", "https://www.sourcemeta.com/schema", "/properties/two", @@ -477,14 +477,15 @@ TEST(JSONSchema_frame_draft7, explicit_argument_id_different) { 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", {}, std::nullopt); + "https://www.test.com", "/$id", {}, "/properties/two"); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.sourcemeta.com/test#/$id", "https://www.sourcemeta.com/schema", "/properties/one/$id", - "https://www.example.com/test", "/$id", {}, std::nullopt); + "https://www.example.com/test", "/$id", {}, "/properties/one"); EXPECT_FRAME_STATIC_DRAFT7_POINTER( frame, "https://www.test.com#/$id", "https://www.sourcemeta.com/schema", - "/properties/two/$id", "https://www.test.com", "/$id", {}, std::nullopt); + "/properties/two/$id", "https://www.test.com", "/$id", {}, + "/properties/two"); // References @@ -513,10 +514,10 @@ TEST(JSONSchema_frame_draft7, ref_metaschema) { "http://json-schema.org/draft-07/schema#", {""}, std::nullopt); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-07/schema#", - "http://json-schema.org/draft-07/schema#", {}, std::nullopt); + "http://json-schema.org/draft-07/schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "http://json-schema.org/draft-07/schema#", - "http://json-schema.org/draft-07/schema#", {}, std::nullopt); + "http://json-schema.org/draft-07/schema#", {}, ""); // References @@ -556,11 +557,11 @@ TEST(JSONSchema_frame_draft7, location_independent_identifier_anonymous) { "http://json-schema.org/draft-07/schema#", {""}, std::nullopt); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-07/schema#", - "http://json-schema.org/draft-07/schema#", {}, std::nullopt); + "http://json-schema.org/draft-07/schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions", "/definitions", "http://json-schema.org/draft-07/schema#", - "http://json-schema.org/draft-07/schema#", {}, std::nullopt); + "http://json-schema.org/draft-07/schema#", {}, ""); // Foo EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( @@ -570,7 +571,7 @@ TEST(JSONSchema_frame_draft7, location_independent_identifier_anonymous) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions/foo/$id", "/definitions/foo/$id", "http://json-schema.org/draft-07/schema#", - "http://json-schema.org/draft-07/schema#", {}, std::nullopt); + "http://json-schema.org/draft-07/schema#", {}, "/definitions/foo"); // Bar EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( @@ -580,7 +581,7 @@ TEST(JSONSchema_frame_draft7, location_independent_identifier_anonymous) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions/bar/$ref", "/definitions/bar/$ref", "http://json-schema.org/draft-07/schema#", - "http://json-schema.org/draft-07/schema#", {}, std::nullopt); + "http://json-schema.org/draft-07/schema#", {}, "/definitions/bar"); // Anchors EXPECT_ANONYMOUS_FRAME_STATIC_ANCHOR( @@ -623,17 +624,17 @@ TEST(JSONSchema_frame_draft7, ref_with_id) { "http://json-schema.org/draft-07/schema#", {""}, std::nullopt); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$id", "/$id", "http://json-schema.org/draft-07/schema#", - "http://json-schema.org/draft-07/schema#", {}, std::nullopt); + "http://json-schema.org/draft-07/schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "http://json-schema.org/draft-07/schema#", - "http://json-schema.org/draft-07/schema#", {}, std::nullopt); + "http://json-schema.org/draft-07/schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$ref", "/$ref", "http://json-schema.org/draft-07/schema#", - "http://json-schema.org/draft-07/schema#", {}, std::nullopt); + "http://json-schema.org/draft-07/schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions", "/definitions", "http://json-schema.org/draft-07/schema#", - "http://json-schema.org/draft-07/schema#", {}, std::nullopt); + "http://json-schema.org/draft-07/schema#", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/definitions/string", "/definitions/string", "http://json-schema.org/draft-07/schema#", @@ -641,7 +642,7 @@ TEST(JSONSchema_frame_draft7, ref_with_id) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/definitions/string/type", "/definitions/string/type", "http://json-schema.org/draft-07/schema#", - "http://json-schema.org/draft-07/schema#", {}, std::nullopt); + "http://json-schema.org/draft-07/schema#", {}, "/definitions/string"); // References @@ -673,10 +674,9 @@ TEST(JSONSchema_frame_draft7, relative_base_uri_without_ref) { // JSON Pointers EXPECT_FRAME_STATIC_DRAFT7_POINTER(frame, "common#/$schema", "common", - "/$schema", "common", "/$schema", {}, - std::nullopt); + "/$schema", "common", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT7_POINTER(frame, "common#/$id", "common", "/$id", - "common", "/$id", {}, std::nullopt); + "common", "/$id", {}, ""); // References @@ -717,27 +717,26 @@ TEST(JSONSchema_frame_draft7, relative_base_uri_with_ref) { // JSON Pointers EXPECT_FRAME_STATIC_DRAFT7_POINTER(frame, "common#/$schema", "common", - "/$schema", "common", "/$schema", {}, - std::nullopt); + "/$schema", "common", "/$schema", {}, ""); EXPECT_FRAME_STATIC_DRAFT7_POINTER(frame, "common#/$id", "common", "/$id", - "common", "/$id", {}, std::nullopt); + "common", "/$id", {}, ""); EXPECT_FRAME_STATIC_DRAFT7_POINTER(frame, "common#/allOf", "common", "/allOf", - "common", "/allOf", {}, std::nullopt); + "common", "/allOf", {}, ""); EXPECT_FRAME_STATIC_DRAFT7_SUBSCHEMA(frame, "common#/allOf/0", "common", "/allOf/0", "common", "/allOf/0", {""}, ""); EXPECT_FRAME_STATIC_DRAFT7_POINTER(frame, "common#/allOf/0/$ref", "common", "/allOf/0/$ref", "common", "/allOf/0/$ref", - {}, std::nullopt); + {}, "/allOf/0"); EXPECT_FRAME_STATIC_DRAFT7_POINTER(frame, "common#/definitions", "common", "/definitions", "common", "/definitions", - {}, std::nullopt); + {}, ""); EXPECT_FRAME_STATIC_DRAFT7_SUBSCHEMA(frame, "common#/definitions/foo", "common", "/definitions/foo", "common", "/definitions/foo", {""}, ""); - EXPECT_FRAME_STATIC_DRAFT7_POINTER(frame, "common#/definitions/foo/$id", - "common", "/definitions/foo/$id", "common", - "/definitions/foo/$id", {}, std::nullopt); + EXPECT_FRAME_STATIC_DRAFT7_POINTER( + frame, "common#/definitions/foo/$id", "common", "/definitions/foo/$id", + "common", "/definitions/foo/$id", {}, "/definitions/foo"); // References diff --git a/test/jsonschema/jsonschema_frame_test.cc b/test/jsonschema/jsonschema_frame_test.cc index 924ba5224..ea16b84b2 100644 --- a/test/jsonschema/jsonschema_frame_test.cc +++ b/test/jsonschema/jsonschema_frame_test.cc @@ -58,19 +58,19 @@ TEST(JSONSchema_frame, nested_schemas_mixing_dialects) { "https://json-schema.org/draft/2020-12/schema", "https://json-schema.org/draft/2020-12/schema", "https://www.sourcemeta.com/test", "/$id", {}, - std::nullopt); + ""); 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", "https://json-schema.org/draft/2020-12/schema", "https://www.sourcemeta.com/test", "/$schema", {}, - std::nullopt); + ""); 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", "https://json-schema.org/draft/2020-12/schema", "https://www.sourcemeta.com/test", "/$defs", {}, - std::nullopt); + ""); EXPECT_FRAME_STATIC_SUBSCHEMA(frame, "https://www.sourcemeta.com/test#/$defs/foo", "https://www.sourcemeta.com/test", "/$defs/foo", @@ -82,19 +82,19 @@ TEST(JSONSchema_frame, nested_schemas_mixing_dialects) { "https://www.sourcemeta.com/test", "/$defs/foo/id", "http://json-schema.org/draft-04/schema#", "http://json-schema.org/draft-04/schema#", - "https://www.sourcemeta.com/foo", "/id", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/id", {}, "/$defs/foo"); 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#", "http://json-schema.org/draft-04/schema#", - "https://www.sourcemeta.com/foo", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/$schema", {}, "/$defs/foo"); 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#", "http://json-schema.org/draft-04/schema#", - "https://www.sourcemeta.com/foo", "/definitions", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/definitions", {}, "/$defs/foo"); EXPECT_FRAME_STATIC_SUBSCHEMA( frame, "https://www.sourcemeta.com/test#/$defs/foo/definitions/bar", "https://www.sourcemeta.com/test", "/$defs/foo/definitions/bar", @@ -106,31 +106,33 @@ TEST(JSONSchema_frame, nested_schemas_mixing_dialects) { "https://www.sourcemeta.com/test", "/$defs/foo/definitions/bar/id", "http://json-schema.org/draft-04/schema#", "http://json-schema.org/draft-04/schema#", - "https://www.sourcemeta.com/bar", "/id", {}, std::nullopt); + "https://www.sourcemeta.com/bar", "/id", {}, + "/$defs/foo/definitions/bar"); 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#", "http://json-schema.org/draft-04/schema#", - "https://www.sourcemeta.com/bar", "/type", {}, std::nullopt); + "https://www.sourcemeta.com/bar", "/type", {}, + "/$defs/foo/definitions/bar"); 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#", "http://json-schema.org/draft-04/schema#", - "https://www.sourcemeta.com/foo", "/id", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/id", {}, "/$defs/foo"); 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#", "http://json-schema.org/draft-04/schema#", - "https://www.sourcemeta.com/foo", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/$schema", {}, "/$defs/foo"); 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#", "http://json-schema.org/draft-04/schema#", - "https://www.sourcemeta.com/foo", "/definitions", {}, std::nullopt); + "https://www.sourcemeta.com/foo", "/definitions", {}, "/$defs/foo"); EXPECT_FRAME_STATIC_SUBSCHEMA( frame, "https://www.sourcemeta.com/foo#/definitions/bar", "https://www.sourcemeta.com/test", "/$defs/foo/definitions/bar", @@ -142,25 +144,29 @@ TEST(JSONSchema_frame, nested_schemas_mixing_dialects) { "https://www.sourcemeta.com/test", "/$defs/foo/definitions/bar/id", "http://json-schema.org/draft-04/schema#", "http://json-schema.org/draft-04/schema#", - "https://www.sourcemeta.com/bar", "/id", {}, std::nullopt); + "https://www.sourcemeta.com/bar", "/id", {}, + "/$defs/foo/definitions/bar"); 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#", "http://json-schema.org/draft-04/schema#", - "https://www.sourcemeta.com/bar", "/type", {}, std::nullopt); - 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#", - "http://json-schema.org/draft-04/schema#", - "https://www.sourcemeta.com/bar", "/id", {}, std::nullopt); - 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#", - "http://json-schema.org/draft-04/schema#", - "https://www.sourcemeta.com/bar", "/type", {}, std::nullopt); + "https://www.sourcemeta.com/bar", "/type", {}, + "/$defs/foo/definitions/bar"); + 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#", + "http://json-schema.org/draft-04/schema#", + "https://www.sourcemeta.com/bar", "/id", {}, + "/$defs/foo/definitions/bar"); + 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#", + "http://json-schema.org/draft-04/schema#", + "https://www.sourcemeta.com/bar", "/type", {}, + "/$defs/foo/definitions/bar"); // References @@ -204,11 +210,11 @@ TEST(JSONSchema_frame, no_id) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/$schema", "/$schema", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", {}, std::nullopt); + "https://json-schema.org/draft/2020-12/schema", {}, ""); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties", "/properties", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", {}, std::nullopt); + "https://json-schema.org/draft/2020-12/schema", {}, ""); // Foo @@ -219,11 +225,11 @@ TEST(JSONSchema_frame, no_id) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/$anchor", "/properties/foo/$anchor", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", {}, std::nullopt); + "https://json-schema.org/draft/2020-12/schema", {}, "/properties/foo"); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/foo/type", "/properties/foo/type", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", {}, std::nullopt); + "https://json-schema.org/draft/2020-12/schema", {}, "/properties/foo"); EXPECT_ANONYMOUS_FRAME_STATIC_ANCHOR( frame, "#foo", "/properties/foo", "https://json-schema.org/draft/2020-12/schema", @@ -242,11 +248,11 @@ TEST(JSONSchema_frame, no_id) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/$id", "/properties/bar/$id", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", {}, std::nullopt); + "https://json-schema.org/draft/2020-12/schema", {}, "/properties/bar"); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "https://example.com#/$anchor", "/properties/bar/$anchor", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", {}, std::nullopt); + "https://json-schema.org/draft/2020-12/schema", {}, "/properties/bar"); EXPECT_ANONYMOUS_FRAME_STATIC_SUBSCHEMA( frame, "#/properties/bar", "/properties/bar", @@ -255,11 +261,11 @@ TEST(JSONSchema_frame, no_id) { EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/bar/$id", "/properties/bar/$id", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", {}, std::nullopt); + "https://json-schema.org/draft/2020-12/schema", {}, "/properties/bar"); EXPECT_ANONYMOUS_FRAME_STATIC_POINTER( frame, "#/properties/bar/$anchor", "/properties/bar/$anchor", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", {}, std::nullopt); + "https://json-schema.org/draft/2020-12/schema", {}, "/properties/bar"); // References @@ -295,7 +301,7 @@ TEST(JSONSchema_frame, no_id_with_default) { "https://www.sourcemeta.com/schema", "/$schema", "https://json-schema.org/draft/2020-12/schema", "https://json-schema.org/draft/2020-12/schema", - "https://www.sourcemeta.com/schema", "/$schema", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/$schema", {}, ""); EXPECT_FRAME_STATIC_SUBSCHEMA( frame, "https://www.sourcemeta.com/schema#/items", "https://www.sourcemeta.com/schema", "/items", @@ -307,7 +313,7 @@ TEST(JSONSchema_frame, no_id_with_default) { "https://www.sourcemeta.com/schema", "/items/type", "https://json-schema.org/draft/2020-12/schema", "https://json-schema.org/draft/2020-12/schema", - "https://www.sourcemeta.com/schema", "/items/type", {}, std::nullopt); + "https://www.sourcemeta.com/schema", "/items/type", {}, "/items"); // References @@ -354,26 +360,26 @@ TEST(JSONSchema_frame, anchor_on_absolute_subid) { // 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", - "https://json-schema.org/draft/2020-12/schema", "https://www.example.com", - "/$id", {}, std::nullopt); - EXPECT_FRAME_STATIC_POINTER( - frame, "https://www.example.com#/$schema", "https://www.example.com", - "/$schema", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", "https://www.example.com", - "/$schema", {}, std::nullopt); + EXPECT_FRAME_STATIC_POINTER(frame, "https://www.example.com#/$id", + "https://www.example.com", "/$id", + "https://json-schema.org/draft/2020-12/schema", + "https://json-schema.org/draft/2020-12/schema", + "https://www.example.com", "/$id", {}, ""); + EXPECT_FRAME_STATIC_POINTER(frame, "https://www.example.com#/$schema", + "https://www.example.com", "/$schema", + "https://json-schema.org/draft/2020-12/schema", + "https://json-schema.org/draft/2020-12/schema", + "https://www.example.com", "/$schema", {}, ""); EXPECT_FRAME_STATIC_SUBSCHEMA(frame, "https://www.example.com#/items", "https://www.example.com", "/items", "https://json-schema.org/draft/2020-12/schema", "https://json-schema.org/draft/2020-12/schema", "https://www.example.org", "", {"/~I~"}, ""); - 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", - "https://json-schema.org/draft/2020-12/schema", "https://www.example.org", - "/$id", {}, std::nullopt); + 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", + "https://json-schema.org/draft/2020-12/schema", + "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", @@ -384,12 +390,12 @@ TEST(JSONSchema_frame, anchor_on_absolute_subid) { "https://www.example.com", "/items/items/$anchor", "https://json-schema.org/draft/2020-12/schema", "https://json-schema.org/draft/2020-12/schema", "https://www.example.org", - "/items/$anchor", {}, std::nullopt); - EXPECT_FRAME_STATIC_POINTER( - frame, "https://www.example.org#/$id", "https://www.example.com", - "/items/$id", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", "https://www.example.org", - "/$id", {}, std::nullopt); + "/items/$anchor", {}, "/items/items"); + EXPECT_FRAME_STATIC_POINTER(frame, "https://www.example.org#/$id", + "https://www.example.com", "/items/$id", + "https://json-schema.org/draft/2020-12/schema", + "https://json-schema.org/draft/2020-12/schema", + "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", @@ -400,7 +406,7 @@ TEST(JSONSchema_frame, anchor_on_absolute_subid) { "https://json-schema.org/draft/2020-12/schema", "https://json-schema.org/draft/2020-12/schema", "https://www.example.org", "/items/$anchor", {}, - std::nullopt); + "/items/items"); // References @@ -656,16 +662,16 @@ TEST(JSONSchema_frame, mode_references) { // 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", - "https://json-schema.org/draft/2020-12/schema", "https://www.example.com", - "/$id", {}, std::nullopt); - EXPECT_FRAME_STATIC_POINTER( - frame, "https://www.example.com#/$schema", "https://www.example.com", - "/$schema", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", "https://www.example.com", - "/$schema", {}, std::nullopt); + EXPECT_FRAME_STATIC_POINTER(frame, "https://www.example.com#/$id", + "https://www.example.com", "/$id", + "https://json-schema.org/draft/2020-12/schema", + "https://json-schema.org/draft/2020-12/schema", + "https://www.example.com", "/$id", {}, ""); + EXPECT_FRAME_STATIC_POINTER(frame, "https://www.example.com#/$schema", + "https://www.example.com", "/$schema", + "https://json-schema.org/draft/2020-12/schema", + "https://json-schema.org/draft/2020-12/schema", + "https://www.example.com", "/$schema", {}, ""); EXPECT_FRAME_STATIC_SUBSCHEMA(frame, "https://www.example.com#/items", "https://www.example.com", "/items", @@ -683,18 +689,18 @@ TEST(JSONSchema_frame, mode_references) { "https://json-schema.org/draft/2020-12/schema", "https://json-schema.org/draft/2020-12/schema", "https://www.example.com", "/items/$anchor", {}, - std::nullopt); + "/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", "https://json-schema.org/draft/2020-12/schema", "https://www.example.com", - "/items/$ref", {}, std::nullopt); + "/items/$ref", {}, "/items"); - EXPECT_FRAME_STATIC_POINTER( - frame, "https://www.example.com#/$defs", "https://www.example.com", - "/$defs", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", "https://www.example.com", - "/$defs", {}, std::nullopt); + EXPECT_FRAME_STATIC_POINTER(frame, "https://www.example.com#/$defs", + "https://www.example.com", "/$defs", + "https://json-schema.org/draft/2020-12/schema", + "https://json-schema.org/draft/2020-12/schema", + "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", @@ -740,16 +746,16 @@ TEST(JSONSchema_frame, mode_locations) { // 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", - "https://json-schema.org/draft/2020-12/schema", "https://www.example.com", - "/$id", {}, std::nullopt); - EXPECT_FRAME_STATIC_POINTER( - frame, "https://www.example.com#/$schema", "https://www.example.com", - "/$schema", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", "https://www.example.com", - "/$schema", {}, std::nullopt); + EXPECT_FRAME_STATIC_POINTER(frame, "https://www.example.com#/$id", + "https://www.example.com", "/$id", + "https://json-schema.org/draft/2020-12/schema", + "https://json-schema.org/draft/2020-12/schema", + "https://www.example.com", "/$id", {}, ""); + EXPECT_FRAME_STATIC_POINTER(frame, "https://www.example.com#/$schema", + "https://www.example.com", "/$schema", + "https://json-schema.org/draft/2020-12/schema", + "https://json-schema.org/draft/2020-12/schema", + "https://www.example.com", "/$schema", {}, ""); EXPECT_FRAME_STATIC_SUBSCHEMA(frame, "https://www.example.com#/items", "https://www.example.com", "/items", @@ -767,18 +773,18 @@ TEST(JSONSchema_frame, mode_locations) { "https://json-schema.org/draft/2020-12/schema", "https://json-schema.org/draft/2020-12/schema", "https://www.example.com", "/items/$anchor", {}, - std::nullopt); + "/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", "https://json-schema.org/draft/2020-12/schema", "https://www.example.com", - "/items/$ref", {}, std::nullopt); + "/items/$ref", {}, "/items"); - EXPECT_FRAME_STATIC_POINTER( - frame, "https://www.example.com#/$defs", "https://www.example.com", - "/$defs", "https://json-schema.org/draft/2020-12/schema", - "https://json-schema.org/draft/2020-12/schema", "https://www.example.com", - "/$defs", {}, std::nullopt); + EXPECT_FRAME_STATIC_POINTER(frame, "https://www.example.com#/$defs", + "https://www.example.com", "/$defs", + "https://json-schema.org/draft/2020-12/schema", + "https://json-schema.org/draft/2020-12/schema", + "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",