Skip to content

Commit

Permalink
Ensure HyperSchema meta-schemas can be bundled
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Cruz Viotti <[email protected]>
  • Loading branch information
jviotti committed Jan 13, 2025
1 parent 74edf62 commit bbc92fc
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/jsonschema/jsonschema_bundle_2019_09_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -526,3 +526,16 @@ TEST(JSONSchema_bundle_2019_09, relative_base_uri_with_ref) {

EXPECT_EQ(document, expected);
}

TEST(JSONSchema_bundle_2019_09, hyperschema_smoke) {
sourcemeta::jsontoolkit::JSON document =
sourcemeta::jsontoolkit::parse(R"JSON({
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$ref": "https://json-schema.org/draft/2019-09/hyper-schema"
})JSON");

sourcemeta::jsontoolkit::bundle(
document, sourcemeta::jsontoolkit::default_schema_walker, test_resolver);

EXPECT_TRUE(document.is_object());
}
13 changes: 13 additions & 0 deletions test/jsonschema/jsonschema_bundle_2020_12_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -599,3 +599,16 @@ TEST(JSONSchema_bundle_2020_12, metaschema) {

EXPECT_EQ(document, expected);
}

TEST(JSONSchema_bundle_2020_12, hyperschema_smoke) {
sourcemeta::jsontoolkit::JSON document =
sourcemeta::jsontoolkit::parse(R"JSON({
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$ref": "https://json-schema.org/draft/2020-12/hyper-schema"
})JSON");

sourcemeta::jsontoolkit::bundle(
document, sourcemeta::jsontoolkit::default_schema_walker, test_resolver);

EXPECT_TRUE(document.is_object());
}
13 changes: 13 additions & 0 deletions test/jsonschema/jsonschema_bundle_draft4_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -543,3 +543,16 @@ TEST(JSONSchema_bundle_draft4, relative_base_uri_with_ref) {

EXPECT_EQ(document, expected);
}

TEST(JSONSchema_bundle_draft4, hyperschema_smoke) {
sourcemeta::jsontoolkit::JSON document =
sourcemeta::jsontoolkit::parse(R"JSON({
"$schema": "http://json-schema.org/draft-04/schema#",
"$ref": "http://json-schema.org/draft-04/hyper-schema#"
})JSON");

sourcemeta::jsontoolkit::bundle(
document, sourcemeta::jsontoolkit::default_schema_walker, test_resolver);

EXPECT_TRUE(document.is_object());
}
13 changes: 13 additions & 0 deletions test/jsonschema/jsonschema_bundle_draft6_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -499,3 +499,16 @@ TEST(JSONSchema_bundle_draft6, relative_base_uri_with_ref) {

EXPECT_EQ(document, expected);
}

TEST(JSONSchema_bundle_draft6, hyperschema_smoke) {
sourcemeta::jsontoolkit::JSON document =
sourcemeta::jsontoolkit::parse(R"JSON({
"$schema": "http://json-schema.org/draft-06/schema#",
"$ref": "http://json-schema.org/draft-06/hyper-schema#"
})JSON");

sourcemeta::jsontoolkit::bundle(
document, sourcemeta::jsontoolkit::default_schema_walker, test_resolver);

EXPECT_TRUE(document.is_object());
}
13 changes: 13 additions & 0 deletions test/jsonschema/jsonschema_bundle_draft7_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -499,3 +499,16 @@ TEST(JSONSchema_bundle_draft7, relative_base_uri_with_ref) {

EXPECT_EQ(document, expected);
}

TEST(JSONSchema_bundle_draft7, hyperschema_smoke) {
sourcemeta::jsontoolkit::JSON document =
sourcemeta::jsontoolkit::parse(R"JSON({
"$schema": "http://json-schema.org/draft-07/schema#",
"$ref": "http://json-schema.org/draft-07/hyper-schema#"
})JSON");

sourcemeta::jsontoolkit::bundle(
document, sourcemeta::jsontoolkit::default_schema_walker, test_resolver);

EXPECT_TRUE(document.is_object());
}

0 comments on commit bbc92fc

Please sign in to comment.