Skip to content

Conversation

damioune123
Copy link

Support JSON Schema 2019-09 and 2020-12 by migrating to @hyperjump/json-schema

🎯 Overview

Fixes #1112 by replacing AJV with @hyperjump/json-schema to enable support for JSON Schema 2019-09 and 2020-12 specifications.

🔄 Key Changes

Dependency Migration

  • Removed: ajv and ajv-draft-04 (limited to draft-04/07)
  • Added: @hyperjump/json-schema (supports all drafts including Draft 04, Draft 07, 2019-09, 2020-12)

Schema Service Updates

  • Simplified validation logic in yamlSchemaService.ts
  • Maintained full backward compatibility with existing draft-04/07 schemas
  • Added native support for modern JSON Schema features:
    • $defs keyword
    • unevaluatedProperties
    • Modern exclusiveMinimum/exclusiveMaximum

Comprehensive Test Coverage

  • 11 new test cases validating 2019-09 and 2020-12 support
  • Test fixtures for both schema versions
  • Verification of modern keyword handling
  • Mixed version compatibility testing

Replace AJV dependencies with @hyperjump/json-schema to reduce bundle size
and prepare for JSON Schema 2019-09/2020-12 support. Simplifies schema
meta-validation while maintaining backward compatibility.
@damioune123 damioune123 marked this pull request as draft July 22, 2025 20:00
@damioune123 damioune123 force-pushed the feature/1112-support-json-schema-2019-and-2020 branch 6 times, most recently from f6b2134 to c2874e5 Compare July 22, 2025 22:39
@damioune123 damioune123 force-pushed the feature/1112-support-json-schema-2019-and-2020 branch from c2874e5 to bfa433e Compare July 22, 2025 22:43
@damioune123 damioune123 marked this pull request as ready for review July 22, 2025 22:45
@damioune123
Copy link
Author

damioune123 commented Jul 22, 2025

@datho7561 FYI #1006

@damioune123 damioune123 force-pushed the feature/1112-support-json-schema-2019-and-2020 branch from 1d275c1 to 115dc4f Compare July 23, 2025 12:11
@damioune123 damioune123 marked this pull request as draft July 23, 2025 15:05
@damioune123 damioune123 marked this pull request as ready for review July 23, 2025 17:10
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

ESLint found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@coveralls
Copy link

Coverage Status

coverage: 83.964% (+0.008%) from 83.956%
when pulling c3abaf3 on damioune123:feature/1112-support-json-schema-2019-and-2020
into 3821411 on redhat-developer:main.

@ernestmajdalani
Copy link

We need this !

@HanyAkoury
Copy link

Amazing, really need this ! When can this be merged?

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.

Support JSON Schema 2019 and 2020
4 participants