Skip to content

Commit

Permalink
Introduce a new Comment keyword type (#1458)
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Cruz Viotti <[email protected]>
  • Loading branch information
jviotti authored Jan 21, 2025
1 parent 67c1f0b commit 5808c87
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

4 comments on commit 5808c87

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (macos/llvm)

Benchmark suite Current: 5808c87 Previous: 67c1f0b Ratio
JSON_Array_Of_Objects_Unique 367.75821593455277 ns/iter 354.0729541704298 ns/iter 1.04
JSON_Parse_1 25998.186663900975 ns/iter 21793.42101125833 ns/iter 1.19
JSON_Fast_Hash_Helm_Chart_Lock 52.65060572741298 ns/iter 45.89445251235069 ns/iter 1.15
JSON_Equality_Helm_Chart_Lock 150.65831122847007 ns/iter 140.15645931371807 ns/iter 1.07
Pointer_Object_Traverse 39.66651145760043 ns/iter 27.334450671563445 ns/iter 1.45
Pointer_Object_Try_Traverse 55.140926581710055 ns/iter 42.331123838844334 ns/iter 1.30
Pointer_Push_Back_Pointer_To_Weak_Pointer 196.63758062317987 ns/iter 184.14333267894102 ns/iter 1.07

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (linux/gcc)

Benchmark suite Current: 5808c87 Previous: 67c1f0b Ratio
JSON_Array_Of_Objects_Unique 307.94937910142863 ns/iter 304.51160115122593 ns/iter 1.01
JSON_Parse_1 32332.403125143963 ns/iter 32248.988420028967 ns/iter 1.00
JSON_Fast_Hash_Helm_Chart_Lock 27.432364796069866 ns/iter 29.838693729444923 ns/iter 0.92
JSON_Equality_Helm_Chart_Lock 146.5056622029958 ns/iter 143.9102452058518 ns/iter 1.02
Pointer_Object_Traverse 71.64573731298019 ns/iter 70.58747815224893 ns/iter 1.01
Pointer_Object_Try_Traverse 53.79739938662775 ns/iter 53.60765167559938 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 214.00109962821023 ns/iter 215.28077231594116 ns/iter 0.99

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (linux/llvm)

Benchmark suite Current: 5808c87 Previous: 67c1f0b Ratio
JSON_Array_Of_Objects_Unique 449.4917015339432 ns/iter 438.09050636303937 ns/iter 1.03
JSON_Parse_1 30130.441553383458 ns/iter 29914.47573686325 ns/iter 1.01
JSON_Fast_Hash_Helm_Chart_Lock 55.352262658205 ns/iter 55.40467326921155 ns/iter 1.00
JSON_Equality_Helm_Chart_Lock 139.1898568838531 ns/iter 140.91158288258046 ns/iter 0.99
Pointer_Object_Traverse 44.90688606389682 ns/iter 45.00142747408923 ns/iter 1.00
Pointer_Object_Try_Traverse 49.882315750885496 ns/iter 49.984577602552136 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 352.4822336048327 ns/iter 353.44588477396996 ns/iter 1.00

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (windows/msvc)

Benchmark suite Current: 5808c87 Previous: 67c1f0b Ratio
JSON_Array_Of_Objects_Unique 448.3578125000065 ns/iter 458.1842120934724 ns/iter 0.98
JSON_Parse_1 81194.9330357109 ns/iter 80865.75892856425 ns/iter 1.00
JSON_Fast_Hash_Helm_Chart_Lock 66.41474107143252 ns/iter 67.41774553571389 ns/iter 0.99
JSON_Equality_Helm_Chart_Lock 214.97456249999658 ns/iter 199.23183921713814 ns/iter 1.08
Pointer_Object_Traverse 50.50240178571284 ns/iter 50.736719999997604 ns/iter 1.00
Pointer_Object_Try_Traverse 75.87291294642387 ns/iter 75.89126116071147 ns/iter 1.00
Pointer_Push_Back_Pointer_To_Weak_Pointer 176.00710776833208 ns/iter 175.69245372940324 ns/iter 1.00

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.