Skip to content

Commit

Permalink
Introduce a new Comment keyword type
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 21, 2025
1 parent 67c1f0b commit 445a42a
Show file tree
Hide file tree
Showing 12 changed files with 78 additions and 73 deletions.
76 changes: 38 additions & 38 deletions src/jsonschema/default_walker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ auto sourcemeta::jsontoolkit::default_schema_walker(
// JSON Schema still defines this for backwards-compatibility
// See https://json-schema.org/draft/2020-12/schema
WALK(HTTPS_BASE "2020-12/vocab/core", "definitions", LocationMembers)
WALK(HTTPS_BASE "2020-12/vocab/core", "$comment", Other)
WALK(HTTPS_BASE "2020-12/vocab/core", "$comment", Comment)
WALK(HTTPS_BASE "2020-12/vocab/core", "$anchor", Other)
WALK(HTTPS_BASE "2020-12/vocab/core", "$vocabulary", Other)
WALK(HTTPS_BASE "2020-12/vocab/core", "$dynamicRef", Reference)
Expand Down Expand Up @@ -116,7 +116,7 @@ auto sourcemeta::jsontoolkit::default_schema_walker(
// JSON Schema still defines this for backwards-compatibility
// See https://json-schema.org/draft/2019-09/schema
WALK(HTTPS_BASE "2019-09/vocab/core", "definitions", LocationMembers)
WALK(HTTPS_BASE "2019-09/vocab/core", "$comment", Other)
WALK(HTTPS_BASE "2019-09/vocab/core", "$comment", Comment)
WALK(HTTPS_BASE "2019-09/vocab/core", "$anchor", Other)
WALK(HTTPS_BASE "2019-09/vocab/core", "$vocabulary", Other)
WALK(HTTPS_BASE "2019-09/vocab/core", "$recursiveRef", Reference)
Expand Down Expand Up @@ -207,7 +207,7 @@ auto sourcemeta::jsontoolkit::default_schema_walker(
WALK_ANY(HTTP_BASE "draft-07/schema#", HTTP_BASE "draft-07/hyper-schema#",
"$ref", Reference)
WALK_ANY(HTTP_BASE "draft-07/schema#", HTTP_BASE "draft-07/hyper-schema#",
"$comment", Other, "$ref")
"$comment", Comment, "$ref")
// For the purpose of compiler optimizations
WALK_ANY(HTTP_BASE "draft-07/schema#", HTTP_BASE "draft-07/hyper-schema#",
"type", Assertion, "properties")
Expand Down Expand Up @@ -278,23 +278,23 @@ auto sourcemeta::jsontoolkit::default_schema_walker(
WALK_ANY(HTTP_BASE "draft-07/schema#", HTTP_BASE "draft-07/hyper-schema#",
"format", Other, "$ref")
WALK_ANY(HTTP_BASE "draft-07/schema#", HTTP_BASE "draft-07/hyper-schema#",
"contentEncoding", Other, "$ref")
"contentEncoding", Comment, "$ref")
WALK_ANY(HTTP_BASE "draft-07/schema#", HTTP_BASE "draft-07/hyper-schema#",
"contentMediaType", Other, "$ref")
"contentMediaType", Comment, "$ref")
WALK_ANY(HTTP_BASE "draft-07/schema#", HTTP_BASE "draft-07/hyper-schema#",
"definitions", LocationMembers, "$ref")
WALK_ANY(HTTP_BASE "draft-07/schema#", HTTP_BASE "draft-07/hyper-schema#",
"title", Other, "$ref")
"title", Comment, "$ref")
WALK_ANY(HTTP_BASE "draft-07/schema#", HTTP_BASE "draft-07/hyper-schema#",
"description", Other, "$ref")
"description", Comment, "$ref")
WALK_ANY(HTTP_BASE "draft-07/schema#", HTTP_BASE "draft-07/hyper-schema#",
"default", Other, "$ref")
"default", Comment, "$ref")
WALK_ANY(HTTP_BASE "draft-07/schema#", HTTP_BASE "draft-07/hyper-schema#",
"readOnly", Other, "$ref")
"readOnly", Comment, "$ref")
WALK_ANY(HTTP_BASE "draft-07/schema#", HTTP_BASE "draft-07/hyper-schema#",
"writeOnly", Other, "$ref")
"writeOnly", Comment, "$ref")
WALK_ANY(HTTP_BASE "draft-07/schema#", HTTP_BASE "draft-07/hyper-schema#",
"examples", Other, "$ref")
"examples", Comment, "$ref")
WALK_MAYBE_DEPENDENT(HTTP_BASE "draft-07/hyper-schema#", "hrefSchema",
ApplicatorValue, HTTP_BASE "draft-07/schema#", "$ref")
WALK_MAYBE_DEPENDENT(HTTP_BASE "draft-07/hyper-schema#", "targetSchema",
Expand All @@ -320,7 +320,7 @@ auto sourcemeta::jsontoolkit::default_schema_walker(
WALK_ANY(HTTP_BASE "draft-06/schema#", HTTP_BASE "draft-06/hyper-schema#",
"$ref", Reference)
WALK_ANY(HTTP_BASE "draft-06/schema#", HTTP_BASE "draft-06/hyper-schema#",
"$comment", Other, "$ref")
"$comment", Comment, "$ref")
// For the purpose of compiler optimizations
WALK_ANY(HTTP_BASE "draft-06/schema#", HTTP_BASE "draft-06/hyper-schema#",
"type", Assertion, "properties")
Expand Down Expand Up @@ -385,23 +385,23 @@ auto sourcemeta::jsontoolkit::default_schema_walker(
WALK_ANY(HTTP_BASE "draft-06/schema#", HTTP_BASE "draft-06/hyper-schema#",
"format", Other, "$ref")
WALK_ANY(HTTP_BASE "draft-06/schema#", HTTP_BASE "draft-06/hyper-schema#",
"contentEncoding", Other, "$ref")
"contentEncoding", Comment, "$ref")
WALK_ANY(HTTP_BASE "draft-06/schema#", HTTP_BASE "draft-06/hyper-schema#",
"contentMediaType", Other, "$ref")
"contentMediaType", Comment, "$ref")
WALK_ANY(HTTP_BASE "draft-06/schema#", HTTP_BASE "draft-06/hyper-schema#",
"definitions", LocationMembers, "$ref")
WALK_ANY(HTTP_BASE "draft-06/schema#", HTTP_BASE "draft-06/hyper-schema#",
"title", Other, "$ref")
"title", Comment, "$ref")
WALK_ANY(HTTP_BASE "draft-06/schema#", HTTP_BASE "draft-06/hyper-schema#",
"description", Other, "$ref")
"description", Comment, "$ref")
WALK_ANY(HTTP_BASE "draft-06/schema#", HTTP_BASE "draft-06/hyper-schema#",
"default", Other, "$ref")
"default", Comment, "$ref")
WALK_ANY(HTTP_BASE "draft-06/schema#", HTTP_BASE "draft-06/hyper-schema#",
"readOnly", Other, "$ref")
"readOnly", Comment, "$ref")
WALK_ANY(HTTP_BASE "draft-06/schema#", HTTP_BASE "draft-06/hyper-schema#",
"writeOnly", Other, "$ref")
"writeOnly", Comment, "$ref")
WALK_ANY(HTTP_BASE "draft-06/schema#", HTTP_BASE "draft-06/hyper-schema#",
"examples", Other, "$ref")
"examples", Comment, "$ref")
WALK_MAYBE_DEPENDENT(HTTP_BASE "draft-06/hyper-schema#", "hrefSchema",
ApplicatorValue, HTTP_BASE "draft-06/schema#", "$ref")
WALK_MAYBE_DEPENDENT(HTTP_BASE "draft-06/hyper-schema#", "targetSchema",
Expand Down Expand Up @@ -484,11 +484,11 @@ auto sourcemeta::jsontoolkit::default_schema_walker(
WALK_ANY(HTTP_BASE "draft-04/schema#", HTTP_BASE "draft-04/hyper-schema#",
"definitions", LocationMembers, "$ref")
WALK_ANY(HTTP_BASE "draft-04/schema#", HTTP_BASE "draft-04/hyper-schema#",
"title", Other, "$ref")
"title", Comment, "$ref")
WALK_ANY(HTTP_BASE "draft-04/schema#", HTTP_BASE "draft-04/hyper-schema#",
"description", Other, "$ref")
"description", Comment, "$ref")
WALK_ANY(HTTP_BASE "draft-04/schema#", HTTP_BASE "draft-04/hyper-schema#",
"default", Other, "$ref")
"default", Comment, "$ref")
WALK_MAYBE_DEPENDENT(HTTP_BASE "draft-04/hyper-schema#", "targetSchema",
ApplicatorValue, HTTP_BASE "draft-04/schema#", "$ref")
WALK_MAYBE_DEPENDENT(HTTP_BASE "draft-04/hyper-schema#", "schema",
Expand Down Expand Up @@ -534,9 +534,9 @@ auto sourcemeta::jsontoolkit::default_schema_walker(
WALK(HTTP_BASE "draft-03/schema#", "maximum", Assertion, "$ref")
WALK(HTTP_BASE "draft-03/schema#", "exclusiveMaximum", Assertion, "$ref")
WALK(HTTP_BASE "draft-03/schema#", "format", Other, "$ref")
WALK(HTTP_BASE "draft-03/schema#", "description", Other, "$ref")
WALK(HTTP_BASE "draft-03/schema#", "title", Other, "$ref")
WALK(HTTP_BASE "draft-03/schema#", "default", Other, "$ref")
WALK(HTTP_BASE "draft-03/schema#", "description", Comment, "$ref")
WALK(HTTP_BASE "draft-03/schema#", "title", Comment, "$ref")
WALK(HTTP_BASE "draft-03/schema#", "default", Comment, "$ref")
WALK_MAYBE_DEPENDENT(HTTP_BASE "draft-03/hyper-schema#", "targetSchema",
ApplicatorValue, HTTP_BASE "draft-03/schema#", "$ref")

Expand Down Expand Up @@ -569,14 +569,14 @@ auto sourcemeta::jsontoolkit::default_schema_walker(
WALK(HTTP_BASE "draft-02/schema#", "uniqueItems", Assertion)
WALK(HTTP_BASE "draft-02/schema#", "requires", ApplicatorValueInPlace)
WALK(HTTP_BASE "draft-02/schema#", "format", Other)
WALK(HTTP_BASE "draft-02/schema#", "title", Other)
WALK(HTTP_BASE "draft-02/schema#", "description", Other)
WALK(HTTP_BASE "draft-02/schema#", "default", Other)
WALK(HTTP_BASE "draft-02/schema#", "title", Comment)
WALK(HTTP_BASE "draft-02/schema#", "description", Comment)
WALK(HTTP_BASE "draft-02/schema#", "default", Comment)
WALK(HTTP_BASE "draft-02/schema#", "divisibleBy", Assertion)
WALK(HTTP_BASE "draft-02/schema#", "disallow", Assertion)
WALK(HTTP_BASE "draft-02/schema#", "extends",
ApplicatorValueOrElementsInPlace)
WALK(HTTP_BASE "draft-02/schema#", "contentEncoding", Other)
WALK(HTTP_BASE "draft-02/schema#", "contentEncoding", Comment)
WALK(HTTP_BASE "draft-02/hyper-schema#", "requires", ApplicatorValueInPlace)
WALK(HTTP_BASE "draft-02/hyper-schema#", "targetSchema", ApplicatorValue)
WALK(HTTP_BASE "draft-02/hyper-schema#", "type", ApplicatorElements)
Expand Down Expand Up @@ -608,13 +608,13 @@ auto sourcemeta::jsontoolkit::default_schema_walker(
WALK(HTTP_BASE "draft-01/schema#", "minItems", Assertion)
WALK(HTTP_BASE "draft-01/schema#", "requires", ApplicatorValueInPlace)
WALK(HTTP_BASE "draft-01/schema#", "format", Other)
WALK(HTTP_BASE "draft-01/schema#", "title", Other)
WALK(HTTP_BASE "draft-01/schema#", "description", Other)
WALK(HTTP_BASE "draft-01/schema#", "default", Other)
WALK(HTTP_BASE "draft-01/schema#", "title", Comment)
WALK(HTTP_BASE "draft-01/schema#", "description", Comment)
WALK(HTTP_BASE "draft-01/schema#", "default", Comment)
WALK(HTTP_BASE "draft-01/schema#", "disallow", Assertion)
WALK(HTTP_BASE "draft-01/schema#", "extends",
ApplicatorValueOrElementsInPlace)
WALK(HTTP_BASE "draft-01/schema#", "contentEncoding", Other)
WALK(HTTP_BASE "draft-01/schema#", "contentEncoding", Comment)
WALK(HTTP_BASE "draft-01/schema#", "optional", Assertion)
WALK(HTTP_BASE "draft-01/schema#", "maxDecimal", Assertion)
WALK(HTTP_BASE "draft-01/hyper-schema#", "type", ApplicatorElements)
Expand Down Expand Up @@ -647,13 +647,13 @@ auto sourcemeta::jsontoolkit::default_schema_walker(
WALK(HTTP_BASE "draft-00/schema#", "minItems", Assertion)
WALK(HTTP_BASE "draft-00/schema#", "requires", ApplicatorValueInPlace)
WALK(HTTP_BASE "draft-00/schema#", "format", Other)
WALK(HTTP_BASE "draft-00/schema#", "title", Other)
WALK(HTTP_BASE "draft-00/schema#", "description", Other)
WALK(HTTP_BASE "draft-00/schema#", "default", Other)
WALK(HTTP_BASE "draft-00/schema#", "title", Comment)
WALK(HTTP_BASE "draft-00/schema#", "description", Comment)
WALK(HTTP_BASE "draft-00/schema#", "default", Comment)
WALK(HTTP_BASE "draft-00/schema#", "disallow", Assertion)
WALK(HTTP_BASE "draft-00/schema#", "extends",
ApplicatorValueOrElementsInPlace)
WALK(HTTP_BASE "draft-00/schema#", "contentEncoding", Other)
WALK(HTTP_BASE "draft-00/schema#", "contentEncoding", Comment)
WALK(HTTP_BASE "draft-00/schema#", "optional", Assertion)
WALK(HTTP_BASE "draft-00/schema#", "maxDecimal", Assertion)
WALK(HTTP_BASE "draft-00/hyper-schema#", "type", ApplicatorElements)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ enum class KeywordType : std::uint8_t {
Reference,
/// The JSON Schema keyword is known but doesn't match any other type
Other,
/// The JSON Schema keyword is considered to be a comment without any
/// additional meaning
Comment,
/// The JSON Schema keyword is an applicator that potentially
/// takes a JSON Schema definition as an argument
ApplicatorValue,
Expand Down
2 changes: 2 additions & 0 deletions src/jsonschema/walker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ auto walk(sourcemeta::jsontoolkit::Pointer &pointer,
break;
case sourcemeta::jsontoolkit::KeywordType::Other:
break;
case sourcemeta::jsontoolkit::KeywordType::Comment:
break;
case sourcemeta::jsontoolkit::KeywordType::Unknown:
break;
}
Expand Down
2 changes: 1 addition & 1 deletion test/jsonschema/jsonschema_default_walker_2019_09_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ TEST(JSONSchema_default_walker_2019_09, core_comment) {
using namespace sourcemeta::jsontoolkit;
const auto result{
default_schema_walker("$comment", VOCABULARIES_2019_09_CORE)};
EXPECT_EQ(result.type, KeywordType::Other);
EXPECT_EQ(result.type, KeywordType::Comment);
EXPECT_TRUE(result.vocabulary.has_value());
EXPECT_EQ(result.vocabulary.value(),
"https://json-schema.org/draft/2019-09/vocab/core");
Expand Down
2 changes: 1 addition & 1 deletion test/jsonschema/jsonschema_default_walker_2020_12_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ TEST(JSONSchema_default_walker_2020_12, core_comment) {
using namespace sourcemeta::jsontoolkit;
const auto result{
default_schema_walker("$comment", VOCABULARIES_2020_12_CORE)};
EXPECT_EQ(result.type, KeywordType::Other);
EXPECT_EQ(result.type, KeywordType::Comment);
EXPECT_TRUE(result.vocabulary.has_value());
EXPECT_EQ(result.vocabulary.value(),
"https://json-schema.org/draft/2020-12/vocab/core");
Expand Down
8 changes: 4 additions & 4 deletions test/jsonschema/jsonschema_default_walker_draft0_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ TEST(JSONSchema_default_walker_draft0, format) {
TEST(JSONSchema_default_walker_draft0, title) {
using namespace sourcemeta::jsontoolkit;
const auto result{default_schema_walker("title", VOCABULARIES_DRAFT0)};
EXPECT_EQ(result.type, KeywordType::Other);
EXPECT_EQ(result.type, KeywordType::Comment);
EXPECT_TRUE(result.vocabulary.has_value());
EXPECT_EQ(result.vocabulary.value(),
"http://json-schema.org/draft-00/schema#");
Expand All @@ -214,7 +214,7 @@ TEST(JSONSchema_default_walker_draft0, title) {
TEST(JSONSchema_default_walker_draft0, description) {
using namespace sourcemeta::jsontoolkit;
const auto result{default_schema_walker("description", VOCABULARIES_DRAFT0)};
EXPECT_EQ(result.type, KeywordType::Other);
EXPECT_EQ(result.type, KeywordType::Comment);
EXPECT_TRUE(result.vocabulary.has_value());
EXPECT_EQ(result.vocabulary.value(),
"http://json-schema.org/draft-00/schema#");
Expand All @@ -224,7 +224,7 @@ TEST(JSONSchema_default_walker_draft0, description) {
TEST(JSONSchema_default_walker_draft0, default) {
using namespace sourcemeta::jsontoolkit;
const auto result{default_schema_walker("default", VOCABULARIES_DRAFT0)};
EXPECT_EQ(result.type, KeywordType::Other);
EXPECT_EQ(result.type, KeywordType::Comment);
EXPECT_TRUE(result.vocabulary.has_value());
EXPECT_EQ(result.vocabulary.value(),
"http://json-schema.org/draft-00/schema#");
Expand Down Expand Up @@ -255,7 +255,7 @@ TEST(JSONSchema_default_walker_draft0, contentEncoding) {
using namespace sourcemeta::jsontoolkit;
const auto result{
default_schema_walker("contentEncoding", VOCABULARIES_DRAFT0)};
EXPECT_EQ(result.type, KeywordType::Other);
EXPECT_EQ(result.type, KeywordType::Comment);
EXPECT_TRUE(result.vocabulary.has_value());
EXPECT_EQ(result.vocabulary.value(),
"http://json-schema.org/draft-00/schema#");
Expand Down
8 changes: 4 additions & 4 deletions test/jsonschema/jsonschema_default_walker_draft1_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ TEST(JSONSchema_default_walker_draft1, format) {
TEST(JSONSchema_default_walker_draft1, title) {
using namespace sourcemeta::jsontoolkit;
const auto result{default_schema_walker("title", VOCABULARIES_DRAFT1)};
EXPECT_EQ(result.type, KeywordType::Other);
EXPECT_EQ(result.type, KeywordType::Comment);
EXPECT_TRUE(result.vocabulary.has_value());
EXPECT_EQ(result.vocabulary.value(),
"http://json-schema.org/draft-01/schema#");
Expand All @@ -214,7 +214,7 @@ TEST(JSONSchema_default_walker_draft1, title) {
TEST(JSONSchema_default_walker_draft1, description) {
using namespace sourcemeta::jsontoolkit;
const auto result{default_schema_walker("description", VOCABULARIES_DRAFT1)};
EXPECT_EQ(result.type, KeywordType::Other);
EXPECT_EQ(result.type, KeywordType::Comment);
EXPECT_TRUE(result.vocabulary.has_value());
EXPECT_EQ(result.vocabulary.value(),
"http://json-schema.org/draft-01/schema#");
Expand All @@ -224,7 +224,7 @@ TEST(JSONSchema_default_walker_draft1, description) {
TEST(JSONSchema_default_walker_draft1, default) {
using namespace sourcemeta::jsontoolkit;
const auto result{default_schema_walker("default", VOCABULARIES_DRAFT1)};
EXPECT_EQ(result.type, KeywordType::Other);
EXPECT_EQ(result.type, KeywordType::Comment);
EXPECT_TRUE(result.vocabulary.has_value());
EXPECT_EQ(result.vocabulary.value(),
"http://json-schema.org/draft-01/schema#");
Expand Down Expand Up @@ -255,7 +255,7 @@ TEST(JSONSchema_default_walker_draft1, contentEncoding) {
using namespace sourcemeta::jsontoolkit;
const auto result{
default_schema_walker("contentEncoding", VOCABULARIES_DRAFT1)};
EXPECT_EQ(result.type, KeywordType::Other);
EXPECT_EQ(result.type, KeywordType::Comment);
EXPECT_TRUE(result.vocabulary.has_value());
EXPECT_EQ(result.vocabulary.value(),
"http://json-schema.org/draft-01/schema#");
Expand Down
8 changes: 4 additions & 4 deletions test/jsonschema/jsonschema_default_walker_draft2_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ TEST(JSONSchema_default_walker_draft2, format) {
TEST(JSONSchema_default_walker_draft2, title) {
using namespace sourcemeta::jsontoolkit;
const auto result{default_schema_walker("title", VOCABULARIES_DRAFT2)};
EXPECT_EQ(result.type, KeywordType::Other);
EXPECT_EQ(result.type, KeywordType::Comment);
EXPECT_TRUE(result.vocabulary.has_value());
EXPECT_EQ(result.vocabulary.value(),
"http://json-schema.org/draft-02/schema#");
Expand All @@ -224,7 +224,7 @@ TEST(JSONSchema_default_walker_draft2, title) {
TEST(JSONSchema_default_walker_draft2, description) {
using namespace sourcemeta::jsontoolkit;
const auto result{default_schema_walker("description", VOCABULARIES_DRAFT2)};
EXPECT_EQ(result.type, KeywordType::Other);
EXPECT_EQ(result.type, KeywordType::Comment);
EXPECT_TRUE(result.vocabulary.has_value());
EXPECT_EQ(result.vocabulary.value(),
"http://json-schema.org/draft-02/schema#");
Expand All @@ -234,7 +234,7 @@ TEST(JSONSchema_default_walker_draft2, description) {
TEST(JSONSchema_default_walker_draft2, default) {
using namespace sourcemeta::jsontoolkit;
const auto result{default_schema_walker("default", VOCABULARIES_DRAFT2)};
EXPECT_EQ(result.type, KeywordType::Other);
EXPECT_EQ(result.type, KeywordType::Comment);
EXPECT_TRUE(result.vocabulary.has_value());
EXPECT_EQ(result.vocabulary.value(),
"http://json-schema.org/draft-02/schema#");
Expand Down Expand Up @@ -275,7 +275,7 @@ TEST(JSONSchema_default_walker_draft2, contentEncoding) {
using namespace sourcemeta::jsontoolkit;
const auto result{
default_schema_walker("contentEncoding", VOCABULARIES_DRAFT2)};
EXPECT_EQ(result.type, KeywordType::Other);
EXPECT_EQ(result.type, KeywordType::Comment);
EXPECT_TRUE(result.vocabulary.has_value());
EXPECT_EQ(result.vocabulary.value(),
"http://json-schema.org/draft-02/schema#");
Expand Down
6 changes: 3 additions & 3 deletions test/jsonschema/jsonschema_default_walker_draft3_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ TEST(JSONSchema_default_walker_draft3, format) {
TEST(JSONSchema_default_walker_draft3, title) {
using namespace sourcemeta::jsontoolkit;
const auto result{default_schema_walker("title", VOCABULARIES_DRAFT3)};
EXPECT_EQ(result.type, KeywordType::Other);
EXPECT_EQ(result.type, KeywordType::Comment);
EXPECT_TRUE(result.vocabulary.has_value());
EXPECT_EQ(result.vocabulary.value(),
"http://json-schema.org/draft-03/schema#");
Expand All @@ -278,7 +278,7 @@ TEST(JSONSchema_default_walker_draft3, title) {
TEST(JSONSchema_default_walker_draft3, description) {
using namespace sourcemeta::jsontoolkit;
const auto result{default_schema_walker("description", VOCABULARIES_DRAFT3)};
EXPECT_EQ(result.type, KeywordType::Other);
EXPECT_EQ(result.type, KeywordType::Comment);
EXPECT_TRUE(result.vocabulary.has_value());
EXPECT_EQ(result.vocabulary.value(),
"http://json-schema.org/draft-03/schema#");
Expand All @@ -289,7 +289,7 @@ TEST(JSONSchema_default_walker_draft3, description) {
TEST(JSONSchema_default_walker_draft3, default) {
using namespace sourcemeta::jsontoolkit;
const auto result{default_schema_walker("default", VOCABULARIES_DRAFT3)};
EXPECT_EQ(result.type, KeywordType::Other);
EXPECT_EQ(result.type, KeywordType::Comment);
EXPECT_TRUE(result.vocabulary.has_value());
EXPECT_EQ(result.vocabulary.value(),
"http://json-schema.org/draft-03/schema#");
Expand Down
Loading

0 comments on commit 445a42a

Please sign in to comment.