Skip to content

Add regression coverage for dependencies in schemas without $schema#334

Draft
aeschli with Copilot wants to merge 3 commits into
mainfrom
copilot/2019-09-fix-dependencies-validation
Draft

Add regression coverage for dependencies in schemas without $schema#334
aeschli with Copilot wants to merge 3 commits into
mainfrom
copilot/2019-09-fix-dependencies-validation

Conversation

Copilot AI commented Jul 6, 2026

Copy link
Copy Markdown

Schemas that omit $schema now default to modern draft handling, which raised the risk of legacy dependencies being silently skipped. Existing coverage only checked explicit draft behavior, leaving the undeclared-schema path untested.

  • Problem

    • Add coverage for the backward-compatibility case where a schema uses legacy dependencies without declaring $schema.
    • Ensure the default jsonDoc.validate(...) path continues to honor dependencies for both property-array and schema forms.
  • Test coverage

    • Extend existing parser tests to validate legacy dependencies through the inferred-draft path instead of only the helper that forces an explicit draft.
    • Cover both legacy shapes:
      • dependencies: { a: ['b'] }
      • dependencies: { a: { ...subschema... } }
  • Intent made explicit

    • Introduce a small test helper for the inferred-draft validation path so the regression target is clear in the test body.
function validateWithInferredDraft(jsonDoc: JSONDocument, textDoc: TextDocument, schema: JSONSchema) {
	return jsonDoc.validate(textDoc, schema);
}

Copilot AI changed the title [WIP] Fix dependencies validation for schemas without $schema Add regression coverage for dependencies in schemas without $schema Jul 6, 2026
Copilot AI requested a review from aeschli July 6, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants