Skip to content

2019-09: dependencies silently disabled for schemas without $schema #329

Description

@aeschli

Found while reviewing #308 (JSON Schema 2019-09 support).

Problem

In src/parser/jsonParser.ts the keyword gate is:

if (keyword === 'dependencies') {
    return context.schemaDraft <= SchemaDraft.v7;
}

When a schema does not declare $schema, effectiveDraft defaults to v2020_12. As a result, schemas that use the legacy dependencies keyword without declaring a draft will no longer have dependencies validated at all (silently dropped).

Existing tests cover dependencies with an explicit $schema (draft-07 enabled, 2019-09 disabled), but there is no test for the no-$schema case.

Question / suggested direction

Confirm this is intended. If backward compatibility matters for undeclared schemas, consider still honoring dependencies when no draft is declared, and add an explicit test.

Severity

Medium — possible backward-compat regression for schemas without $schema.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions