Skip to content

Conversation

@shin19991207
Copy link
Member

@shin19991207 shin19991207 commented Jan 16, 2026

What does this PR do?

Changes

Refactor / architecture

  • Extract instance validation into a validator layer (base + draft-specific validators)
  • Keep backwards compatibility where reasonable (draft-07 behavior remains the baseline)

Draft 2019-09 support

keyword/item implementation tests note
$anchor resolution
$defs resolution (renamed + definitions compat) - - already covered (it resolved to the same way as definitions)
$id - - covered by meta-validation
$recursiveAnchor / $recursiveRef
$ref (allow other keywords alongside)
$vocabulary - - covered by meta-validation
dependentSchemas dependencies compat
unevaluatedItems
unevaluatedProperties
dependentRequired dependencies compat
contains + minContains / maxContains

Draft 2020-12 support

keyword/item implementation tests note
prefixItems + items
$dynamicAnchor / $dynamicRef
contains and unevaluatedItems
Compound Schema Document
Regular Expressions - - covered by safeCreateUnicodeRegExp()
Media Type Changes - - not related to validation
format-annotation + format-assertion

...

What issues does this PR fix or reference?

#856
#1112

Related work: #1164 adds draft 2019/2020 meta‑validation support.

Is it tested? How?

…pendencies for backward compatibility

Signed-off-by: Morgan Chang <[email protected]>
import type { ASTNode } from '../jsonASTTypes';

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function getNodeValue(node: ASTNode): any {

Check warning

Code scanning / ESLint

Disallow the `any` type Warning

Unexpected any. Specify a different type.
public enumValueMatch = false;

// eslint-disable-next-line @typescript-eslint/no-explicit-any
public enumValues: any[] = null;

Check warning

Code scanning / ESLint

Disallow the `any` type Warning

Unexpected any. Specify a different type.
originalSchema: JSONSchema,
validationResult: ValidationResult,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_options: Options

Check warning

Code scanning / ESLint

Disallow unused variables Warning

'_options' is defined but never used.
// ---------------- unevaluated hooks (2019/2020) ----------------
protected applyUnevaluatedProperties(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_node: ObjectASTNode,

Check warning

Code scanning / ESLint

Disallow unused variables Warning

'_node' is defined but never used.
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_node: ObjectASTNode,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_schema: JSONSchema,

Check warning

Code scanning / ESLint

Disallow unused variables Warning

'_schema' is defined but never used.
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_validationResult: ValidationResult,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_matchingSchemas: ISchemaCollector,

Check warning

Code scanning / ESLint

Disallow unused variables Warning

'_matchingSchemas' is defined but never used.
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_matchingSchemas: ISchemaCollector,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_options: Options

Check warning

Code scanning / ESLint

Disallow unused variables Warning

'_options' is defined but never used.

const propertyNode = child.type === 'property' ? child : (child.parent as ASTNode);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const keyNode = (propertyNode as any).keyNode;

Check warning

Code scanning / ESLint

Disallow the `any` type Warning

Unexpected any. Specify a different type.
let current: any = schema;
if (path[0] === '/') {
path = path.substr(1);
const push = (v: any): void => {

Check warning

Code scanning / ESLint

Disallow the `any` type Warning

Unexpected any. Specify a different type.
// JSON pointer style (starts with "/")
if (refPath[0] === '/') {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let current: any = schemaRoot;

Check warning

Code scanning / ESLint

Disallow the `any` type Warning

Unexpected any. Specify a different type.
@coveralls
Copy link

Coverage Status

coverage: 82.564% (-0.1%) from 82.665%
when pulling ae5acdb on shin19991207:chang-patch-2019-2020
into 7b38a36 on redhat-developer:main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants