more fixes for the schema test suite (#151)

* add type SchemaDraft, fix schema suite tests for unevaluatedItems

* work on additionalProperties
This commit is contained in:
Martin Aeschlimann 2022-09-26 21:03:43 +02:00 коммит произвёл GitHub
Родитель fa4ed5ccae
Коммит e73082b16f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
8 изменённых файлов: 583 добавлений и 562 удалений

Просмотреть файл

@ -1,3 +1,8 @@
5.2.0 / 2022-08/19
================
* new type `SchemaDraft`, representing the offical JSON schema draft versions
* new property `DocumentLanguageSettings.schemaDraft` to specify the schema version to use, if the schema does not contain a `$schema` property
5.1.0 / 2022-07-11
================
* new API option `FormattingOptions.keepLines` to indicate the formatter should keep the initial line positions

Просмотреть файл

@ -8,7 +8,7 @@ import { JSONHover } from './services/jsonHover';
import { JSONValidation } from './services/jsonValidation';
import { JSONDocumentSymbols } from './services/jsonDocumentSymbols';
import { parse as parseJSON, JSONDocument as InternalJSONDocument, newJSONDocument } from './parser/jsonParser';
import { parse as parseJSON, newJSONDocument } from './parser/jsonParser';
import { schemaContributions } from './services/configuration';
import { JSONSchemaService } from './services/jsonSchemaService';
import { getFoldingRanges } from './services/jsonFolding';

Просмотреть файл

@ -136,6 +136,15 @@ export interface LanguageSettings {
export type SeverityLevel = 'error' | 'warning' | 'ignore';
export enum SchemaDraft {
v3 = 3,
v4 = 4,
v6 = 6,
v7 = 7,
v2019_09 = 19,
v2020_12 = 20
}
export interface DocumentLanguageSettings {
/**
* The severity of reported comments. If not set, 'LanguageSettings.allowComments' defines whether comments are ignored or reported as errors.
@ -156,6 +165,11 @@ export interface DocumentLanguageSettings {
* The severity of problems that occurred when resolving and loading schemas. If set to 'ignore', schema resolving problems are not reported. If not set, 'warning' is used.
*/
schemaRequest?: SeverityLevel;
/**
* The draft version of schema to use if the schema doesn't specify one at $schema
*/
schemaDraft?: SchemaDraft;
}
export interface SchemaConfiguration {

Просмотреть файл

@ -7,7 +7,7 @@ import * as Json from 'jsonc-parser';
import { JSONSchema, JSONSchemaMap, JSONSchemaRef } from '../jsonSchema';
import { isNumber, equals, isBoolean, isString, isDefined, isObject } from '../utils/objects';
import { extendedRegExp, stringLength } from '../utils/strings';
import { TextDocument, ASTNode, ObjectASTNode, ArrayASTNode, BooleanASTNode, NumberASTNode, StringASTNode, NullASTNode, PropertyASTNode, JSONPath, ErrorCode, Diagnostic, DiagnosticSeverity, Range } from '../jsonLanguageTypes';
import { TextDocument, ASTNode, ObjectASTNode, ArrayASTNode, BooleanASTNode, NumberASTNode, StringASTNode, NullASTNode, PropertyASTNode, JSONPath, ErrorCode, Diagnostic, DiagnosticSeverity, Range, SchemaDraft } from '../jsonLanguageTypes';
import * as nls from 'vscode-nls';
@ -160,6 +160,7 @@ export function asSchema(schema: JSONSchemaRef | undefined): JSONSchema | undefi
export interface JSONDocumentConfig {
collectComments?: boolean;
schemaDraft?: SchemaDraft;
}
export interface IApplicableSchema {
@ -172,6 +173,15 @@ export enum EnumMatch {
Key, Enum
}
const schemaDraftFromId : { [id:string]: SchemaDraft } = {
'http://json-schema.org/draft-03/schema#': SchemaDraft.v3,
'http://json-schema.org/draft-04/schema#': SchemaDraft.v4,
'http://json-schema.org/draft-06/schema#': SchemaDraft.v6,
'http://json-schema.org/draft-07/schema#': SchemaDraft.v7,
'https://json-schema.org/draft/2019-09/schema': SchemaDraft.v2019_09,
'https://json-schema.org/draft/2020-12/schema': SchemaDraft.v2020_12
};
export interface ISchemaCollector {
schemas: IApplicableSchema[];
add(schema: IApplicableSchema): void;
@ -180,6 +190,16 @@ export interface ISchemaCollector {
newSub(): ISchemaCollector;
}
export interface IEvaluationContext {
readonly schemaDraft: SchemaDraft;
}
class EvaluationContext implements IEvaluationContext {
constructor(public readonly schemaDraft: SchemaDraft) {
}
}
class SchemaCollector implements ISchemaCollector {
schemas: IApplicableSchema[] = [];
constructor(private focusOffset = -1, private exclude?: ASTNode) {
@ -201,9 +221,9 @@ class SchemaCollector implements ISchemaCollector {
class NoOpSchemaCollector implements ISchemaCollector {
private constructor() { }
get schemas() { return []; }
add(schema: IApplicableSchema) { }
merge(other: ISchemaCollector) { }
include(node: ASTNode) { return true; }
add(_schema: IApplicableSchema) { }
merge(_other: ISchemaCollector) { }
include(_node: ASTNode) { return true; }
newSub(): ISchemaCollector { return this; }
static instance = new NoOpSchemaCollector();
@ -233,14 +253,11 @@ export class ValidationResult {
return !!this.problems.length;
}
public mergeAll(validationResults: ValidationResult[]): void {
for (const validationResult of validationResults) {
this.merge(validationResult);
}
}
public merge(validationResult: ValidationResult): void {
this.problems = this.problems.concat(validationResult.problems);
this.propertiesMatches += validationResult.propertiesMatches;
this.propertiesValueMatches += validationResult.propertiesValueMatches;
this.mergeProcessedProperties(validationResult);
}
public mergeEnumValues(validationResult: ValidationResult): void {
@ -255,7 +272,7 @@ export class ValidationResult {
}
public mergePropertyMatch(propertyValidationResult: ValidationResult): void {
this.merge(propertyValidationResult);
this.problems = this.problems.concat(propertyValidationResult.problems);
this.propertiesMatches++;
if (propertyValidationResult.enumValueMatch || !propertyValidationResult.hasProblems() && propertyValidationResult.propertiesMatches) {
this.propertiesValueMatches++;
@ -332,10 +349,10 @@ export class JSONDocument {
}
}
public validate(textDocument: TextDocument, schema: JSONSchema | undefined, severity: DiagnosticSeverity = DiagnosticSeverity.Warning): Diagnostic[] | undefined {
public validate(textDocument: TextDocument, schema: JSONSchema | undefined, severity: DiagnosticSeverity = DiagnosticSeverity.Warning, schemaDraft?: SchemaDraft): Diagnostic[] | undefined {
if (this.root && schema) {
const validationResult = new ValidationResult();
validate(this.root, schema, validationResult, NoOpSchemaCollector.instance);
validate(this.root, schema, validationResult, NoOpSchemaCollector.instance, new EvaluationContext(schemaDraft ?? getSchemaDraft(schema)));
return validationResult.problems.map(p => {
const range = Range.create(textDocument.positionAt(p.location.offset), textDocument.positionAt(p.location.offset + p.location.length));
return Diagnostic.create(range, p.message, p.severity ?? severity, p.code);
@ -345,21 +362,31 @@ export class JSONDocument {
}
public getMatchingSchemas(schema: JSONSchema, focusOffset: number = -1, exclude?: ASTNode): IApplicableSchema[] {
const matchingSchemas = new SchemaCollector(focusOffset, exclude);
if (this.root && schema) {
validate(this.root, schema, new ValidationResult(), matchingSchemas);
const matchingSchemas = new SchemaCollector(focusOffset, exclude);
const schemaDraft = getSchemaDraft(schema);
const context = new EvaluationContext(schemaDraft);
validate(this.root, schema, new ValidationResult(), matchingSchemas, context);
return matchingSchemas.schemas;
}
return matchingSchemas.schemas;
return [];
}
}
function getSchemaDraft(schema: JSONSchema, fallBack = SchemaDraft.v2020_12 ) {
let schemaId = schema.$schema;
if (schemaId) {
return schemaDraftFromId[schemaId] ?? fallBack;
}
return fallBack;
}
function validate(n: ASTNode | undefined, schema: JSONSchema, validationResult: ValidationResult, matchingSchemas: ISchemaCollector): void {
function validate(n: ASTNode | undefined, schema: JSONSchema, validationResult: ValidationResult, matchingSchemas: ISchemaCollector, context: IEvaluationContext): void {
if (!n || !matchingSchemas.include(n)) {
return;
}
if (n.type === 'property') {
return validate(n.valueNode, schema, validationResult, matchingSchemas);
return validate(n.valueNode, schema, validationResult, matchingSchemas, context);
}
const node = n;
_validateNode();
@ -405,14 +432,18 @@ function validate(n: ASTNode | undefined, schema: JSONSchema, validationResult:
}
if (Array.isArray(schema.allOf)) {
for (const subSchemaRef of schema.allOf) {
validate(node, asSchema(subSchemaRef), validationResult, matchingSchemas);
const subValidationResult = new ValidationResult();
const subMatchingSchemas = matchingSchemas.newSub();
validate(node, asSchema(subSchemaRef), subValidationResult, subMatchingSchemas, context);
validationResult.merge(subValidationResult);
matchingSchemas.merge(subMatchingSchemas);
}
}
const notSchema = asSchema(schema.not);
if (notSchema) {
const subValidationResult = new ValidationResult();
const subMatchingSchemas = matchingSchemas.newSub();
validate(node, notSchema, subValidationResult, subMatchingSchemas);
validate(node, notSchema, subValidationResult, subMatchingSchemas, context);
if (!subValidationResult.hasProblems()) {
validationResult.problems.push({
location: { offset: node.offset, length: node.length },
@ -434,7 +465,7 @@ function validate(n: ASTNode | undefined, schema: JSONSchema, validationResult:
const subSchema = asSchema(subSchemaRef);
const subValidationResult = new ValidationResult();
const subMatchingSchemas = matchingSchemas.newSub();
validate(node, subSchema, subValidationResult, subMatchingSchemas);
validate(node, subSchema, subValidationResult, subMatchingSchemas, context);
if (!subValidationResult.hasProblems()) {
matches.push(subSchema);
}
@ -469,9 +500,6 @@ function validate(n: ASTNode | undefined, schema: JSONSchema, validationResult:
}
if (bestMatch) {
validationResult.merge(bestMatch.validationResult);
validationResult.propertiesMatches += bestMatch.validationResult.propertiesMatches;
validationResult.propertiesValueMatches += bestMatch.validationResult.propertiesValueMatches;
validationResult.mergeProcessedProperties(bestMatch.validationResult);
matchingSchemas.merge(bestMatch.matchingSchemas);
}
return matches.length;
@ -487,12 +515,9 @@ function validate(n: ASTNode | undefined, schema: JSONSchema, validationResult:
const subValidationResult = new ValidationResult();
const subMatchingSchemas = matchingSchemas.newSub();
validate(node, asSchema(schema), subValidationResult, subMatchingSchemas);
validate(node, asSchema(schema), subValidationResult, subMatchingSchemas, context);
validationResult.merge(subValidationResult);
validationResult.propertiesMatches += subValidationResult.propertiesMatches;
validationResult.propertiesValueMatches += subValidationResult.propertiesValueMatches;
validationResult.mergeProcessedProperties(subValidationResult);
matchingSchemas.merge(subMatchingSchemas);
};
@ -501,7 +526,7 @@ function validate(n: ASTNode | undefined, schema: JSONSchema, validationResult:
const subValidationResult = new ValidationResult();
const subMatchingSchemas = matchingSchemas.newSub();
validate(node, subSchema, subValidationResult, subMatchingSchemas);
validate(node, subSchema, subValidationResult, subMatchingSchemas, context);
matchingSchemas.merge(subMatchingSchemas);
validationResult.mergeProcessedProperties(subValidationResult);
@ -718,8 +743,7 @@ function validate(n: ASTNode | undefined, schema: JSONSchema, validationResult:
function _validateArrayNode(node: ArrayASTNode): void {
let prefixItemsSchemas: JSONSchemaRef[] | undefined;
let additionalItemSchema: JSONSchemaRef | undefined;
let isSchema_2020_12 = Array.isArray(schema.prefixItems) || (schema.items !== undefined && !Array.isArray(schema.items) && schema.additionalItems === undefined);
if (isSchema_2020_12) {
if (context.schemaDraft >= SchemaDraft.v2020_12) {
prefixItemsSchemas = schema.prefixItems;
additionalItemSchema = !Array.isArray(schema.items) ? schema.items : undefined;
} else {
@ -735,7 +759,7 @@ function validate(n: ASTNode | undefined, schema: JSONSchema, validationResult:
const itemValidationResult = new ValidationResult();
const item = node.items[index];
if (item) {
validate(item, subSchema, itemValidationResult, matchingSchemas);
validate(item, subSchema, itemValidationResult, matchingSchemas, context);
validationResult.mergePropertyMatch(itemValidationResult);
}
validationResult.processedProperties.add(String(index));
@ -756,7 +780,7 @@ function validate(n: ASTNode | undefined, schema: JSONSchema, validationResult:
} else {
for (; index < node.items.length; index++) {
const itemValidationResult = new ValidationResult();
validate(node.items[index], additionalItemSchema, itemValidationResult, matchingSchemas);
validate(node.items[index], additionalItemSchema, itemValidationResult, matchingSchemas, context);
validationResult.mergePropertyMatch(itemValidationResult);
validationResult.processedProperties.add(String(index));
}
@ -769,10 +793,10 @@ function validate(n: ASTNode | undefined, schema: JSONSchema, validationResult:
for (let index = 0; index < node.items.length; index++) {
const item = node.items[index];
const itemValidationResult = new ValidationResult();
validate(item, containsSchema, itemValidationResult, NoOpSchemaCollector.instance);
validate(item, containsSchema, itemValidationResult, NoOpSchemaCollector.instance, context);
if (!itemValidationResult.hasProblems()) {
containsCount++;
if (isSchema_2020_12) {
if (context.schemaDraft >= SchemaDraft.v2020_12) {
validationResult.processedProperties.add(String(index));
}
}
@ -808,7 +832,7 @@ function validate(n: ASTNode | undefined, schema: JSONSchema, validationResult:
});
} else {
const itemValidationResult = new ValidationResult();
validate(node.items[i], <any>schema.additionalItems, itemValidationResult, matchingSchemas);
validate(node.items[i], <any>schema.unevaluatedItems, itemValidationResult, matchingSchemas, context);
validationResult.mergePropertyMatch(itemValidationResult);
}
}
@ -892,7 +916,7 @@ function validate(n: ASTNode | undefined, schema: JSONSchema, validationResult:
}
} else {
const propertyValidationResult = new ValidationResult();
validate(child, propertySchema, propertyValidationResult, matchingSchemas);
validate(child, propertySchema, propertyValidationResult, matchingSchemas, context);
validationResult.mergePropertyMatch(propertyValidationResult);
}
}
@ -924,7 +948,7 @@ function validate(n: ASTNode | undefined, schema: JSONSchema, validationResult:
}
} else {
const propertyValidationResult = new ValidationResult();
validate(child, propertySchema, propertyValidationResult, matchingSchemas);
validate(child, propertySchema, propertyValidationResult, matchingSchemas, context);
validationResult.mergePropertyMatch(propertyValidationResult);
}
}
@ -937,7 +961,7 @@ function validate(n: ASTNode | undefined, schema: JSONSchema, validationResult:
const additionalProperties = schema.additionalProperties;
if (additionalProperties !== undefined && additionalProperties !== true) {
if (additionalProperties !== undefined) {
for (const propertyName of unprocessedProperties) {
propertyProcessed(propertyName);
const child = seenKeys[propertyName];
@ -949,16 +973,16 @@ function validate(n: ASTNode | undefined, schema: JSONSchema, validationResult:
location: { offset: propertyNode.keyNode.offset, length: propertyNode.keyNode.length },
message: schema.errorMessage || localize('DisallowedExtraPropWarning', 'Property {0} is not allowed.', propertyName)
});
} else {
} else if (additionalProperties !== true) {
const propertyValidationResult = new ValidationResult();
validate(child, additionalProperties, propertyValidationResult, matchingSchemas);
validate(child, additionalProperties, propertyValidationResult, matchingSchemas, context);
validationResult.mergePropertyMatch(propertyValidationResult);
}
}
}
}
const unevaluatedProperties = schema.unevaluatedProperties;
if (unevaluatedProperties !== undefined && unevaluatedProperties !== true) {
if (unevaluatedProperties !== undefined) {
const processed = [];
for (const propertyName of unprocessedProperties) {
if (!validationResult.processedProperties.has(propertyName)) {
@ -972,9 +996,9 @@ function validate(n: ASTNode | undefined, schema: JSONSchema, validationResult:
location: { offset: propertyNode.keyNode.offset, length: propertyNode.keyNode.length },
message: schema.errorMessage || localize('DisallowedExtraPropWarning', 'Property {0} is not allowed.', propertyName)
});
} else {
} else if (unevaluatedProperties !== true) {
const propertyValidationResult = new ValidationResult();
validate(child, unevaluatedProperties, propertyValidationResult, matchingSchemas);
validate(child, unevaluatedProperties, propertyValidationResult, matchingSchemas, context);
validationResult.mergePropertyMatch(propertyValidationResult);
}
}
@ -1034,7 +1058,7 @@ function validate(n: ASTNode | undefined, schema: JSONSchema, validationResult:
for (const f of node.properties) {
const key = f.keyNode;
if (key) {
validate(key, propertyNames, validationResult, NoOpSchemaCollector.instance);
validate(key, propertyNames, validationResult, NoOpSchemaCollector.instance, context);
}
}
}
@ -1055,7 +1079,7 @@ function validate(n: ASTNode | undefined, schema: JSONSchema, validationResult:
const propertySchema = asSchema(propertyDep);
if (propertySchema) {
const propertyValidationResult = new ValidationResult();
validate(node, propertySchema, propertyValidationResult, matchingSchemas);
validate(node, propertySchema, propertyValidationResult, matchingSchemas, context);
validationResult.mergePropertyMatch(propertyValidationResult);
}
}

Просмотреть файл

@ -455,7 +455,7 @@ export class JSONSchemaService implements IJSONSchemaService {
const merge = (target: JSONSchema, section: any): void => {
for (const key in section) {
if (section.hasOwnProperty(key) && !target.hasOwnProperty(key) && key !== 'id' && key !== '$id') {
if (section.hasOwnProperty(key) && key !== 'id' && key !== '$id') {
(<any>target)[key] = section[key];
}
}

Просмотреть файл

@ -75,9 +75,9 @@ export class JSONValidation {
for (const warning of schema.warnings) {
addSchemaProblem(warning, ErrorCode.SchemaUnsupportedFeature);
}
const semanticErrors = jsonDocument.validate(textDocument, schema.schema, schemaValidation);
const semanticErrors = jsonDocument.validate(textDocument, schema.schema, schemaValidation, documentSettings?.schemaDraft);
if (semanticErrors) {
semanticErrors.forEach(addProblem);
semanticErrors.forEach(addProblem);
}
}
if (schemaAllowsComments(schema.schema)) {

Просмотреть файл

@ -8,380 +8,354 @@ import * as Parser from '../parser/jsonParser';
import * as fs from 'fs';
import * as url from 'url';
import * as path from 'path';
import { getLanguageService, TextDocument } from '../jsonLanguageService';
import { getLanguageService, SchemaDraft, TextDocument } from '../jsonLanguageService';
import { URI } from 'vscode-uri';
const testsPath = path.join(__dirname, "../../../node_modules/json-schema-test-suite/tests");
const drafts = [
'draft4', 'draft6', 'draft7', 'draft2019-09', 'draft2020-12'
'draft4', 'draft6', 'draft7', 'draft2019-09', 'draft2020-12'
];
export const schemaIds: { [id: string]: SchemaDraft } = {
'draft4': SchemaDraft.v4,
'draft6': SchemaDraft.v6,
'draft7': SchemaDraft.v7,
'draft2019-09': SchemaDraft.v2019_09,
'draft2020-12': SchemaDraft.v2020_12
};
const workspaceContext = {
resolveRelativePath: (relativePath: string, resource: string) => {
return url.resolve(resource, relativePath);
}
resolveRelativePath: (relativePath: string, resource: string) => {
return url.resolve(resource, relativePath);
}
};
const ls = getLanguageService({ workspaceContext });
async function assertSchemaValidation(input: any, schema: any, valid: boolean, description: string, fileName: string) {
const textDoc = TextDocument.create('foo://bar/file.json', 'json', 0, JSON.stringify(input));
const jsonDoc = Parser.parse(textDoc);
const schemaClone = JSON.parse(JSON.stringify(schema));
async function assertSchemaValidation(input: any, schema: any, valid: boolean, description: string, draft: string, fileName: string) {
const textDoc = TextDocument.create('foo://bar/file.json', 'json', 0, JSON.stringify(input));
const jsonDoc = Parser.parse(textDoc);
const schemaClone = JSON.parse(JSON.stringify(schema));
assert.strictEqual(jsonDoc.syntaxErrors.length, 0);
const semanticErrors = await ls.doValidation(textDoc, jsonDoc, {}, schemaClone);
if (valid && semanticErrors.length > 0) {
assert.deepStrictEqual([], semanticErrors, `\n${fileName}\n${description}: No error expected: ${JSON.stringify(input)} against ${JSON.stringify(schema)}`);
} else if (!valid && semanticErrors.length === 0) {
assert.fail(`\n${fileName}\n${description}: Expected error: ${JSON.stringify(input)} against ${JSON.stringify(schema)}`);
}
assert.strictEqual(jsonDoc.syntaxErrors.length, 0);
const semanticErrors = await ls.doValidation(textDoc, jsonDoc, { schemaDraft: schemaIds[draft] }, schemaClone);
if (valid && semanticErrors.length > 0) {
assert.deepStrictEqual([], semanticErrors, `\n${fileName}\n${description}: No error expected: ${JSON.stringify(input)} against ${JSON.stringify(schema)}`);
} else if (!valid && semanticErrors.length === 0) {
assert.fail(`\n${fileName}\n${description}: Expected error: ${JSON.stringify(input)} against ${JSON.stringify(schema)}`);
}
}
const collectFailedTests = false;
const failedTests: string[] = [];
function initializeTests() {
suite(`JSON Schema Test Suite`, () => {
for (const draft of drafts) {
const folderPath = path.resolve(testsPath, draft);
const entries = fs.readdirSync(folderPath, { withFileTypes: true });
for (const entry of entries) {
if (entry.isFile() && entry.name.endsWith('json')) {
const filePath = path.join(folderPath, entry.name);
try {
const testFileContent = JSON.parse((fs.readFileSync(filePath)).toString());
if (Array.isArray(testFileContent)) {
for (const testGroupEntry of testFileContent) {
suite(`${draft} - ${testGroupEntry.description}`, () => {
for (const testEntry of testGroupEntry.tests) {
const id = `${draft}/${entry.name}/${testEntry.description}`;
if (!collectFailedTests && skippedTests.has(id)) {
test.skip(testEntry.description, () => { });
} else {
test(testEntry.description, async () => {
try {
await assertSchemaValidation(testEntry.data, testGroupEntry.schema, testEntry.valid, testEntry.description, URI.file(filePath).toString());
} catch (e) {
if (collectFailedTests) {
failedTests.push(id);
} else {
throw e;
}
}
});
}
}
});
}
}
} catch (e) {
console.log(e);
assert.fail(`Problem parsing ${filePath}`);
suite(`JSON Schema Test Suite`, () => {
for (const draft of drafts) {
const folderPath = path.resolve(testsPath, draft);
const entries = fs.readdirSync(folderPath, { withFileTypes: true });
for (const entry of entries) {
if (entry.isFile() && entry.name.endsWith('json')) {
const filePath = path.join(folderPath, entry.name);
try {
const testFileContent = JSON.parse((fs.readFileSync(filePath)).toString());
if (Array.isArray(testFileContent)) {
for (const testGroupEntry of testFileContent) {
suite(`${draft} - ${testGroupEntry.description}`, () => {
for (const testEntry of testGroupEntry.tests) {
const id = `${draft}/${entry.name}/${testGroupEntry.description}/${testEntry.description}`;
const fn = async () => {
try {
await assertSchemaValidation(testEntry.data, testGroupEntry.schema, testEntry.valid, testEntry.description, draft, URI.file(filePath).toString());
} catch (e) {
if (collectFailedTests) {
failedTests.push(id);
} else {
throw e;
}
}
};
if (!collectFailedTests && skippedTests.has(id)) {
test.skip(testEntry.description, fn);
} else if (!collectFailedTests && skippedTests.has('_' + id)) {
test.only(testEntry.description, fn);
} else {
test(testEntry.description, fn);
}
}
});
}
}
} catch (e) {
console.log(e);
assert.fail(`Problem parsing ${filePath}`);
}
}
}
suiteTeardown(() => {
if (collectFailedTests) {
console.log(failedTests.map(t => JSON.stringify(t)).join(',\n'));
}
});
}
}
}
}
suiteTeardown(() => {
if (collectFailedTests) {
fs.writeFileSync('failedTests.txt', failedTests.map(t => JSON.stringify(t)).join(',\n'));
}
});
}
});
});
}
const skippedTests = new Set([
"draft4/id.json/exact match to enum, and type matches",
"draft4/id.json/match $ref to id",
"draft4/patternProperties.json/an invalid due to the other is invalid",
"draft4/properties.json/patternProperty invalidates property",
"draft4/ref.json/ref valid, maxItems ignored",
"draft4/ref.json/$ref resolves to /definitions/base_foo, data validates",
"draft4/ref.json/valid tree",
"draft4/ref.json/match",
"draft4/ref.json/number should pass",
"draft4/refRemote.json/remote ref valid",
"draft4/refRemote.json/remote fragment valid",
"draft4/refRemote.json/ref within ref valid",
"draft4/refRemote.json/base URI change ref valid",
"draft4/refRemote.json/number is valid",
"draft4/refRemote.json/number is valid",
"draft4/refRemote.json/string is valid",
"draft4/refRemote.json/null is valid",
"draft4/refRemote.json/integer is valid",
"draft4/uniqueItems.json/non-unique array of objects is invalid",
"draft4/uniqueItems.json/non-unique array of nested objects is invalid",
"draft4/uniqueItems.json/non-unique array of arrays is invalid",
"draft4/uniqueItems.json/non-unique array of more than two arrays is invalid",
"draft4/uniqueItems.json/non-unique heterogeneous types are invalid",
"draft4/uniqueItems.json/objects are non-unique despite key order",
"draft6/boolean_schema.json/number is invalid",
"draft6/boolean_schema.json/string is invalid",
"draft6/boolean_schema.json/boolean true is invalid",
"draft6/boolean_schema.json/boolean false is invalid",
"draft6/boolean_schema.json/null is invalid",
"draft6/boolean_schema.json/object is invalid",
"draft6/boolean_schema.json/empty object is invalid",
"draft6/boolean_schema.json/array is invalid",
"draft6/boolean_schema.json/empty array is invalid",
"draft6/definitions.json/valid definition schema",
"draft6/id.json/exact match to enum, and type matches",
"draft6/id.json/match $ref to id",
"draft6/patternProperties.json/an invalid due to the other is invalid",
"draft6/patternProperties.json/object with a property matching both true and false is invalid",
"draft6/properties.json/patternProperty invalidates property",
"draft6/ref.json/ref valid, maxItems ignored",
"draft6/ref.json/$ref resolves to /definitions/base_foo, data validates",
"draft6/ref.json/remote ref valid",
"draft6/ref.json/valid tree",
"draft6/ref.json/match",
"draft6/ref.json/valid on both fields",
"draft6/ref.json/valid on both fields",
"draft6/refRemote.json/remote ref valid",
"draft6/refRemote.json/remote fragment valid",
"draft6/refRemote.json/ref within ref valid",
"draft6/refRemote.json/base URI change ref valid",
"draft6/refRemote.json/number is valid",
"draft6/refRemote.json/number is valid",
"draft6/refRemote.json/string is valid",
"draft6/refRemote.json/null is valid",
"draft6/refRemote.json/valid",
"draft6/refRemote.json/integer is valid",
"draft6/uniqueItems.json/non-unique array of objects is invalid",
"draft6/uniqueItems.json/non-unique array of nested objects is invalid",
"draft6/uniqueItems.json/non-unique array of arrays is invalid",
"draft6/uniqueItems.json/non-unique array of more than two arrays is invalid",
"draft6/uniqueItems.json/non-unique heterogeneous types are invalid",
"draft6/uniqueItems.json/objects are non-unique despite key order",
"draft6/unknownKeyword.json/type matches second anyOf, which has a real schema in it",
"draft7/boolean_schema.json/number is invalid",
"draft7/boolean_schema.json/string is invalid",
"draft7/boolean_schema.json/boolean true is invalid",
"draft7/boolean_schema.json/boolean false is invalid",
"draft7/boolean_schema.json/null is invalid",
"draft7/boolean_schema.json/object is invalid",
"draft7/boolean_schema.json/empty object is invalid",
"draft7/boolean_schema.json/array is invalid",
"draft7/boolean_schema.json/empty array is invalid",
"draft7/id.json/exact match to enum, and type matches",
"draft7/id.json/match $ref to id",
"draft7/patternProperties.json/an invalid due to the other is invalid",
"draft7/patternProperties.json/object with a property matching both true and false is invalid",
"draft7/properties.json/patternProperty invalidates property",
"draft7/ref.json/ref valid, maxItems ignored",
"draft7/ref.json/$ref resolves to /definitions/base_foo, data validates",
"draft7/ref.json/valid tree",
"draft7/ref.json/match",
"draft7/ref.json/valid on both fields",
"draft7/ref.json/valid on both fields",
"draft7/ref.json/number should pass",
"draft7/refRemote.json/remote ref valid",
"draft7/refRemote.json/remote fragment valid",
"draft7/refRemote.json/ref within ref valid",
"draft7/refRemote.json/base URI change ref valid",
"draft7/refRemote.json/number is valid",
"draft7/refRemote.json/number is valid",
"draft7/refRemote.json/string is valid",
"draft7/refRemote.json/null is valid",
"draft7/refRemote.json/valid",
"draft7/refRemote.json/integer is valid",
"draft7/uniqueItems.json/non-unique array of objects is invalid",
"draft7/uniqueItems.json/non-unique array of nested objects is invalid",
"draft7/uniqueItems.json/non-unique array of arrays is invalid",
"draft7/uniqueItems.json/non-unique array of more than two arrays is invalid",
"draft7/uniqueItems.json/non-unique heterogeneous types are invalid",
"draft7/uniqueItems.json/objects are non-unique despite key order",
"draft7/unknownKeyword.json/type matches second anyOf, which has a real schema in it",
"draft2019-09/anchor.json/match",
"draft2019-09/anchor.json/match",
"draft2019-09/anchor.json/$ref should resolve to /$defs/A/allOf/1",
"draft2019-09/boolean_schema.json/number is invalid",
"draft2019-09/boolean_schema.json/string is invalid",
"draft2019-09/boolean_schema.json/boolean true is invalid",
"draft2019-09/boolean_schema.json/boolean false is invalid",
"draft2019-09/boolean_schema.json/null is invalid",
"draft2019-09/boolean_schema.json/object is invalid",
"draft2019-09/boolean_schema.json/empty object is invalid",
"draft2019-09/boolean_schema.json/array is invalid",
"draft2019-09/boolean_schema.json/empty array is invalid",
"draft2019-09/defs.json/valid definition schema",
"draft2019-09/dependentSchemas.json/object with property having schema false is invalid",
"draft2019-09/dependentSchemas.json/object with both properties is invalid",
"draft2019-09/id.json/Identifier name with absolute URI",
"draft2019-09/id.json/Identifier name with base URI change in subschema",
"draft2019-09/id.json/Unnormalized identifier",
"draft2019-09/id.json/Unnormalized identifier and no ref",
"draft2019-09/id.json/Unnormalized identifier with empty fragment",
"draft2019-09/id.json/Unnormalized identifier with empty fragment and no ref",
"draft2019-09/id.json/exact match to enum, and type matches",
"draft2019-09/id.json/match $ref to $id",
"draft2019-09/patternProperties.json/an invalid due to the other is invalid",
"draft2019-09/patternProperties.json/object with a property matching both true and false is invalid",
"draft2019-09/properties.json/patternProperty invalidates property",
"draft2019-09/recursiveRef.json/match",
"draft2019-09/recursiveRef.json/recursive match",
"draft2019-09/recursiveRef.json/integer matches at the outer level",
"draft2019-09/recursiveRef.json/single level match",
"draft2019-09/recursiveRef.json/two levels, properties match with inner definition",
"draft2019-09/recursiveRef.json/integer matches at the outer level",
"draft2019-09/recursiveRef.json/single level match",
"draft2019-09/recursiveRef.json/integer now matches as a property value",
"draft2019-09/recursiveRef.json/two levels, properties match with inner definition",
"draft2019-09/recursiveRef.json/two levels, properties match with $recursiveRef",
"draft2019-09/recursiveRef.json/integer matches at the outer level",
"draft2019-09/recursiveRef.json/single level match",
"draft2019-09/recursiveRef.json/two levels, properties match with inner definition",
"draft2019-09/recursiveRef.json/integer matches at the outer level",
"draft2019-09/recursiveRef.json/single level match",
"draft2019-09/recursiveRef.json/two levels, properties match with inner definition",
"draft2019-09/recursiveRef.json/leaf node matches: recursion uses the inner schema",
"draft2019-09/recursiveRef.json/leaf node matches: recursion only uses inner schema",
"draft2019-09/recursiveRef.json/recurse to anyLeafNode - floats are allowed",
"draft2019-09/recursiveRef.json/numeric node",
"draft2019-09/ref.json/remote ref valid",
"draft2019-09/ref.json/valid tree",
"draft2019-09/ref.json/referenced subschema doesn't see annotations from properties",
"draft2019-09/ref.json/valid on both fields",
"draft2019-09/ref.json/valid on both fields",
"draft2019-09/ref.json/number should pass",
"draft2019-09/ref.json/data is valid against first definition",
"draft2019-09/ref.json/data is valid against first definition",
"draft2019-09/refRemote.json/remote ref valid",
"draft2019-09/refRemote.json/remote fragment valid",
"draft2019-09/refRemote.json/ref within ref valid",
"draft2019-09/refRemote.json/base URI change ref valid",
"draft2019-09/refRemote.json/number is valid",
"draft2019-09/refRemote.json/number is valid",
"draft2019-09/refRemote.json/string is valid",
"draft2019-09/refRemote.json/null is valid",
"draft2019-09/refRemote.json/valid",
"draft2019-09/refRemote.json/integer is valid",
"draft2019-09/unevaluatedItems.json/with unevaluated items",
"draft2019-09/unevaluatedItems.json/with valid unevaluated items",
"draft2019-09/unevaluatedItems.json/with invalid unevaluated items",
"draft2019-09/unevaluatedItems.json/with only (valid) additional items",
"draft2019-09/unevaluatedItems.json/with invalid additional item",
"draft2019-09/unevaluatedItems.json/with additional items",
"draft2019-09/unevaluatedItems.json/with no unevaluated items",
"draft2019-09/unevaluatedItems.json/always fails",
"draft2019-09/unevaluatedItems.json/null items allowed",
"draft2019-09/unevaluatedProperties.json/with additional properties",
"draft2019-09/unevaluatedProperties.json/with additional properties",
"draft2019-09/unevaluatedProperties.json/with nested unevaluated properties",
"draft2019-09/unevaluatedProperties.json/when if is false and has unevaluated properties",
"draft2019-09/unevaluatedProperties.json/when if is false and has unevaluated properties",
"draft2019-09/unevaluatedProperties.json/with no unevaluated properties",
"draft2019-09/unevaluatedProperties.json/with no unevaluated properties",
"draft2019-09/unevaluatedProperties.json/always fails",
"draft2019-09/unevaluatedProperties.json/with nested unevaluated properties",
"draft2019-09/unevaluatedProperties.json/with nested unevaluated properties",
"draft2019-09/unevaluatedProperties.json/with no nested unevaluated properties",
"draft2019-09/unevaluatedProperties.json/all is valid",
"draft2019-09/unevaluatedProperties.json/all + foo is valid",
"draft2019-09/uniqueItems.json/non-unique array of objects is invalid",
"draft2019-09/uniqueItems.json/non-unique array of nested objects is invalid",
"draft2019-09/uniqueItems.json/non-unique array of arrays is invalid",
"draft2019-09/uniqueItems.json/non-unique array of more than two arrays is invalid",
"draft2019-09/uniqueItems.json/non-unique heterogeneous types are invalid",
"draft2019-09/uniqueItems.json/objects are non-unique despite key order",
"draft2019-09/unknownKeyword.json/type matches second anyOf, which has a real schema in it",
"draft2019-09/vocabulary.json/no validation: invalid number, but it still validates",
"draft2020-12/anchor.json/match",
"draft2020-12/anchor.json/match",
"draft2020-12/anchor.json/$ref should resolve to /$defs/A/allOf/1",
"draft2020-12/boolean_schema.json/number is invalid",
"draft2020-12/boolean_schema.json/string is invalid",
"draft2020-12/boolean_schema.json/boolean true is invalid",
"draft2020-12/boolean_schema.json/boolean false is invalid",
"draft2020-12/boolean_schema.json/null is invalid",
"draft2020-12/boolean_schema.json/object is invalid",
"draft2020-12/boolean_schema.json/empty object is invalid",
"draft2020-12/boolean_schema.json/array is invalid",
"draft2020-12/boolean_schema.json/empty array is invalid",
"draft2020-12/defs.json/valid definition schema",
"draft2020-12/dependentSchemas.json/object with property having schema false is invalid",
"draft2020-12/dependentSchemas.json/object with both properties is invalid",
"draft2020-12/dynamicRef.json/An array of strings is valid",
"draft2020-12/dynamicRef.json/An array of strings is valid",
"draft2020-12/dynamicRef.json/An array of strings is valid",
"draft2020-12/dynamicRef.json/An array of strings is valid",
"draft2020-12/dynamicRef.json/An array of strings is valid",
"draft2020-12/dynamicRef.json/Any array is valid",
"draft2020-12/dynamicRef.json/Any array is valid",
"draft2020-12/dynamicRef.json/Any array is valid",
"draft2020-12/dynamicRef.json/The recursive part is valid against the root",
"draft2020-12/dynamicRef.json/The recursive part doesn't need to validate against the root",
"draft2020-12/dynamicRef.json/recurse to anyLeafNode - floats are allowed",
"draft2020-12/dynamicRef.json//then/$defs/thingy is the final stop for the $dynamicRef",
"draft2020-12/dynamicRef.json/instance with correct field",
"draft2020-12/dynamicRef.json/correct extended schema",
"draft2020-12/dynamicRef.json/correct extended schema",
"draft2020-12/dynamicRef.json/correct extended schema",
"draft2020-12/id.json/Identifier name with absolute URI",
"draft2020-12/id.json/Identifier name with base URI change in subschema",
"draft2020-12/id.json/Unnormalized identifier",
"draft2020-12/id.json/Unnormalized identifier and no ref",
"draft2020-12/id.json/Unnormalized identifier with empty fragment",
"draft2020-12/id.json/Unnormalized identifier with empty fragment and no ref",
"draft2020-12/id.json/exact match to enum, and type matches",
"draft2020-12/id.json/match $ref to $id",
"draft2020-12/patternProperties.json/an invalid due to the other is invalid",
"draft2020-12/patternProperties.json/object with a property matching both true and false is invalid",
"draft2020-12/properties.json/patternProperty invalidates property",
"draft2020-12/ref.json/remote ref valid",
"draft2020-12/ref.json/valid tree",
"draft2020-12/ref.json/referenced subschema doesn't see annotations from properties",
"draft2020-12/ref.json/valid on both fields",
"draft2020-12/ref.json/valid on both fields",
"draft2020-12/ref.json/number should pass",
"draft2020-12/ref.json/data is valid against first definition",
"draft2020-12/ref.json/data is valid against first definition",
"draft2020-12/refRemote.json/remote ref valid",
"draft2020-12/refRemote.json/remote fragment valid",
"draft2020-12/refRemote.json/ref within ref valid",
"draft2020-12/refRemote.json/base URI change ref valid",
"draft2020-12/refRemote.json/number is valid",
"draft2020-12/refRemote.json/number is valid",
"draft2020-12/refRemote.json/string is valid",
"draft2020-12/refRemote.json/null is valid",
"draft2020-12/refRemote.json/valid",
"draft2020-12/refRemote.json/integer is valid",
"draft2020-12/unevaluatedItems.json/with unevaluated items",
"draft2020-12/unevaluatedItems.json/with valid unevaluated items",
"draft2020-12/unevaluatedItems.json/with invalid unevaluated items",
"draft2020-12/unevaluatedItems.json/with only (valid) additional items",
"draft2020-12/unevaluatedItems.json/with invalid additional item",
"draft2020-12/unevaluatedItems.json/with additional items",
"draft2020-12/unevaluatedItems.json/with no unevaluated items",
"draft2020-12/unevaluatedItems.json/always fails",
"draft2020-12/unevaluatedItems.json/5 not evaluated, passes unevaluatedItems",
"draft2020-12/unevaluatedItems.json/7 not evaluated, fails unevaluatedItems",
"draft2020-12/unevaluatedItems.json/only a's are valid",
"draft2020-12/unevaluatedItems.json/a's and b's are valid",
"draft2020-12/unevaluatedItems.json/a's, b's and c's are valid",
"draft2020-12/unevaluatedItems.json/null items allowed",
"draft2020-12/unevaluatedProperties.json/with additional properties",
"draft2020-12/unevaluatedProperties.json/with additional properties",
"draft2020-12/unevaluatedProperties.json/with nested unevaluated properties",
"draft2020-12/unevaluatedProperties.json/when if is false and has unevaluated properties",
"draft2020-12/unevaluatedProperties.json/when if is false and has unevaluated properties",
"draft2020-12/unevaluatedProperties.json/with no unevaluated properties",
"draft2020-12/unevaluatedProperties.json/with no unevaluated properties",
"draft2020-12/unevaluatedProperties.json/always fails",
"draft2020-12/unevaluatedProperties.json/with nested unevaluated properties",
"draft2020-12/unevaluatedProperties.json/with nested unevaluated properties",
"draft2020-12/unevaluatedProperties.json/with no nested unevaluated properties",
"draft2020-12/unevaluatedProperties.json/all is valid",
"draft2020-12/unevaluatedProperties.json/all + foo is valid",
"draft2020-12/uniqueItems.json/non-unique array of objects is invalid",
"draft2020-12/uniqueItems.json/non-unique array of nested objects is invalid",
"draft2020-12/uniqueItems.json/non-unique array of arrays is invalid",
"draft2020-12/uniqueItems.json/non-unique array of more than two arrays is invalid",
"draft2020-12/uniqueItems.json/non-unique heterogeneous types are invalid",
"draft2020-12/uniqueItems.json/objects are non-unique despite key order",
"draft2020-12/unknownKeyword.json/type matches second anyOf, which has a real schema in it",
"draft2020-12/vocabulary.json/no validation: invalid number, but it still validates"
"draft4/id.json/id inside an enum is not a real identifier/exact match to enum, and type matches",
"draft4/id.json/id inside an enum is not a real identifier/match $ref to id",
"draft4/patternProperties.json/multiple simultaneous patternProperties are validated/an invalid due to the other is invalid",
"draft4/properties.json/properties, patternProperties, additionalProperties interaction/patternProperty invalidates property",
"draft4/ref.json/ref overrides any sibling keywords/ref valid, maxItems ignored",
"draft4/ref.json/$ref prevents a sibling id from changing the base uri/$ref resolves to /definitions/base_foo, data validates",
"draft4/ref.json/Recursive references between schemas/valid tree",
"draft4/ref.json/Location-independent identifier with base URI change in subschema/match",
"draft4/ref.json/id must be resolved against nearest parent, not just immediate parent/number should pass",
"draft4/refRemote.json/remote ref/remote ref valid",
"draft4/refRemote.json/fragment within remote ref/remote fragment valid",
"draft4/refRemote.json/ref within remote ref/ref within ref valid",
"draft4/refRemote.json/base URI change/base URI change ref valid",
"draft4/refRemote.json/base URI change - change folder/number is valid",
"draft4/refRemote.json/base URI change - change folder in subschema/number is valid",
"draft4/refRemote.json/root ref in remote ref/string is valid",
"draft4/refRemote.json/root ref in remote ref/null is valid",
"draft4/refRemote.json/Location-independent identifier in remote ref/integer is valid",
"draft4/uniqueItems.json/uniqueItems validation/non-unique array of objects is invalid",
"draft4/uniqueItems.json/uniqueItems validation/non-unique array of nested objects is invalid",
"draft4/uniqueItems.json/uniqueItems validation/non-unique array of arrays is invalid",
"draft4/uniqueItems.json/uniqueItems validation/non-unique array of more than two arrays is invalid",
"draft4/uniqueItems.json/uniqueItems validation/non-unique heterogeneous types are invalid",
"draft4/uniqueItems.json/uniqueItems validation/objects are non-unique despite key order",
"draft6/boolean_schema.json/boolean schema 'false'/number is invalid",
"draft6/boolean_schema.json/boolean schema 'false'/string is invalid",
"draft6/boolean_schema.json/boolean schema 'false'/boolean true is invalid",
"draft6/boolean_schema.json/boolean schema 'false'/boolean false is invalid",
"draft6/boolean_schema.json/boolean schema 'false'/null is invalid",
"draft6/boolean_schema.json/boolean schema 'false'/object is invalid",
"draft6/boolean_schema.json/boolean schema 'false'/empty object is invalid",
"draft6/boolean_schema.json/boolean schema 'false'/array is invalid",
"draft6/boolean_schema.json/boolean schema 'false'/empty array is invalid",
"draft6/definitions.json/validate definition against metaschema/valid definition schema",
"draft6/id.json/id inside an enum is not a real identifier/exact match to enum, and type matches",
"draft6/id.json/id inside an enum is not a real identifier/match $ref to id",
"draft6/patternProperties.json/multiple simultaneous patternProperties are validated/an invalid due to the other is invalid",
"draft6/patternProperties.json/patternProperties with boolean schemas/object with a property matching both true and false is invalid",
"draft6/properties.json/properties, patternProperties, additionalProperties interaction/patternProperty invalidates property",
"draft6/ref.json/ref overrides any sibling keywords/ref valid, maxItems ignored",
"draft6/ref.json/$ref prevents a sibling $id from changing the base uri/$ref resolves to /definitions/base_foo, data validates",
"draft6/ref.json/remote ref, containing refs itself/remote ref valid",
"draft6/ref.json/Recursive references between schemas/valid tree",
"draft6/ref.json/Location-independent identifier with base URI change in subschema/match",
"draft6/ref.json/refs with relative uris and defs/valid on both fields",
"draft6/ref.json/relative refs with absolute uris and defs/valid on both fields",
"draft6/refRemote.json/remote ref/remote ref valid",
"draft6/refRemote.json/fragment within remote ref/remote fragment valid",
"draft6/refRemote.json/ref within remote ref/ref within ref valid",
"draft6/refRemote.json/base URI change/base URI change ref valid",
"draft6/refRemote.json/base URI change - change folder/number is valid",
"draft6/refRemote.json/base URI change - change folder in subschema/number is valid",
"draft6/refRemote.json/root ref in remote ref/string is valid",
"draft6/refRemote.json/root ref in remote ref/null is valid",
"draft6/refRemote.json/remote ref with ref to definitions/valid",
"draft6/refRemote.json/Location-independent identifier in remote ref/integer is valid",
"draft6/uniqueItems.json/uniqueItems validation/non-unique array of objects is invalid",
"draft6/uniqueItems.json/uniqueItems validation/non-unique array of nested objects is invalid",
"draft6/uniqueItems.json/uniqueItems validation/non-unique array of arrays is invalid",
"draft6/uniqueItems.json/uniqueItems validation/non-unique array of more than two arrays is invalid",
"draft6/uniqueItems.json/uniqueItems validation/non-unique heterogeneous types are invalid",
"draft6/uniqueItems.json/uniqueItems validation/objects are non-unique despite key order",
"draft6/unknownKeyword.json/$id inside an unknown keyword is not a real identifier/type matches second anyOf, which has a real schema in it",
"draft7/boolean_schema.json/boolean schema 'false'/number is invalid",
"draft7/boolean_schema.json/boolean schema 'false'/string is invalid",
"draft7/boolean_schema.json/boolean schema 'false'/boolean true is invalid",
"draft7/boolean_schema.json/boolean schema 'false'/boolean false is invalid",
"draft7/boolean_schema.json/boolean schema 'false'/null is invalid",
"draft7/boolean_schema.json/boolean schema 'false'/object is invalid",
"draft7/boolean_schema.json/boolean schema 'false'/empty object is invalid",
"draft7/boolean_schema.json/boolean schema 'false'/array is invalid",
"draft7/boolean_schema.json/boolean schema 'false'/empty array is invalid",
"draft7/id.json/id inside an enum is not a real identifier/exact match to enum, and type matches",
"draft7/id.json/id inside an enum is not a real identifier/match $ref to id",
"draft7/patternProperties.json/multiple simultaneous patternProperties are validated/an invalid due to the other is invalid",
"draft7/patternProperties.json/patternProperties with boolean schemas/object with a property matching both true and false is invalid",
"draft7/properties.json/properties, patternProperties, additionalProperties interaction/patternProperty invalidates property",
"draft7/ref.json/ref overrides any sibling keywords/ref valid, maxItems ignored",
"draft7/ref.json/$ref prevents a sibling $id from changing the base uri/$ref resolves to /definitions/base_foo, data validates",
"draft7/ref.json/Recursive references between schemas/valid tree",
"draft7/ref.json/Location-independent identifier with base URI change in subschema/match",
"draft7/ref.json/refs with relative uris and defs/valid on both fields",
"draft7/ref.json/relative refs with absolute uris and defs/valid on both fields",
"draft7/ref.json/$id must be resolved against nearest parent, not just immediate parent/number should pass",
"draft7/refRemote.json/remote ref/remote ref valid",
"draft7/refRemote.json/fragment within remote ref/remote fragment valid",
"draft7/refRemote.json/ref within remote ref/ref within ref valid",
"draft7/refRemote.json/base URI change/base URI change ref valid",
"draft7/refRemote.json/base URI change - change folder/number is valid",
"draft7/refRemote.json/base URI change - change folder in subschema/number is valid",
"draft7/refRemote.json/root ref in remote ref/string is valid",
"draft7/refRemote.json/root ref in remote ref/null is valid",
"draft7/refRemote.json/remote ref with ref to definitions/valid",
"draft7/refRemote.json/Location-independent identifier in remote ref/integer is valid",
"draft7/uniqueItems.json/uniqueItems validation/non-unique array of objects is invalid",
"draft7/uniqueItems.json/uniqueItems validation/non-unique array of nested objects is invalid",
"draft7/uniqueItems.json/uniqueItems validation/non-unique array of arrays is invalid",
"draft7/uniqueItems.json/uniqueItems validation/non-unique array of more than two arrays is invalid",
"draft7/uniqueItems.json/uniqueItems validation/non-unique heterogeneous types are invalid",
"draft7/uniqueItems.json/uniqueItems validation/objects are non-unique despite key order",
"draft7/unknownKeyword.json/$id inside an unknown keyword is not a real identifier/type matches second anyOf, which has a real schema in it",
"draft2019-09/anchor.json/Location-independent identifier with absolute URI/match",
"draft2019-09/anchor.json/Location-independent identifier with base URI change in subschema/match",
"draft2019-09/anchor.json/same $anchor with different base uri/$ref should resolve to /$defs/A/allOf/1",
"draft2019-09/boolean_schema.json/boolean schema 'false'/number is invalid",
"draft2019-09/boolean_schema.json/boolean schema 'false'/string is invalid",
"draft2019-09/boolean_schema.json/boolean schema 'false'/boolean true is invalid",
"draft2019-09/boolean_schema.json/boolean schema 'false'/boolean false is invalid",
"draft2019-09/boolean_schema.json/boolean schema 'false'/null is invalid",
"draft2019-09/boolean_schema.json/boolean schema 'false'/object is invalid",
"draft2019-09/boolean_schema.json/boolean schema 'false'/empty object is invalid",
"draft2019-09/boolean_schema.json/boolean schema 'false'/array is invalid",
"draft2019-09/boolean_schema.json/boolean schema 'false'/empty array is invalid",
"draft2019-09/defs.json/validate definition against metaschema/valid definition schema",
"draft2019-09/dependentSchemas.json/boolean subschemas/object with property having schema false is invalid",
"draft2019-09/dependentSchemas.json/boolean subschemas/object with both properties is invalid",
"draft2019-09/id.json/Valid use of empty fragments in location-independent $id/Identifier name with absolute URI",
"draft2019-09/id.json/Valid use of empty fragments in location-independent $id/Identifier name with base URI change in subschema",
"draft2019-09/id.json/Unnormalized $ids are allowed but discouraged/Unnormalized identifier",
"draft2019-09/id.json/Unnormalized $ids are allowed but discouraged/Unnormalized identifier and no ref",
"draft2019-09/id.json/Unnormalized $ids are allowed but discouraged/Unnormalized identifier with empty fragment",
"draft2019-09/id.json/Unnormalized $ids are allowed but discouraged/Unnormalized identifier with empty fragment and no ref",
"draft2019-09/id.json/$id inside an enum is not a real identifier/exact match to enum, and type matches",
"draft2019-09/id.json/$id inside an enum is not a real identifier/match $ref to $id",
"draft2019-09/patternProperties.json/multiple simultaneous patternProperties are validated/an invalid due to the other is invalid",
"draft2019-09/patternProperties.json/patternProperties with boolean schemas/object with a property matching both true and false is invalid",
"draft2019-09/properties.json/properties, patternProperties, additionalProperties interaction/patternProperty invalidates property",
"draft2019-09/recursiveRef.json/$recursiveRef without $recursiveAnchor works like $ref/match",
"draft2019-09/recursiveRef.json/$recursiveRef without $recursiveAnchor works like $ref/recursive match",
"draft2019-09/recursiveRef.json/$recursiveRef without using nesting/integer matches at the outer level",
"draft2019-09/recursiveRef.json/$recursiveRef without using nesting/single level match",
"draft2019-09/recursiveRef.json/$recursiveRef without using nesting/two levels, properties match with inner definition",
"draft2019-09/recursiveRef.json/$recursiveRef with nesting/integer matches at the outer level",
"draft2019-09/recursiveRef.json/$recursiveRef with nesting/single level match",
"draft2019-09/recursiveRef.json/$recursiveRef with nesting/integer now matches as a property value",
"draft2019-09/recursiveRef.json/$recursiveRef with nesting/two levels, properties match with inner definition",
"draft2019-09/recursiveRef.json/$recursiveRef with nesting/two levels, properties match with $recursiveRef",
"draft2019-09/recursiveRef.json/$recursiveRef with $recursiveAnchor: false works like $ref/integer matches at the outer level",
"draft2019-09/recursiveRef.json/$recursiveRef with $recursiveAnchor: false works like $ref/single level match",
"draft2019-09/recursiveRef.json/$recursiveRef with $recursiveAnchor: false works like $ref/two levels, properties match with inner definition",
"draft2019-09/recursiveRef.json/$recursiveRef with no $recursiveAnchor works like $ref/integer matches at the outer level",
"draft2019-09/recursiveRef.json/$recursiveRef with no $recursiveAnchor works like $ref/single level match",
"draft2019-09/recursiveRef.json/$recursiveRef with no $recursiveAnchor works like $ref/two levels, properties match with inner definition",
"draft2019-09/recursiveRef.json/$recursiveRef with no $recursiveAnchor in the initial target schema resource/leaf node matches: recursion uses the inner schema",
"draft2019-09/recursiveRef.json/$recursiveRef with no $recursiveAnchor in the outer schema resource/leaf node matches: recursion only uses inner schema",
"draft2019-09/recursiveRef.json/multiple dynamic paths to the $recursiveRef keyword/recurse to anyLeafNode - floats are allowed",
"draft2019-09/recursiveRef.json/dynamic $recursiveRef destination (not predictable at schema compile time)/numeric node",
"draft2019-09/ref.json/remote ref, containing refs itself/remote ref valid",
"draft2019-09/ref.json/Recursive references between schemas/valid tree",
"draft2019-09/ref.json/ref creates new scope when adjacent to keywords/referenced subschema doesn't see annotations from properties",
"draft2019-09/ref.json/refs with relative uris and defs/valid on both fields",
"draft2019-09/ref.json/relative refs with absolute uris and defs/valid on both fields",
"draft2019-09/ref.json/$id must be resolved against nearest parent, not just immediate parent/number should pass",
"draft2019-09/ref.json/order of evaluation: $id and $ref/data is valid against first definition",
"draft2019-09/ref.json/order of evaluation: $id and $anchor and $ref/data is valid against first definition",
"draft2019-09/refRemote.json/remote ref/remote ref valid",
"draft2019-09/refRemote.json/fragment within remote ref/remote fragment valid",
"draft2019-09/refRemote.json/ref within remote ref/ref within ref valid",
"draft2019-09/refRemote.json/base URI change/base URI change ref valid",
"draft2019-09/refRemote.json/base URI change - change folder/number is valid",
"draft2019-09/refRemote.json/base URI change - change folder in subschema/number is valid",
"draft2019-09/refRemote.json/root ref in remote ref/string is valid",
"draft2019-09/refRemote.json/root ref in remote ref/null is valid",
"draft2019-09/refRemote.json/remote ref with ref to defs/valid",
"draft2019-09/refRemote.json/Location-independent identifier in remote ref/integer is valid",
"draft2019-09/unevaluatedProperties.json/unevaluatedProperties with if/then/else/when if is false and has unevaluated properties",
"draft2019-09/unevaluatedProperties.json/unevaluatedProperties with if/then/else, then not defined/when if is false and has unevaluated properties",
"draft2019-09/unevaluatedProperties.json/unevaluatedProperties with dependentSchemas/with no unevaluated properties",
"draft2019-09/unevaluatedProperties.json/unevaluatedProperties with $ref/with no unevaluated properties",
"draft2019-09/unevaluatedProperties.json/dynamic evalation inside nested refs/all is valid",
"draft2019-09/unevaluatedProperties.json/dynamic evalation inside nested refs/all + foo is valid",
"draft2019-09/uniqueItems.json/uniqueItems validation/non-unique array of objects is invalid",
"draft2019-09/uniqueItems.json/uniqueItems validation/non-unique array of nested objects is invalid",
"draft2019-09/uniqueItems.json/uniqueItems validation/non-unique array of arrays is invalid",
"draft2019-09/uniqueItems.json/uniqueItems validation/non-unique array of more than two arrays is invalid",
"draft2019-09/uniqueItems.json/uniqueItems validation/non-unique heterogeneous types are invalid",
"draft2019-09/uniqueItems.json/uniqueItems validation/objects are non-unique despite key order",
"draft2019-09/unknownKeyword.json/$id inside an unknown keyword is not a real identifier/type matches second anyOf, which has a real schema in it",
"draft2019-09/vocabulary.json/schema that uses custom metaschema with with no validation vocabulary/no validation: invalid number, but it still validates",
"draft2020-12/anchor.json/Location-independent identifier with absolute URI/match",
"draft2020-12/anchor.json/Location-independent identifier with base URI change in subschema/match",
"draft2020-12/anchor.json/same $anchor with different base uri/$ref should resolve to /$defs/A/allOf/1",
"draft2020-12/boolean_schema.json/boolean schema 'false'/number is invalid",
"draft2020-12/boolean_schema.json/boolean schema 'false'/string is invalid",
"draft2020-12/boolean_schema.json/boolean schema 'false'/boolean true is invalid",
"draft2020-12/boolean_schema.json/boolean schema 'false'/boolean false is invalid",
"draft2020-12/boolean_schema.json/boolean schema 'false'/null is invalid",
"draft2020-12/boolean_schema.json/boolean schema 'false'/object is invalid",
"draft2020-12/boolean_schema.json/boolean schema 'false'/empty object is invalid",
"draft2020-12/boolean_schema.json/boolean schema 'false'/array is invalid",
"draft2020-12/boolean_schema.json/boolean schema 'false'/empty array is invalid",
"draft2020-12/defs.json/validate definition against metaschema/valid definition schema",
"draft2020-12/dependentSchemas.json/boolean subschemas/object with property having schema false is invalid",
"draft2020-12/dependentSchemas.json/boolean subschemas/object with both properties is invalid",
"draft2020-12/dynamicRef.json/A $dynamicRef to a $dynamicAnchor in the same schema resource should behave like a normal $ref to an $anchor/An array of strings is valid",
"draft2020-12/dynamicRef.json/A $dynamicRef to an $anchor in the same schema resource should behave like a normal $ref to an $anchor/An array of strings is valid",
"draft2020-12/dynamicRef.json/A $ref to a $dynamicAnchor in the same schema resource should behave like a normal $ref to an $anchor/An array of strings is valid",
"draft2020-12/dynamicRef.json/A $dynamicRef should resolve to the first $dynamicAnchor still in scope that is encountered when the schema is evaluated/An array of strings is valid",
"draft2020-12/dynamicRef.json/A $dynamicRef with intermediate scopes that don't include a matching $dynamicAnchor should not affect dynamic scope resolution/An array of strings is valid",
"draft2020-12/dynamicRef.json/An $anchor with the same name as a $dynamicAnchor should not be used for dynamic scope resolution/Any array is valid",
"draft2020-12/dynamicRef.json/A $dynamicRef without a matching $dynamicAnchor in the same schema resource should behave like a normal $ref to $anchor/Any array is valid",
"draft2020-12/dynamicRef.json/A $dynamicRef with a non-matching $dynamicAnchor in the same schema resource should behave like a normal $ref to $anchor/Any array is valid",
"draft2020-12/dynamicRef.json/A $dynamicRef that initially resolves to a schema with a matching $dynamicAnchor should resolve to the first $dynamicAnchor in the dynamic scope/The recursive part is valid against the root",
"draft2020-12/dynamicRef.json/A $dynamicRef that initially resolves to a schema without a matching $dynamicAnchor should behave like a normal $ref to $anchor/The recursive part doesn't need to validate against the root",
"draft2020-12/dynamicRef.json/multiple dynamic paths to the $dynamicRef keyword/recurse to anyLeafNode - floats are allowed",
"draft2020-12/dynamicRef.json/after leaving a dynamic scope, it should not be used by a $dynamicRef//then/$defs/thingy is the final stop for the $dynamicRef",
"draft2020-12/dynamicRef.json/strict-tree schema, guards against misspelled properties/instance with correct field",
"draft2020-12/dynamicRef.json/tests for implementation dynamic anchor and reference link/correct extended schema",
"draft2020-12/dynamicRef.json/Tests for implementation dynamic anchor and reference link. Reference should be independent of any possible ordering./correct extended schema",
"draft2020-12/dynamicRef.json/Tests for implementation dynamic anchor and reference link. Reference should be independent of any possible ordering./correct extended schema",
"draft2020-12/id.json/Valid use of empty fragments in location-independent $id/Identifier name with absolute URI",
"draft2020-12/id.json/Valid use of empty fragments in location-independent $id/Identifier name with base URI change in subschema",
"draft2020-12/id.json/Unnormalized $ids are allowed but discouraged/Unnormalized identifier",
"draft2020-12/id.json/Unnormalized $ids are allowed but discouraged/Unnormalized identifier and no ref",
"draft2020-12/id.json/Unnormalized $ids are allowed but discouraged/Unnormalized identifier with empty fragment",
"draft2020-12/id.json/Unnormalized $ids are allowed but discouraged/Unnormalized identifier with empty fragment and no ref",
"draft2020-12/id.json/$id inside an enum is not a real identifier/exact match to enum, and type matches",
"draft2020-12/id.json/$id inside an enum is not a real identifier/match $ref to $id",
"draft2020-12/patternProperties.json/multiple simultaneous patternProperties are validated/an invalid due to the other is invalid",
"draft2020-12/patternProperties.json/patternProperties with boolean schemas/object with a property matching both true and false is invalid",
"draft2020-12/properties.json/properties, patternProperties, additionalProperties interaction/patternProperty invalidates property",
"draft2020-12/ref.json/remote ref, containing refs itself/remote ref valid",
"draft2020-12/ref.json/Recursive references between schemas/valid tree",
"draft2020-12/ref.json/ref creates new scope when adjacent to keywords/referenced subschema doesn't see annotations from properties",
"draft2020-12/ref.json/refs with relative uris and defs/valid on both fields",
"draft2020-12/ref.json/relative refs with absolute uris and defs/valid on both fields",
"draft2020-12/ref.json/$id must be resolved against nearest parent, not just immediate parent/number should pass",
"draft2020-12/ref.json/order of evaluation: $id and $ref/data is valid against first definition",
"draft2020-12/ref.json/order of evaluation: $id and $anchor and $ref/data is valid against first definition",
"draft2020-12/refRemote.json/remote ref/remote ref valid",
"draft2020-12/refRemote.json/fragment within remote ref/remote fragment valid",
"draft2020-12/refRemote.json/ref within remote ref/ref within ref valid",
"draft2020-12/refRemote.json/base URI change/base URI change ref valid",
"draft2020-12/refRemote.json/base URI change - change folder/number is valid",
"draft2020-12/refRemote.json/base URI change - change folder in subschema/number is valid",
"draft2020-12/refRemote.json/root ref in remote ref/string is valid",
"draft2020-12/refRemote.json/root ref in remote ref/null is valid",
"draft2020-12/refRemote.json/remote ref with ref to defs/valid",
"draft2020-12/refRemote.json/Location-independent identifier in remote ref/integer is valid",
"draft2020-12/unevaluatedProperties.json/unevaluatedProperties with if/then/else/when if is false and has unevaluated properties",
"draft2020-12/unevaluatedProperties.json/unevaluatedProperties with if/then/else, then not defined/when if is false and has unevaluated properties",
"draft2020-12/unevaluatedProperties.json/unevaluatedProperties with dependentSchemas/with no unevaluated properties",
"draft2020-12/unevaluatedProperties.json/unevaluatedProperties with $ref/with no unevaluated properties",
"draft2020-12/unevaluatedProperties.json/dynamic evalation inside nested refs/all is valid",
"draft2020-12/unevaluatedProperties.json/dynamic evalation inside nested refs/all + foo is valid",
"draft2020-12/uniqueItems.json/uniqueItems validation/non-unique array of objects is invalid",
"draft2020-12/uniqueItems.json/uniqueItems validation/non-unique array of nested objects is invalid",
"draft2020-12/uniqueItems.json/uniqueItems validation/non-unique array of arrays is invalid",
"draft2020-12/uniqueItems.json/uniqueItems validation/non-unique array of more than two arrays is invalid",
"draft2020-12/uniqueItems.json/uniqueItems validation/non-unique heterogeneous types are invalid",
"draft2020-12/uniqueItems.json/uniqueItems validation/objects are non-unique despite key order",
"draft2020-12/unknownKeyword.json/$id inside an unknown keyword is not a real identifier/type matches second anyOf, which has a real schema in it",
"draft2020-12/vocabulary.json/schema that uses custom metaschema with with no validation vocabulary/no validation: invalid number, but it still validates"
]);
initializeTests();

Разница между файлами не показана из-за своего большого размера Загрузить разницу