Skip to content

Commit 5181fd3

Browse files
authored
Declare the OpenAPI v3.0 nullable dependency on type in the walker (#3018)
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
1 parent 21976a6 commit 5181fd3

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎src/core/jsonschema/known_walker.cc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3767,7 +3767,7 @@ constexpr std::array<Variant, 728> VARIANTS{{
37673767
.secondary = std::nullopt,
37683768
.result = {SchemaKeywordType::Assertion,
37693769
Known::OPENAPI_3_0_BASE,
3770-
{},
3770+
KEYWORDS_TYPE,
37713771
{},
37723772
INSTANCES_ANY}},
37733773
{.vocabulary = Known::JSON_SCHEMA_2020_12_APPLICATOR,

‎test/jsonschema/jsonschema_walker_openapi_test.cc‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,8 @@ TEST(openapi_3_0_nullable) {
473473
EXPECT_EQ(result.type, SchemaKeywordType::Assertion);
474474
EXPECT_TRUE(result.vocabulary.has_value());
475475
EXPECT_VOCABULARY_KNOWN(result.vocabulary.value(), OPENAPI_3_0_BASE);
476-
EXPECT_TRUE(result.dependencies.empty());
476+
EXPECT_TRUE(std::ranges::equal(result.dependencies,
477+
std::to_array<std::string_view>({"type"})));
477478
EXPECT_TRUE(result.order_dependencies.empty());
478479
EXPECT_TRUE(result.instances.none());
479480
}

0 commit comments

Comments
 (0)