diff --git a/declarations/keywords/undefinedAsNull.d.ts b/declarations/keywords/undefinedAsNull.d.ts new file mode 100644 index 0000000..3509652 --- /dev/null +++ b/declarations/keywords/undefinedAsNull.d.ts @@ -0,0 +1,8 @@ +export default addUndefinedAsNullKeyword; +export type Ajv = import("ajv").Ajv; +/** + * + * @param {Ajv} ajv + * @returns {Ajv} + */ +declare function addUndefinedAsNullKeyword(ajv: Ajv): Ajv; diff --git a/declarations/validate.d.ts b/declarations/validate.d.ts index a04b6dd..8abd69a 100644 --- a/declarations/validate.d.ts +++ b/declarations/validate.d.ts @@ -8,6 +8,7 @@ export type Extend = { formatExclusiveMinimum?: boolean | undefined; formatExclusiveMaximum?: boolean | undefined; link?: string | undefined; + undefinedAsNull?: boolean | undefined; }; export type Schema = (JSONSchema4 | JSONSchema6 | JSONSchema7) & Extend; export type SchemaUtilErrorObject = ErrorObject & { @@ -22,6 +23,33 @@ export type ValidationErrorConfiguration = { baseDataPath?: string | undefined; postFormatter?: PostFormatter | undefined; }; +/** @typedef {import("json-schema").JSONSchema4} JSONSchema4 */ +/** @typedef {import("json-schema").JSONSchema6} JSONSchema6 */ +/** @typedef {import("json-schema").JSONSchema7} JSONSchema7 */ +/** @typedef {import("ajv").ErrorObject} ErrorObject */ +/** + * @typedef {Object} Extend + * @property {number=} formatMinimum + * @property {number=} formatMaximum + * @property {boolean=} formatExclusiveMinimum + * @property {boolean=} formatExclusiveMaximum + * @property {string=} link + * @property {boolean=} undefinedAsNull + */ +/** @typedef {(JSONSchema4 | JSONSchema6 | JSONSchema7) & Extend} Schema */ +/** @typedef {ErrorObject & { children?: Array}} SchemaUtilErrorObject */ +/** + * @callback PostFormatter + * @param {string} formattedError + * @param {SchemaUtilErrorObject} error + * @returns {string} + */ +/** + * @typedef {Object} ValidationErrorConfiguration + * @property {string=} name + * @property {string=} baseDataPath + * @property {PostFormatter=} postFormatter + */ /** * @param {Schema} schema * @param {Array | object} options diff --git a/package-lock.json b/package-lock.json index bcfc0cb..e790f60 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,6 +5,7 @@ "requires": true, "packages": { "": { + "name": "schema-utils", "version": "3.1.2", "license": "MIT", "dependencies": { diff --git a/src/ValidationError.js b/src/ValidationError.js index f70fda0..a01f017 100644 --- a/src/ValidationError.js +++ b/src/ValidationError.js @@ -535,9 +535,17 @@ class ValidationError extends Error { } if (schema.enum) { - return /** @type {Array} */ (schema.enum) - .map((item) => JSON.stringify(item)) + const enumValues = /** @type {Array} */ (schema.enum) + .map((item) => { + if (item === null && schema.undefinedAsNull) { + return `${JSON.stringify(item)} | undefined`; + } + + return JSON.stringify(item); + }) .join(" | "); + + return `${enumValues}`; } if (typeof schema.const !== "undefined") { diff --git a/src/keywords/undefinedAsNull.js b/src/keywords/undefinedAsNull.js new file mode 100644 index 0000000..6fab2b5 --- /dev/null +++ b/src/keywords/undefinedAsNull.js @@ -0,0 +1,96 @@ +/** @typedef {import("ajv").Ajv} Ajv */ + +/** + * + * @param {Ajv} ajv + * @param {string} keyword + * @param {any} definition + */ +function addKeyword(ajv, keyword, definition) { + let customRuleCode; + + try { + // @ts-ignore + // eslint-disable-next-line global-require + customRuleCode = require("ajv/lib/dotjs/custom"); + + // @ts-ignore + const { RULES } = ajv; + + let ruleGroup; + + for (let i = 0; i < RULES.length; i++) { + const rg = RULES[i]; + + if (typeof rg.type === "undefined") { + ruleGroup = rg; + break; + } + } + + const rule = { + keyword, + definition, + custom: true, + code: customRuleCode, + implements: definition.implements, + }; + ruleGroup.rules.unshift(rule); + RULES.custom[keyword] = rule; + + RULES.keywords[keyword] = true; + RULES.all[keyword] = true; + } catch (e) { + // Nothing, fallback + } +} + +/** + * + * @param {Ajv} ajv + * @returns {Ajv} + */ +function addUndefinedAsNullKeyword(ajv) { + // There is workaround for old versions of ajv, where `before` is not implemented + addKeyword(ajv, "undefinedAsNull", { + modifying: true, + /** + * @param {boolean} kwVal + * @param {unknown} data + * @param {any} parentSchema + * @param {string} dataPath + * @param {unknown} parentData + * @param {number | string} parentDataProperty + * @return {boolean} + */ + validate( + kwVal, + data, + parentSchema, + dataPath, + parentData, + parentDataProperty + ) { + if ( + kwVal && + parentSchema && + typeof parentSchema.enum !== "undefined" && + parentData && + typeof parentDataProperty === "number" + ) { + const idx = /** @type {number} */ (parentDataProperty); + const parentDataRef = /** @type {any[]} */ (parentData); + + if (typeof parentDataRef[idx] === "undefined") { + parentDataRef[idx] = null; + } + } + + return true; + }, + }); + + return ajv; +} + +export default addUndefinedAsNullKeyword; diff --git a/src/validate.js b/src/validate.js index e364cd2..8173b61 100644 --- a/src/validate.js +++ b/src/validate.js @@ -1,4 +1,5 @@ import addAbsolutePathKeyword from "./keywords/absolutePath"; +import addUndefinedAsNullKeyword from "./keywords/undefinedAsNull"; import ValidationError from "./ValidationError"; @@ -27,10 +28,11 @@ const memoize = (fn) => { }; }; - const getAjv = memoize(() => { // Use CommonJS require for ajv libs so TypeScript consumers aren't locked into esModuleInterop (see #110). + // eslint-disable-next-line global-require const Ajv = require("ajv"); + // eslint-disable-next-line global-require const ajvKeywords = require("ajv-keywords"); const ajv = new Ajv({ @@ -46,13 +48,13 @@ const getAjv = memoize(() => { "patternRequired", ]); -// Custom keywords + // Custom keywords addAbsolutePathKeyword(ajv); + addUndefinedAsNullKeyword(ajv); return ajv; }); - /** @typedef {import("json-schema").JSONSchema4} JSONSchema4 */ /** @typedef {import("json-schema").JSONSchema6} JSONSchema6 */ /** @typedef {import("json-schema").JSONSchema7} JSONSchema7 */ @@ -65,6 +67,7 @@ const getAjv = memoize(() => { * @property {boolean=} formatExclusiveMinimum * @property {boolean=} formatExclusiveMaximum * @property {string=} link + * @property {boolean=} undefinedAsNull */ /** @typedef {(JSONSchema4 | JSONSchema6 | JSONSchema7) & Extend} Schema */ diff --git a/test/__snapshots__/index.test.js.snap b/test/__snapshots__/index.test.js.snap index 9ab643e..96d966e 100644 --- a/test/__snapshots__/index.test.js.snap +++ b/test/__snapshots__/index.test.js.snap @@ -70,7 +70,7 @@ exports[`Validation should fail validation for absolute path 2`] = ` exports[`Validation should fail validation for additional key on root 1`] = ` "Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration has an unknown property 'postcss'. These properties are valid: - object { amd?, bail?, cache?, context?, dependencies?, devServer?, stringKeywordWithLink?, devtool?, entry?, externals?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions?, minLengthOne?, minLengthTwo?, integerType?, nullType?, allOfRef?, customObject?, objectType?, anyOfKeyword?, nestedArrayWithoutItems?, nestedObjectWithoutItems?, arrayType?, arrayType2?, multipleTypes?, zeroMaxItems?, multipleContains?, multipleContains2?, exclusiveMinimumKeyword?, exclusiveMaximumKeyword?, uniqueItemsKeyword?, minPropertiesKeyword?, maxPropertiesKeyword?, requiredKeyword?, requiredKeywordWithAdditionalProperties?, enumKeyword?, formatMinimumKeyword?, formatMaximumKeyword?, formatExclusiveMinimumKeyword?, formatExclusiveMaximumKeyword?, formatMinMaxExclusiveMinKeyword?, formatMinMaxExclusiveMaxKeyword?, minItemsKeyword?, maxItemsKeyword?, itemsKeyword?, itemsKeyword2?, additionalItemsKeyword?, additionalItemsKeyword2?, additionalItemsKeyword3?, additionalItemsKeyword4?, propertiesKeyword?, patternPropertiesKeyword?, patternPropertiesKeyword2?, arrayWithOnlyNumber?, onlyRequired?, dependenciesKeyword?, dependenciesKeyword2?, patternRequiredKeyword?, patternRequiredKeyword2?, onlyProperties?, onlyProperties2?, onlyItems?, onlyItems2?, onlyAdditionalItems?, booleanType?, additionalPropertiesKeyword?, additionalPropertiesKeyword2?, propertyNamesKeyword?, constKeyword?, constKeyword2?, ifThenElseKeyword?, ifThenElseKeyword2?, stringKeyword?, arrayKeyword?, arrayKeyword2?, arrayKeyword3?, arrayKeyword4?, arrayKeyword5?, arrayKeyword6?, arrayKeyword7?, arrayKeyword8?, arrayKeyword9?, arrayKeyword10?, arrayKeyword11?, arrayKeyword12?, arrayKeyword13?, arrayKeyword14?, arrayKeyword15?, arrayKeyword16?, arrayKeyword17?, arrayKeyword18?, arrayKeyword19?, recursion?, extending?, longString?, integerEqualsTo5?, integerWithMinimum?, integerNotWithMinimum?, integerWithNotMinMax?, integerWithExclusiveMinimum?, integerWithExclusiveMaximum?, integerNotZero?, integerZero?, numberWithMinimum?, multipleOfProp?, notMultipleOf?, stringWithMinAndMaxLength?, strictFormat?, strictFormat2?, uniqueItemsProp?, numberAndDescription?, oneOfnumberAndDescriptionAndArray?, maxPropertiesAndMinProperties?, objectTest?, objectTest2?, objectTest3?, objectTest4?, objectTest5?, objectTest6?, objectTest7?, objectTest8?, objectTest9?, stringWithEmptyPattern?, likeArray?, arrayWithEmptyItemsAndEmptyAdditionalItemsAndEmptyContains?, numberWithoutType?, numberWithoutType2?, stringWithoutType?, arrayWithoutType?, additionalItemsFalse?, requiredWithoutType?, dependenciesWithoutType?, propertyNamesWithoutType?, patternRequiredWithoutType?, additionalPropertiesWithoutType?, maxPropertiesWithoutType?, justAnObject?, arrayWithAbsolutePath?, allOfKeyword?, enumWithDescription?, constWithDescription?, itemsTrue?, emptyConst?, oneConst?, constWithEmptyString?, refAndAnyOf?, additionalPropertiesInsideOneOf?, additionalPropertiesInsideOneOf2?, singleContainsItems?, objectWithPropertyDependency?, objectWithPropertyDependency2?, objectWithPropertyDependency3?, objectWithPropertyDependency4?, oneOfWithIf?, constWithArrayNotation?, constWithObjectNotation?, additionalItemsWithoutType?, additionalItemsWithoutType2?, additionalItemsWithoutType3?, containsAndAdditionalItems?, containsInsideItem?, emptyObject?, nonEmptyObject?, nonEmptyObject2?, notEnum?, notConst?, notNumber?, notInteger?, notString?, notBoolean?, notArray?, notObject?, notNull?, notNotNull?, NotNotNotNull?, notMultipleTypes?, notMaxItemsArray?, noTypeLikeNumberMinimum?, noTypeLikeNumberMaximum?, noTypeLikeNumberExclusiveMinimum?, noTypeLikeNumberExclusiveMaximum?, minimumWithTypeNumber?, maximumWithTypeNumber?, exclusiveMinimumWithTypeNumber?, exclusiveMaximumWithTypeNumber?, noTypeLikeNumberMultipleOf?, multipleOfWithNumberType?, noTypeLikeStringMinLength?, noTypeLikeStringMaxLength?, stringWithMinLength?, stringWithMaxLength?, noTypeLikeStringPattern?, patternWithStringType?, noTypeLikeStringFormat?, stringWithFormat?, noTypeLikeStringFormatMaximum?, stringWithFormatMaximum?, multipleInstanceof?, noTypeLikeObjectPatternRequired?, objectWithPatternRequired?, noTypeLikeStringMinLength1?, noTypeLikeArrayMinItems?, noTypeLikeArrayMinItems1?, arrayWithMinItems?, noTypeMinProperties?, noTypeMinProperties1?, objectMinProperties?, noTypeLikeArrayMaxItems?, arrayMaxItems?, noTypeLikeObjectMaxProperties?, objectMaxProperties?, noTypeLikeArrayUniqueItems?, arrayWithUniqueItems?, noTypeLikeArrayAdditionalItems?, arrayWithAdditionalItems?, noTypeLikeArrayContains?, arrayWithContains?, anyOfNoTypeInItem?, oneOfNoTypeInItem?, noTypeLikeObjectPropertyNames?, objectPropertyNames?, noTypeLikeObjectDependencies?, objectWithDependencies?, noTypeLikeObjectAdditionalProperties?, noTypeLikeObjectRequired?, dollarData?, dollarData2?, enumNested?, testAbsolutePath?, notEmptyString?, notEmptyString2?, emptyString?, emptyString2? }" + object { amd?, bail?, cache?, context?, dependencies?, devServer?, stringKeywordWithLink?, devtool?, entry?, externals?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions?, minLengthOne?, minLengthTwo?, integerType?, nullType?, allOfRef?, customObject?, objectType?, anyOfKeyword?, nestedArrayWithoutItems?, nestedObjectWithoutItems?, arrayType?, arrayType2?, multipleTypes?, zeroMaxItems?, multipleContains?, multipleContains2?, exclusiveMinimumKeyword?, exclusiveMaximumKeyword?, uniqueItemsKeyword?, minPropertiesKeyword?, maxPropertiesKeyword?, requiredKeyword?, requiredKeywordWithAdditionalProperties?, enumKeyword?, formatMinimumKeyword?, formatMaximumKeyword?, formatExclusiveMinimumKeyword?, formatExclusiveMaximumKeyword?, formatMinMaxExclusiveMinKeyword?, formatMinMaxExclusiveMaxKeyword?, minItemsKeyword?, maxItemsKeyword?, itemsKeyword?, itemsKeyword2?, additionalItemsKeyword?, additionalItemsKeyword2?, additionalItemsKeyword3?, additionalItemsKeyword4?, propertiesKeyword?, patternPropertiesKeyword?, patternPropertiesKeyword2?, arrayWithOnlyNumber?, onlyRequired?, dependenciesKeyword?, dependenciesKeyword2?, patternRequiredKeyword?, patternRequiredKeyword2?, onlyProperties?, onlyProperties2?, onlyItems?, onlyItems2?, onlyAdditionalItems?, booleanType?, additionalPropertiesKeyword?, additionalPropertiesKeyword2?, propertyNamesKeyword?, constKeyword?, constKeyword2?, ifThenElseKeyword?, ifThenElseKeyword2?, stringKeyword?, arrayKeyword?, arrayKeyword2?, arrayKeyword3?, arrayKeyword4?, arrayKeyword5?, arrayKeyword6?, arrayKeyword7?, arrayKeyword8?, arrayKeyword9?, arrayKeyword10?, arrayKeyword11?, arrayKeyword12?, arrayKeyword13?, arrayKeyword14?, arrayKeyword15?, arrayKeyword16?, arrayKeyword17?, arrayKeyword18?, arrayKeyword19?, recursion?, extending?, longString?, integerEqualsTo5?, integerWithMinimum?, integerNotWithMinimum?, integerWithNotMinMax?, integerWithExclusiveMinimum?, integerWithExclusiveMaximum?, integerNotZero?, integerZero?, numberWithMinimum?, multipleOfProp?, notMultipleOf?, stringWithMinAndMaxLength?, strictFormat?, strictFormat2?, uniqueItemsProp?, numberAndDescription?, oneOfnumberAndDescriptionAndArray?, maxPropertiesAndMinProperties?, objectTest?, objectTest2?, objectTest3?, objectTest4?, objectTest5?, objectTest6?, objectTest7?, objectTest8?, objectTest9?, stringWithEmptyPattern?, likeArray?, arrayWithEmptyItemsAndEmptyAdditionalItemsAndEmptyContains?, numberWithoutType?, numberWithoutType2?, stringWithoutType?, arrayWithoutType?, additionalItemsFalse?, requiredWithoutType?, dependenciesWithoutType?, propertyNamesWithoutType?, patternRequiredWithoutType?, additionalPropertiesWithoutType?, maxPropertiesWithoutType?, justAnObject?, arrayWithAbsolutePath?, allOfKeyword?, enumWithDescription?, constWithDescription?, itemsTrue?, emptyConst?, oneConst?, constWithEmptyString?, refAndAnyOf?, additionalPropertiesInsideOneOf?, additionalPropertiesInsideOneOf2?, singleContainsItems?, objectWithPropertyDependency?, objectWithPropertyDependency2?, objectWithPropertyDependency3?, objectWithPropertyDependency4?, oneOfWithIf?, constWithArrayNotation?, constWithObjectNotation?, additionalItemsWithoutType?, additionalItemsWithoutType2?, additionalItemsWithoutType3?, containsAndAdditionalItems?, containsInsideItem?, emptyObject?, nonEmptyObject?, nonEmptyObject2?, notEnum?, notConst?, notNumber?, notInteger?, notString?, notBoolean?, notArray?, notObject?, notNull?, notNotNull?, NotNotNotNull?, notMultipleTypes?, notMaxItemsArray?, noTypeLikeNumberMinimum?, noTypeLikeNumberMaximum?, noTypeLikeNumberExclusiveMinimum?, noTypeLikeNumberExclusiveMaximum?, minimumWithTypeNumber?, maximumWithTypeNumber?, exclusiveMinimumWithTypeNumber?, exclusiveMaximumWithTypeNumber?, noTypeLikeNumberMultipleOf?, multipleOfWithNumberType?, noTypeLikeStringMinLength?, noTypeLikeStringMaxLength?, stringWithMinLength?, stringWithMaxLength?, noTypeLikeStringPattern?, patternWithStringType?, noTypeLikeStringFormat?, stringWithFormat?, noTypeLikeStringFormatMaximum?, stringWithFormatMaximum?, multipleInstanceof?, noTypeLikeObjectPatternRequired?, objectWithPatternRequired?, noTypeLikeStringMinLength1?, noTypeLikeArrayMinItems?, noTypeLikeArrayMinItems1?, arrayWithMinItems?, noTypeMinProperties?, noTypeMinProperties1?, objectMinProperties?, noTypeLikeArrayMaxItems?, arrayMaxItems?, noTypeLikeObjectMaxProperties?, objectMaxProperties?, noTypeLikeArrayUniqueItems?, arrayWithUniqueItems?, noTypeLikeArrayAdditionalItems?, arrayWithAdditionalItems?, noTypeLikeArrayContains?, arrayWithContains?, anyOfNoTypeInItem?, oneOfNoTypeInItem?, noTypeLikeObjectPropertyNames?, objectPropertyNames?, noTypeLikeObjectDependencies?, objectWithDependencies?, noTypeLikeObjectAdditionalProperties?, noTypeLikeObjectRequired?, dollarData?, dollarData2?, enumNested?, testAbsolutePath?, notEmptyString?, notEmptyString2?, emptyString?, emptyString2?, enumKeywordAndUndefined?, arrayStringAndEnum?, arrayStringAndEnumAndNoUndefined? }" `; exports[`Validation should fail validation for additionalItems #2 1`] = ` @@ -412,6 +412,36 @@ exports[`Validation should fail validation for array with empty items, empty add [any, ...]" `; +exports[`Validation should fail validation for array with enum and undefined #2 1`] = ` +"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. + - configuration.arrayStringAndEnum[3] should be one of these: + 0 | false | \\"\\" | null | undefined | non-empty string + Details: + * configuration.arrayStringAndEnum[3] should be one of these: + 0 | false | \\"\\" | null | undefined + * configuration.arrayStringAndEnum[3] should be a non-empty string." +`; + +exports[`Validation should fail validation for array with enum and undefined #3 1`] = ` +"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. + - configuration.arrayStringAndEnumAndNoUndefined[2] should be one of these: + 0 | false | \\"\\" | null | non-empty string + Details: + * configuration.arrayStringAndEnumAndNoUndefined[2] should be one of these: + 0 | false | \\"\\" | null + * configuration.arrayStringAndEnumAndNoUndefined[2] should be a non-empty string." +`; + +exports[`Validation should fail validation for array with enum and undefined 1`] = ` +"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. + - configuration.arrayStringAndEnum[2] should be one of these: + 0 | false | \\"\\" | null | undefined | non-empty string + Details: + * configuration.arrayStringAndEnum[2] should be one of these: + 0 | false | \\"\\" | null | undefined + * configuration.arrayStringAndEnum[2] should be a non-empty string." +`; + exports[`Validation should fail validation for array with items with true 1`] = ` "Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.itemsTrue should be an array: @@ -738,7 +768,7 @@ exports[`Validation should fail validation for formatMinimum 1`] = ` exports[`Validation should fail validation for holey array 1`] = ` "Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration[1] should be an object: - object { amd?, bail?, cache?, context?, dependencies?, devServer?, stringKeywordWithLink?, devtool?, entry?, externals?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions?, minLengthOne?, minLengthTwo?, integerType?, nullType?, allOfRef?, customObject?, objectType?, anyOfKeyword?, nestedArrayWithoutItems?, nestedObjectWithoutItems?, arrayType?, arrayType2?, multipleTypes?, zeroMaxItems?, multipleContains?, multipleContains2?, exclusiveMinimumKeyword?, exclusiveMaximumKeyword?, uniqueItemsKeyword?, minPropertiesKeyword?, maxPropertiesKeyword?, requiredKeyword?, requiredKeywordWithAdditionalProperties?, enumKeyword?, formatMinimumKeyword?, formatMaximumKeyword?, formatExclusiveMinimumKeyword?, formatExclusiveMaximumKeyword?, formatMinMaxExclusiveMinKeyword?, formatMinMaxExclusiveMaxKeyword?, minItemsKeyword?, maxItemsKeyword?, itemsKeyword?, itemsKeyword2?, additionalItemsKeyword?, additionalItemsKeyword2?, additionalItemsKeyword3?, additionalItemsKeyword4?, propertiesKeyword?, patternPropertiesKeyword?, patternPropertiesKeyword2?, arrayWithOnlyNumber?, onlyRequired?, dependenciesKeyword?, dependenciesKeyword2?, patternRequiredKeyword?, patternRequiredKeyword2?, onlyProperties?, onlyProperties2?, onlyItems?, onlyItems2?, onlyAdditionalItems?, booleanType?, additionalPropertiesKeyword?, additionalPropertiesKeyword2?, propertyNamesKeyword?, constKeyword?, constKeyword2?, ifThenElseKeyword?, ifThenElseKeyword2?, stringKeyword?, arrayKeyword?, arrayKeyword2?, arrayKeyword3?, arrayKeyword4?, arrayKeyword5?, arrayKeyword6?, arrayKeyword7?, arrayKeyword8?, arrayKeyword9?, arrayKeyword10?, arrayKeyword11?, arrayKeyword12?, arrayKeyword13?, arrayKeyword14?, arrayKeyword15?, arrayKeyword16?, arrayKeyword17?, arrayKeyword18?, arrayKeyword19?, recursion?, extending?, longString?, integerEqualsTo5?, integerWithMinimum?, integerNotWithMinimum?, integerWithNotMinMax?, integerWithExclusiveMinimum?, integerWithExclusiveMaximum?, integerNotZero?, integerZero?, numberWithMinimum?, multipleOfProp?, notMultipleOf?, stringWithMinAndMaxLength?, strictFormat?, strictFormat2?, uniqueItemsProp?, numberAndDescription?, oneOfnumberAndDescriptionAndArray?, maxPropertiesAndMinProperties?, objectTest?, objectTest2?, objectTest3?, objectTest4?, objectTest5?, objectTest6?, objectTest7?, objectTest8?, objectTest9?, stringWithEmptyPattern?, likeArray?, arrayWithEmptyItemsAndEmptyAdditionalItemsAndEmptyContains?, numberWithoutType?, numberWithoutType2?, stringWithoutType?, arrayWithoutType?, additionalItemsFalse?, requiredWithoutType?, dependenciesWithoutType?, propertyNamesWithoutType?, patternRequiredWithoutType?, additionalPropertiesWithoutType?, maxPropertiesWithoutType?, justAnObject?, arrayWithAbsolutePath?, allOfKeyword?, enumWithDescription?, constWithDescription?, itemsTrue?, emptyConst?, oneConst?, constWithEmptyString?, refAndAnyOf?, additionalPropertiesInsideOneOf?, additionalPropertiesInsideOneOf2?, singleContainsItems?, objectWithPropertyDependency?, objectWithPropertyDependency2?, objectWithPropertyDependency3?, objectWithPropertyDependency4?, oneOfWithIf?, constWithArrayNotation?, constWithObjectNotation?, additionalItemsWithoutType?, additionalItemsWithoutType2?, additionalItemsWithoutType3?, containsAndAdditionalItems?, containsInsideItem?, emptyObject?, nonEmptyObject?, nonEmptyObject2?, notEnum?, notConst?, notNumber?, notInteger?, notString?, notBoolean?, notArray?, notObject?, notNull?, notNotNull?, NotNotNotNull?, notMultipleTypes?, notMaxItemsArray?, noTypeLikeNumberMinimum?, noTypeLikeNumberMaximum?, noTypeLikeNumberExclusiveMinimum?, noTypeLikeNumberExclusiveMaximum?, minimumWithTypeNumber?, maximumWithTypeNumber?, exclusiveMinimumWithTypeNumber?, exclusiveMaximumWithTypeNumber?, noTypeLikeNumberMultipleOf?, multipleOfWithNumberType?, noTypeLikeStringMinLength?, noTypeLikeStringMaxLength?, stringWithMinLength?, stringWithMaxLength?, noTypeLikeStringPattern?, patternWithStringType?, noTypeLikeStringFormat?, stringWithFormat?, noTypeLikeStringFormatMaximum?, stringWithFormatMaximum?, multipleInstanceof?, noTypeLikeObjectPatternRequired?, objectWithPatternRequired?, noTypeLikeStringMinLength1?, noTypeLikeArrayMinItems?, noTypeLikeArrayMinItems1?, arrayWithMinItems?, noTypeMinProperties?, noTypeMinProperties1?, objectMinProperties?, noTypeLikeArrayMaxItems?, arrayMaxItems?, noTypeLikeObjectMaxProperties?, objectMaxProperties?, noTypeLikeArrayUniqueItems?, arrayWithUniqueItems?, noTypeLikeArrayAdditionalItems?, arrayWithAdditionalItems?, noTypeLikeArrayContains?, arrayWithContains?, anyOfNoTypeInItem?, oneOfNoTypeInItem?, noTypeLikeObjectPropertyNames?, objectPropertyNames?, noTypeLikeObjectDependencies?, objectWithDependencies?, noTypeLikeObjectAdditionalProperties?, noTypeLikeObjectRequired?, dollarData?, dollarData2?, enumNested?, testAbsolutePath?, notEmptyString?, notEmptyString2?, emptyString?, emptyString2? }" + object { amd?, bail?, cache?, context?, dependencies?, devServer?, stringKeywordWithLink?, devtool?, entry?, externals?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions?, minLengthOne?, minLengthTwo?, integerType?, nullType?, allOfRef?, customObject?, objectType?, anyOfKeyword?, nestedArrayWithoutItems?, nestedObjectWithoutItems?, arrayType?, arrayType2?, multipleTypes?, zeroMaxItems?, multipleContains?, multipleContains2?, exclusiveMinimumKeyword?, exclusiveMaximumKeyword?, uniqueItemsKeyword?, minPropertiesKeyword?, maxPropertiesKeyword?, requiredKeyword?, requiredKeywordWithAdditionalProperties?, enumKeyword?, formatMinimumKeyword?, formatMaximumKeyword?, formatExclusiveMinimumKeyword?, formatExclusiveMaximumKeyword?, formatMinMaxExclusiveMinKeyword?, formatMinMaxExclusiveMaxKeyword?, minItemsKeyword?, maxItemsKeyword?, itemsKeyword?, itemsKeyword2?, additionalItemsKeyword?, additionalItemsKeyword2?, additionalItemsKeyword3?, additionalItemsKeyword4?, propertiesKeyword?, patternPropertiesKeyword?, patternPropertiesKeyword2?, arrayWithOnlyNumber?, onlyRequired?, dependenciesKeyword?, dependenciesKeyword2?, patternRequiredKeyword?, patternRequiredKeyword2?, onlyProperties?, onlyProperties2?, onlyItems?, onlyItems2?, onlyAdditionalItems?, booleanType?, additionalPropertiesKeyword?, additionalPropertiesKeyword2?, propertyNamesKeyword?, constKeyword?, constKeyword2?, ifThenElseKeyword?, ifThenElseKeyword2?, stringKeyword?, arrayKeyword?, arrayKeyword2?, arrayKeyword3?, arrayKeyword4?, arrayKeyword5?, arrayKeyword6?, arrayKeyword7?, arrayKeyword8?, arrayKeyword9?, arrayKeyword10?, arrayKeyword11?, arrayKeyword12?, arrayKeyword13?, arrayKeyword14?, arrayKeyword15?, arrayKeyword16?, arrayKeyword17?, arrayKeyword18?, arrayKeyword19?, recursion?, extending?, longString?, integerEqualsTo5?, integerWithMinimum?, integerNotWithMinimum?, integerWithNotMinMax?, integerWithExclusiveMinimum?, integerWithExclusiveMaximum?, integerNotZero?, integerZero?, numberWithMinimum?, multipleOfProp?, notMultipleOf?, stringWithMinAndMaxLength?, strictFormat?, strictFormat2?, uniqueItemsProp?, numberAndDescription?, oneOfnumberAndDescriptionAndArray?, maxPropertiesAndMinProperties?, objectTest?, objectTest2?, objectTest3?, objectTest4?, objectTest5?, objectTest6?, objectTest7?, objectTest8?, objectTest9?, stringWithEmptyPattern?, likeArray?, arrayWithEmptyItemsAndEmptyAdditionalItemsAndEmptyContains?, numberWithoutType?, numberWithoutType2?, stringWithoutType?, arrayWithoutType?, additionalItemsFalse?, requiredWithoutType?, dependenciesWithoutType?, propertyNamesWithoutType?, patternRequiredWithoutType?, additionalPropertiesWithoutType?, maxPropertiesWithoutType?, justAnObject?, arrayWithAbsolutePath?, allOfKeyword?, enumWithDescription?, constWithDescription?, itemsTrue?, emptyConst?, oneConst?, constWithEmptyString?, refAndAnyOf?, additionalPropertiesInsideOneOf?, additionalPropertiesInsideOneOf2?, singleContainsItems?, objectWithPropertyDependency?, objectWithPropertyDependency2?, objectWithPropertyDependency3?, objectWithPropertyDependency4?, oneOfWithIf?, constWithArrayNotation?, constWithObjectNotation?, additionalItemsWithoutType?, additionalItemsWithoutType2?, additionalItemsWithoutType3?, containsAndAdditionalItems?, containsInsideItem?, emptyObject?, nonEmptyObject?, nonEmptyObject2?, notEnum?, notConst?, notNumber?, notInteger?, notString?, notBoolean?, notArray?, notObject?, notNull?, notNotNull?, NotNotNotNull?, notMultipleTypes?, notMaxItemsArray?, noTypeLikeNumberMinimum?, noTypeLikeNumberMaximum?, noTypeLikeNumberExclusiveMinimum?, noTypeLikeNumberExclusiveMaximum?, minimumWithTypeNumber?, maximumWithTypeNumber?, exclusiveMinimumWithTypeNumber?, exclusiveMaximumWithTypeNumber?, noTypeLikeNumberMultipleOf?, multipleOfWithNumberType?, noTypeLikeStringMinLength?, noTypeLikeStringMaxLength?, stringWithMinLength?, stringWithMaxLength?, noTypeLikeStringPattern?, patternWithStringType?, noTypeLikeStringFormat?, stringWithFormat?, noTypeLikeStringFormatMaximum?, stringWithFormatMaximum?, multipleInstanceof?, noTypeLikeObjectPatternRequired?, objectWithPatternRequired?, noTypeLikeStringMinLength1?, noTypeLikeArrayMinItems?, noTypeLikeArrayMinItems1?, arrayWithMinItems?, noTypeMinProperties?, noTypeMinProperties1?, objectMinProperties?, noTypeLikeArrayMaxItems?, arrayMaxItems?, noTypeLikeObjectMaxProperties?, objectMaxProperties?, noTypeLikeArrayUniqueItems?, arrayWithUniqueItems?, noTypeLikeArrayAdditionalItems?, arrayWithAdditionalItems?, noTypeLikeArrayContains?, arrayWithContains?, anyOfNoTypeInItem?, oneOfNoTypeInItem?, noTypeLikeObjectPropertyNames?, objectPropertyNames?, noTypeLikeObjectDependencies?, objectWithDependencies?, noTypeLikeObjectAdditionalProperties?, noTypeLikeObjectRequired?, dollarData?, dollarData2?, enumNested?, testAbsolutePath?, notEmptyString?, notEmptyString2?, emptyString?, emptyString2?, enumKeywordAndUndefined?, arrayStringAndEnum?, arrayStringAndEnumAndNoUndefined? }" `; exports[`Validation should fail validation for if/then/else #2 1`] = ` @@ -1354,7 +1384,7 @@ exports[`Validation should fail validation for not string 1`] = ` exports[`Validation should fail validation for null configuration 1`] = ` "Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration should be an object: - object { amd?, bail?, cache?, context?, dependencies?, devServer?, stringKeywordWithLink?, devtool?, entry?, externals?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions?, minLengthOne?, minLengthTwo?, integerType?, nullType?, allOfRef?, customObject?, objectType?, anyOfKeyword?, nestedArrayWithoutItems?, nestedObjectWithoutItems?, arrayType?, arrayType2?, multipleTypes?, zeroMaxItems?, multipleContains?, multipleContains2?, exclusiveMinimumKeyword?, exclusiveMaximumKeyword?, uniqueItemsKeyword?, minPropertiesKeyword?, maxPropertiesKeyword?, requiredKeyword?, requiredKeywordWithAdditionalProperties?, enumKeyword?, formatMinimumKeyword?, formatMaximumKeyword?, formatExclusiveMinimumKeyword?, formatExclusiveMaximumKeyword?, formatMinMaxExclusiveMinKeyword?, formatMinMaxExclusiveMaxKeyword?, minItemsKeyword?, maxItemsKeyword?, itemsKeyword?, itemsKeyword2?, additionalItemsKeyword?, additionalItemsKeyword2?, additionalItemsKeyword3?, additionalItemsKeyword4?, propertiesKeyword?, patternPropertiesKeyword?, patternPropertiesKeyword2?, arrayWithOnlyNumber?, onlyRequired?, dependenciesKeyword?, dependenciesKeyword2?, patternRequiredKeyword?, patternRequiredKeyword2?, onlyProperties?, onlyProperties2?, onlyItems?, onlyItems2?, onlyAdditionalItems?, booleanType?, additionalPropertiesKeyword?, additionalPropertiesKeyword2?, propertyNamesKeyword?, constKeyword?, constKeyword2?, ifThenElseKeyword?, ifThenElseKeyword2?, stringKeyword?, arrayKeyword?, arrayKeyword2?, arrayKeyword3?, arrayKeyword4?, arrayKeyword5?, arrayKeyword6?, arrayKeyword7?, arrayKeyword8?, arrayKeyword9?, arrayKeyword10?, arrayKeyword11?, arrayKeyword12?, arrayKeyword13?, arrayKeyword14?, arrayKeyword15?, arrayKeyword16?, arrayKeyword17?, arrayKeyword18?, arrayKeyword19?, recursion?, extending?, longString?, integerEqualsTo5?, integerWithMinimum?, integerNotWithMinimum?, integerWithNotMinMax?, integerWithExclusiveMinimum?, integerWithExclusiveMaximum?, integerNotZero?, integerZero?, numberWithMinimum?, multipleOfProp?, notMultipleOf?, stringWithMinAndMaxLength?, strictFormat?, strictFormat2?, uniqueItemsProp?, numberAndDescription?, oneOfnumberAndDescriptionAndArray?, maxPropertiesAndMinProperties?, objectTest?, objectTest2?, objectTest3?, objectTest4?, objectTest5?, objectTest6?, objectTest7?, objectTest8?, objectTest9?, stringWithEmptyPattern?, likeArray?, arrayWithEmptyItemsAndEmptyAdditionalItemsAndEmptyContains?, numberWithoutType?, numberWithoutType2?, stringWithoutType?, arrayWithoutType?, additionalItemsFalse?, requiredWithoutType?, dependenciesWithoutType?, propertyNamesWithoutType?, patternRequiredWithoutType?, additionalPropertiesWithoutType?, maxPropertiesWithoutType?, justAnObject?, arrayWithAbsolutePath?, allOfKeyword?, enumWithDescription?, constWithDescription?, itemsTrue?, emptyConst?, oneConst?, constWithEmptyString?, refAndAnyOf?, additionalPropertiesInsideOneOf?, additionalPropertiesInsideOneOf2?, singleContainsItems?, objectWithPropertyDependency?, objectWithPropertyDependency2?, objectWithPropertyDependency3?, objectWithPropertyDependency4?, oneOfWithIf?, constWithArrayNotation?, constWithObjectNotation?, additionalItemsWithoutType?, additionalItemsWithoutType2?, additionalItemsWithoutType3?, containsAndAdditionalItems?, containsInsideItem?, emptyObject?, nonEmptyObject?, nonEmptyObject2?, notEnum?, notConst?, notNumber?, notInteger?, notString?, notBoolean?, notArray?, notObject?, notNull?, notNotNull?, NotNotNotNull?, notMultipleTypes?, notMaxItemsArray?, noTypeLikeNumberMinimum?, noTypeLikeNumberMaximum?, noTypeLikeNumberExclusiveMinimum?, noTypeLikeNumberExclusiveMaximum?, minimumWithTypeNumber?, maximumWithTypeNumber?, exclusiveMinimumWithTypeNumber?, exclusiveMaximumWithTypeNumber?, noTypeLikeNumberMultipleOf?, multipleOfWithNumberType?, noTypeLikeStringMinLength?, noTypeLikeStringMaxLength?, stringWithMinLength?, stringWithMaxLength?, noTypeLikeStringPattern?, patternWithStringType?, noTypeLikeStringFormat?, stringWithFormat?, noTypeLikeStringFormatMaximum?, stringWithFormatMaximum?, multipleInstanceof?, noTypeLikeObjectPatternRequired?, objectWithPatternRequired?, noTypeLikeStringMinLength1?, noTypeLikeArrayMinItems?, noTypeLikeArrayMinItems1?, arrayWithMinItems?, noTypeMinProperties?, noTypeMinProperties1?, objectMinProperties?, noTypeLikeArrayMaxItems?, arrayMaxItems?, noTypeLikeObjectMaxProperties?, objectMaxProperties?, noTypeLikeArrayUniqueItems?, arrayWithUniqueItems?, noTypeLikeArrayAdditionalItems?, arrayWithAdditionalItems?, noTypeLikeArrayContains?, arrayWithContains?, anyOfNoTypeInItem?, oneOfNoTypeInItem?, noTypeLikeObjectPropertyNames?, objectPropertyNames?, noTypeLikeObjectDependencies?, objectWithDependencies?, noTypeLikeObjectAdditionalProperties?, noTypeLikeObjectRequired?, dollarData?, dollarData2?, enumNested?, testAbsolutePath?, notEmptyString?, notEmptyString2?, emptyString?, emptyString2? }" + object { amd?, bail?, cache?, context?, dependencies?, devServer?, stringKeywordWithLink?, devtool?, entry?, externals?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions?, minLengthOne?, minLengthTwo?, integerType?, nullType?, allOfRef?, customObject?, objectType?, anyOfKeyword?, nestedArrayWithoutItems?, nestedObjectWithoutItems?, arrayType?, arrayType2?, multipleTypes?, zeroMaxItems?, multipleContains?, multipleContains2?, exclusiveMinimumKeyword?, exclusiveMaximumKeyword?, uniqueItemsKeyword?, minPropertiesKeyword?, maxPropertiesKeyword?, requiredKeyword?, requiredKeywordWithAdditionalProperties?, enumKeyword?, formatMinimumKeyword?, formatMaximumKeyword?, formatExclusiveMinimumKeyword?, formatExclusiveMaximumKeyword?, formatMinMaxExclusiveMinKeyword?, formatMinMaxExclusiveMaxKeyword?, minItemsKeyword?, maxItemsKeyword?, itemsKeyword?, itemsKeyword2?, additionalItemsKeyword?, additionalItemsKeyword2?, additionalItemsKeyword3?, additionalItemsKeyword4?, propertiesKeyword?, patternPropertiesKeyword?, patternPropertiesKeyword2?, arrayWithOnlyNumber?, onlyRequired?, dependenciesKeyword?, dependenciesKeyword2?, patternRequiredKeyword?, patternRequiredKeyword2?, onlyProperties?, onlyProperties2?, onlyItems?, onlyItems2?, onlyAdditionalItems?, booleanType?, additionalPropertiesKeyword?, additionalPropertiesKeyword2?, propertyNamesKeyword?, constKeyword?, constKeyword2?, ifThenElseKeyword?, ifThenElseKeyword2?, stringKeyword?, arrayKeyword?, arrayKeyword2?, arrayKeyword3?, arrayKeyword4?, arrayKeyword5?, arrayKeyword6?, arrayKeyword7?, arrayKeyword8?, arrayKeyword9?, arrayKeyword10?, arrayKeyword11?, arrayKeyword12?, arrayKeyword13?, arrayKeyword14?, arrayKeyword15?, arrayKeyword16?, arrayKeyword17?, arrayKeyword18?, arrayKeyword19?, recursion?, extending?, longString?, integerEqualsTo5?, integerWithMinimum?, integerNotWithMinimum?, integerWithNotMinMax?, integerWithExclusiveMinimum?, integerWithExclusiveMaximum?, integerNotZero?, integerZero?, numberWithMinimum?, multipleOfProp?, notMultipleOf?, stringWithMinAndMaxLength?, strictFormat?, strictFormat2?, uniqueItemsProp?, numberAndDescription?, oneOfnumberAndDescriptionAndArray?, maxPropertiesAndMinProperties?, objectTest?, objectTest2?, objectTest3?, objectTest4?, objectTest5?, objectTest6?, objectTest7?, objectTest8?, objectTest9?, stringWithEmptyPattern?, likeArray?, arrayWithEmptyItemsAndEmptyAdditionalItemsAndEmptyContains?, numberWithoutType?, numberWithoutType2?, stringWithoutType?, arrayWithoutType?, additionalItemsFalse?, requiredWithoutType?, dependenciesWithoutType?, propertyNamesWithoutType?, patternRequiredWithoutType?, additionalPropertiesWithoutType?, maxPropertiesWithoutType?, justAnObject?, arrayWithAbsolutePath?, allOfKeyword?, enumWithDescription?, constWithDescription?, itemsTrue?, emptyConst?, oneConst?, constWithEmptyString?, refAndAnyOf?, additionalPropertiesInsideOneOf?, additionalPropertiesInsideOneOf2?, singleContainsItems?, objectWithPropertyDependency?, objectWithPropertyDependency2?, objectWithPropertyDependency3?, objectWithPropertyDependency4?, oneOfWithIf?, constWithArrayNotation?, constWithObjectNotation?, additionalItemsWithoutType?, additionalItemsWithoutType2?, additionalItemsWithoutType3?, containsAndAdditionalItems?, containsInsideItem?, emptyObject?, nonEmptyObject?, nonEmptyObject2?, notEnum?, notConst?, notNumber?, notInteger?, notString?, notBoolean?, notArray?, notObject?, notNull?, notNotNull?, NotNotNotNull?, notMultipleTypes?, notMaxItemsArray?, noTypeLikeNumberMinimum?, noTypeLikeNumberMaximum?, noTypeLikeNumberExclusiveMinimum?, noTypeLikeNumberExclusiveMaximum?, minimumWithTypeNumber?, maximumWithTypeNumber?, exclusiveMinimumWithTypeNumber?, exclusiveMaximumWithTypeNumber?, noTypeLikeNumberMultipleOf?, multipleOfWithNumberType?, noTypeLikeStringMinLength?, noTypeLikeStringMaxLength?, stringWithMinLength?, stringWithMaxLength?, noTypeLikeStringPattern?, patternWithStringType?, noTypeLikeStringFormat?, stringWithFormat?, noTypeLikeStringFormatMaximum?, stringWithFormatMaximum?, multipleInstanceof?, noTypeLikeObjectPatternRequired?, objectWithPatternRequired?, noTypeLikeStringMinLength1?, noTypeLikeArrayMinItems?, noTypeLikeArrayMinItems1?, arrayWithMinItems?, noTypeMinProperties?, noTypeMinProperties1?, objectMinProperties?, noTypeLikeArrayMaxItems?, arrayMaxItems?, noTypeLikeObjectMaxProperties?, objectMaxProperties?, noTypeLikeArrayUniqueItems?, arrayWithUniqueItems?, noTypeLikeArrayAdditionalItems?, arrayWithAdditionalItems?, noTypeLikeArrayContains?, arrayWithContains?, anyOfNoTypeInItem?, oneOfNoTypeInItem?, noTypeLikeObjectPropertyNames?, objectPropertyNames?, noTypeLikeObjectDependencies?, objectWithDependencies?, noTypeLikeObjectAdditionalProperties?, noTypeLikeObjectRequired?, dollarData?, dollarData2?, enumNested?, testAbsolutePath?, notEmptyString?, notEmptyString2?, emptyString?, emptyString2?, enumKeywordAndUndefined?, arrayStringAndEnum?, arrayStringAndEnumAndNoUndefined? }" `; exports[`Validation should fail validation for null type 1`] = ` @@ -1677,7 +1707,7 @@ exports[`Validation should fail validation for patternRequired without object ty exports[`Validation should fail validation for postFormatter #1 1`] = ` "Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema. - configuration has an unknown property 'minify'. These properties are valid: - object { amd?, bail?, cache?, context?, dependencies?, devServer?, stringKeywordWithLink?, devtool?, entry?, externals?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions?, minLengthOne?, minLengthTwo?, integerType?, nullType?, allOfRef?, customObject?, objectType?, anyOfKeyword?, nestedArrayWithoutItems?, nestedObjectWithoutItems?, arrayType?, arrayType2?, multipleTypes?, zeroMaxItems?, multipleContains?, multipleContains2?, exclusiveMinimumKeyword?, exclusiveMaximumKeyword?, uniqueItemsKeyword?, minPropertiesKeyword?, maxPropertiesKeyword?, requiredKeyword?, requiredKeywordWithAdditionalProperties?, enumKeyword?, formatMinimumKeyword?, formatMaximumKeyword?, formatExclusiveMinimumKeyword?, formatExclusiveMaximumKeyword?, formatMinMaxExclusiveMinKeyword?, formatMinMaxExclusiveMaxKeyword?, minItemsKeyword?, maxItemsKeyword?, itemsKeyword?, itemsKeyword2?, additionalItemsKeyword?, additionalItemsKeyword2?, additionalItemsKeyword3?, additionalItemsKeyword4?, propertiesKeyword?, patternPropertiesKeyword?, patternPropertiesKeyword2?, arrayWithOnlyNumber?, onlyRequired?, dependenciesKeyword?, dependenciesKeyword2?, patternRequiredKeyword?, patternRequiredKeyword2?, onlyProperties?, onlyProperties2?, onlyItems?, onlyItems2?, onlyAdditionalItems?, booleanType?, additionalPropertiesKeyword?, additionalPropertiesKeyword2?, propertyNamesKeyword?, constKeyword?, constKeyword2?, ifThenElseKeyword?, ifThenElseKeyword2?, stringKeyword?, arrayKeyword?, arrayKeyword2?, arrayKeyword3?, arrayKeyword4?, arrayKeyword5?, arrayKeyword6?, arrayKeyword7?, arrayKeyword8?, arrayKeyword9?, arrayKeyword10?, arrayKeyword11?, arrayKeyword12?, arrayKeyword13?, arrayKeyword14?, arrayKeyword15?, arrayKeyword16?, arrayKeyword17?, arrayKeyword18?, arrayKeyword19?, recursion?, extending?, longString?, integerEqualsTo5?, integerWithMinimum?, integerNotWithMinimum?, integerWithNotMinMax?, integerWithExclusiveMinimum?, integerWithExclusiveMaximum?, integerNotZero?, integerZero?, numberWithMinimum?, multipleOfProp?, notMultipleOf?, stringWithMinAndMaxLength?, strictFormat?, strictFormat2?, uniqueItemsProp?, numberAndDescription?, oneOfnumberAndDescriptionAndArray?, maxPropertiesAndMinProperties?, objectTest?, objectTest2?, objectTest3?, objectTest4?, objectTest5?, objectTest6?, objectTest7?, objectTest8?, objectTest9?, stringWithEmptyPattern?, likeArray?, arrayWithEmptyItemsAndEmptyAdditionalItemsAndEmptyContains?, numberWithoutType?, numberWithoutType2?, stringWithoutType?, arrayWithoutType?, additionalItemsFalse?, requiredWithoutType?, dependenciesWithoutType?, propertyNamesWithoutType?, patternRequiredWithoutType?, additionalPropertiesWithoutType?, maxPropertiesWithoutType?, justAnObject?, arrayWithAbsolutePath?, allOfKeyword?, enumWithDescription?, constWithDescription?, itemsTrue?, emptyConst?, oneConst?, constWithEmptyString?, refAndAnyOf?, additionalPropertiesInsideOneOf?, additionalPropertiesInsideOneOf2?, singleContainsItems?, objectWithPropertyDependency?, objectWithPropertyDependency2?, objectWithPropertyDependency3?, objectWithPropertyDependency4?, oneOfWithIf?, constWithArrayNotation?, constWithObjectNotation?, additionalItemsWithoutType?, additionalItemsWithoutType2?, additionalItemsWithoutType3?, containsAndAdditionalItems?, containsInsideItem?, emptyObject?, nonEmptyObject?, nonEmptyObject2?, notEnum?, notConst?, notNumber?, notInteger?, notString?, notBoolean?, notArray?, notObject?, notNull?, notNotNull?, NotNotNotNull?, notMultipleTypes?, notMaxItemsArray?, noTypeLikeNumberMinimum?, noTypeLikeNumberMaximum?, noTypeLikeNumberExclusiveMinimum?, noTypeLikeNumberExclusiveMaximum?, minimumWithTypeNumber?, maximumWithTypeNumber?, exclusiveMinimumWithTypeNumber?, exclusiveMaximumWithTypeNumber?, noTypeLikeNumberMultipleOf?, multipleOfWithNumberType?, noTypeLikeStringMinLength?, noTypeLikeStringMaxLength?, stringWithMinLength?, stringWithMaxLength?, noTypeLikeStringPattern?, patternWithStringType?, noTypeLikeStringFormat?, stringWithFormat?, noTypeLikeStringFormatMaximum?, stringWithFormatMaximum?, multipleInstanceof?, noTypeLikeObjectPatternRequired?, objectWithPatternRequired?, noTypeLikeStringMinLength1?, noTypeLikeArrayMinItems?, noTypeLikeArrayMinItems1?, arrayWithMinItems?, noTypeMinProperties?, noTypeMinProperties1?, objectMinProperties?, noTypeLikeArrayMaxItems?, arrayMaxItems?, noTypeLikeObjectMaxProperties?, objectMaxProperties?, noTypeLikeArrayUniqueItems?, arrayWithUniqueItems?, noTypeLikeArrayAdditionalItems?, arrayWithAdditionalItems?, noTypeLikeArrayContains?, arrayWithContains?, anyOfNoTypeInItem?, oneOfNoTypeInItem?, noTypeLikeObjectPropertyNames?, objectPropertyNames?, noTypeLikeObjectDependencies?, objectWithDependencies?, noTypeLikeObjectAdditionalProperties?, noTypeLikeObjectRequired?, dollarData?, dollarData2?, enumNested?, testAbsolutePath?, notEmptyString?, notEmptyString2?, emptyString?, emptyString2? } + object { amd?, bail?, cache?, context?, dependencies?, devServer?, stringKeywordWithLink?, devtool?, entry?, externals?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions?, minLengthOne?, minLengthTwo?, integerType?, nullType?, allOfRef?, customObject?, objectType?, anyOfKeyword?, nestedArrayWithoutItems?, nestedObjectWithoutItems?, arrayType?, arrayType2?, multipleTypes?, zeroMaxItems?, multipleContains?, multipleContains2?, exclusiveMinimumKeyword?, exclusiveMaximumKeyword?, uniqueItemsKeyword?, minPropertiesKeyword?, maxPropertiesKeyword?, requiredKeyword?, requiredKeywordWithAdditionalProperties?, enumKeyword?, formatMinimumKeyword?, formatMaximumKeyword?, formatExclusiveMinimumKeyword?, formatExclusiveMaximumKeyword?, formatMinMaxExclusiveMinKeyword?, formatMinMaxExclusiveMaxKeyword?, minItemsKeyword?, maxItemsKeyword?, itemsKeyword?, itemsKeyword2?, additionalItemsKeyword?, additionalItemsKeyword2?, additionalItemsKeyword3?, additionalItemsKeyword4?, propertiesKeyword?, patternPropertiesKeyword?, patternPropertiesKeyword2?, arrayWithOnlyNumber?, onlyRequired?, dependenciesKeyword?, dependenciesKeyword2?, patternRequiredKeyword?, patternRequiredKeyword2?, onlyProperties?, onlyProperties2?, onlyItems?, onlyItems2?, onlyAdditionalItems?, booleanType?, additionalPropertiesKeyword?, additionalPropertiesKeyword2?, propertyNamesKeyword?, constKeyword?, constKeyword2?, ifThenElseKeyword?, ifThenElseKeyword2?, stringKeyword?, arrayKeyword?, arrayKeyword2?, arrayKeyword3?, arrayKeyword4?, arrayKeyword5?, arrayKeyword6?, arrayKeyword7?, arrayKeyword8?, arrayKeyword9?, arrayKeyword10?, arrayKeyword11?, arrayKeyword12?, arrayKeyword13?, arrayKeyword14?, arrayKeyword15?, arrayKeyword16?, arrayKeyword17?, arrayKeyword18?, arrayKeyword19?, recursion?, extending?, longString?, integerEqualsTo5?, integerWithMinimum?, integerNotWithMinimum?, integerWithNotMinMax?, integerWithExclusiveMinimum?, integerWithExclusiveMaximum?, integerNotZero?, integerZero?, numberWithMinimum?, multipleOfProp?, notMultipleOf?, stringWithMinAndMaxLength?, strictFormat?, strictFormat2?, uniqueItemsProp?, numberAndDescription?, oneOfnumberAndDescriptionAndArray?, maxPropertiesAndMinProperties?, objectTest?, objectTest2?, objectTest3?, objectTest4?, objectTest5?, objectTest6?, objectTest7?, objectTest8?, objectTest9?, stringWithEmptyPattern?, likeArray?, arrayWithEmptyItemsAndEmptyAdditionalItemsAndEmptyContains?, numberWithoutType?, numberWithoutType2?, stringWithoutType?, arrayWithoutType?, additionalItemsFalse?, requiredWithoutType?, dependenciesWithoutType?, propertyNamesWithoutType?, patternRequiredWithoutType?, additionalPropertiesWithoutType?, maxPropertiesWithoutType?, justAnObject?, arrayWithAbsolutePath?, allOfKeyword?, enumWithDescription?, constWithDescription?, itemsTrue?, emptyConst?, oneConst?, constWithEmptyString?, refAndAnyOf?, additionalPropertiesInsideOneOf?, additionalPropertiesInsideOneOf2?, singleContainsItems?, objectWithPropertyDependency?, objectWithPropertyDependency2?, objectWithPropertyDependency3?, objectWithPropertyDependency4?, oneOfWithIf?, constWithArrayNotation?, constWithObjectNotation?, additionalItemsWithoutType?, additionalItemsWithoutType2?, additionalItemsWithoutType3?, containsAndAdditionalItems?, containsInsideItem?, emptyObject?, nonEmptyObject?, nonEmptyObject2?, notEnum?, notConst?, notNumber?, notInteger?, notString?, notBoolean?, notArray?, notObject?, notNull?, notNotNull?, NotNotNotNull?, notMultipleTypes?, notMaxItemsArray?, noTypeLikeNumberMinimum?, noTypeLikeNumberMaximum?, noTypeLikeNumberExclusiveMinimum?, noTypeLikeNumberExclusiveMaximum?, minimumWithTypeNumber?, maximumWithTypeNumber?, exclusiveMinimumWithTypeNumber?, exclusiveMaximumWithTypeNumber?, noTypeLikeNumberMultipleOf?, multipleOfWithNumberType?, noTypeLikeStringMinLength?, noTypeLikeStringMaxLength?, stringWithMinLength?, stringWithMaxLength?, noTypeLikeStringPattern?, patternWithStringType?, noTypeLikeStringFormat?, stringWithFormat?, noTypeLikeStringFormatMaximum?, stringWithFormatMaximum?, multipleInstanceof?, noTypeLikeObjectPatternRequired?, objectWithPatternRequired?, noTypeLikeStringMinLength1?, noTypeLikeArrayMinItems?, noTypeLikeArrayMinItems1?, arrayWithMinItems?, noTypeMinProperties?, noTypeMinProperties1?, objectMinProperties?, noTypeLikeArrayMaxItems?, arrayMaxItems?, noTypeLikeObjectMaxProperties?, objectMaxProperties?, noTypeLikeArrayUniqueItems?, arrayWithUniqueItems?, noTypeLikeArrayAdditionalItems?, arrayWithAdditionalItems?, noTypeLikeArrayContains?, arrayWithContains?, anyOfNoTypeInItem?, oneOfNoTypeInItem?, noTypeLikeObjectPropertyNames?, objectPropertyNames?, noTypeLikeObjectDependencies?, objectWithDependencies?, noTypeLikeObjectAdditionalProperties?, noTypeLikeObjectRequired?, dollarData?, dollarData2?, enumNested?, testAbsolutePath?, notEmptyString?, notEmptyString2?, emptyString?, emptyString2?, enumKeywordAndUndefined?, arrayStringAndEnum?, arrayStringAndEnumAndNoUndefined? } For typos: please correct them. For loader options: webpack >= v2.0.0 no longer allows custom properties in configuration. Loaders should be updated to allow passing options via loader options in module.rules. @@ -1701,7 +1731,7 @@ exports[`Validation should fail validation for postFormatter #2 1`] = ` exports[`Validation should fail validation for postFormatter 1`] = ` "Invalid configuration object. Webpack has been initialized using a configuration object that does not match the API schema. - configuration has an unknown property 'debug'. These properties are valid: - object { amd?, bail?, cache?, context?, dependencies?, devServer?, stringKeywordWithLink?, devtool?, entry?, externals?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions?, minLengthOne?, minLengthTwo?, integerType?, nullType?, allOfRef?, customObject?, objectType?, anyOfKeyword?, nestedArrayWithoutItems?, nestedObjectWithoutItems?, arrayType?, arrayType2?, multipleTypes?, zeroMaxItems?, multipleContains?, multipleContains2?, exclusiveMinimumKeyword?, exclusiveMaximumKeyword?, uniqueItemsKeyword?, minPropertiesKeyword?, maxPropertiesKeyword?, requiredKeyword?, requiredKeywordWithAdditionalProperties?, enumKeyword?, formatMinimumKeyword?, formatMaximumKeyword?, formatExclusiveMinimumKeyword?, formatExclusiveMaximumKeyword?, formatMinMaxExclusiveMinKeyword?, formatMinMaxExclusiveMaxKeyword?, minItemsKeyword?, maxItemsKeyword?, itemsKeyword?, itemsKeyword2?, additionalItemsKeyword?, additionalItemsKeyword2?, additionalItemsKeyword3?, additionalItemsKeyword4?, propertiesKeyword?, patternPropertiesKeyword?, patternPropertiesKeyword2?, arrayWithOnlyNumber?, onlyRequired?, dependenciesKeyword?, dependenciesKeyword2?, patternRequiredKeyword?, patternRequiredKeyword2?, onlyProperties?, onlyProperties2?, onlyItems?, onlyItems2?, onlyAdditionalItems?, booleanType?, additionalPropertiesKeyword?, additionalPropertiesKeyword2?, propertyNamesKeyword?, constKeyword?, constKeyword2?, ifThenElseKeyword?, ifThenElseKeyword2?, stringKeyword?, arrayKeyword?, arrayKeyword2?, arrayKeyword3?, arrayKeyword4?, arrayKeyword5?, arrayKeyword6?, arrayKeyword7?, arrayKeyword8?, arrayKeyword9?, arrayKeyword10?, arrayKeyword11?, arrayKeyword12?, arrayKeyword13?, arrayKeyword14?, arrayKeyword15?, arrayKeyword16?, arrayKeyword17?, arrayKeyword18?, arrayKeyword19?, recursion?, extending?, longString?, integerEqualsTo5?, integerWithMinimum?, integerNotWithMinimum?, integerWithNotMinMax?, integerWithExclusiveMinimum?, integerWithExclusiveMaximum?, integerNotZero?, integerZero?, numberWithMinimum?, multipleOfProp?, notMultipleOf?, stringWithMinAndMaxLength?, strictFormat?, strictFormat2?, uniqueItemsProp?, numberAndDescription?, oneOfnumberAndDescriptionAndArray?, maxPropertiesAndMinProperties?, objectTest?, objectTest2?, objectTest3?, objectTest4?, objectTest5?, objectTest6?, objectTest7?, objectTest8?, objectTest9?, stringWithEmptyPattern?, likeArray?, arrayWithEmptyItemsAndEmptyAdditionalItemsAndEmptyContains?, numberWithoutType?, numberWithoutType2?, stringWithoutType?, arrayWithoutType?, additionalItemsFalse?, requiredWithoutType?, dependenciesWithoutType?, propertyNamesWithoutType?, patternRequiredWithoutType?, additionalPropertiesWithoutType?, maxPropertiesWithoutType?, justAnObject?, arrayWithAbsolutePath?, allOfKeyword?, enumWithDescription?, constWithDescription?, itemsTrue?, emptyConst?, oneConst?, constWithEmptyString?, refAndAnyOf?, additionalPropertiesInsideOneOf?, additionalPropertiesInsideOneOf2?, singleContainsItems?, objectWithPropertyDependency?, objectWithPropertyDependency2?, objectWithPropertyDependency3?, objectWithPropertyDependency4?, oneOfWithIf?, constWithArrayNotation?, constWithObjectNotation?, additionalItemsWithoutType?, additionalItemsWithoutType2?, additionalItemsWithoutType3?, containsAndAdditionalItems?, containsInsideItem?, emptyObject?, nonEmptyObject?, nonEmptyObject2?, notEnum?, notConst?, notNumber?, notInteger?, notString?, notBoolean?, notArray?, notObject?, notNull?, notNotNull?, NotNotNotNull?, notMultipleTypes?, notMaxItemsArray?, noTypeLikeNumberMinimum?, noTypeLikeNumberMaximum?, noTypeLikeNumberExclusiveMinimum?, noTypeLikeNumberExclusiveMaximum?, minimumWithTypeNumber?, maximumWithTypeNumber?, exclusiveMinimumWithTypeNumber?, exclusiveMaximumWithTypeNumber?, noTypeLikeNumberMultipleOf?, multipleOfWithNumberType?, noTypeLikeStringMinLength?, noTypeLikeStringMaxLength?, stringWithMinLength?, stringWithMaxLength?, noTypeLikeStringPattern?, patternWithStringType?, noTypeLikeStringFormat?, stringWithFormat?, noTypeLikeStringFormatMaximum?, stringWithFormatMaximum?, multipleInstanceof?, noTypeLikeObjectPatternRequired?, objectWithPatternRequired?, noTypeLikeStringMinLength1?, noTypeLikeArrayMinItems?, noTypeLikeArrayMinItems1?, arrayWithMinItems?, noTypeMinProperties?, noTypeMinProperties1?, objectMinProperties?, noTypeLikeArrayMaxItems?, arrayMaxItems?, noTypeLikeObjectMaxProperties?, objectMaxProperties?, noTypeLikeArrayUniqueItems?, arrayWithUniqueItems?, noTypeLikeArrayAdditionalItems?, arrayWithAdditionalItems?, noTypeLikeArrayContains?, arrayWithContains?, anyOfNoTypeInItem?, oneOfNoTypeInItem?, noTypeLikeObjectPropertyNames?, objectPropertyNames?, noTypeLikeObjectDependencies?, objectWithDependencies?, noTypeLikeObjectAdditionalProperties?, noTypeLikeObjectRequired?, dollarData?, dollarData2?, enumNested?, testAbsolutePath?, notEmptyString?, notEmptyString2?, emptyString?, emptyString2? } + object { amd?, bail?, cache?, context?, dependencies?, devServer?, stringKeywordWithLink?, devtool?, entry?, externals?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions?, minLengthOne?, minLengthTwo?, integerType?, nullType?, allOfRef?, customObject?, objectType?, anyOfKeyword?, nestedArrayWithoutItems?, nestedObjectWithoutItems?, arrayType?, arrayType2?, multipleTypes?, zeroMaxItems?, multipleContains?, multipleContains2?, exclusiveMinimumKeyword?, exclusiveMaximumKeyword?, uniqueItemsKeyword?, minPropertiesKeyword?, maxPropertiesKeyword?, requiredKeyword?, requiredKeywordWithAdditionalProperties?, enumKeyword?, formatMinimumKeyword?, formatMaximumKeyword?, formatExclusiveMinimumKeyword?, formatExclusiveMaximumKeyword?, formatMinMaxExclusiveMinKeyword?, formatMinMaxExclusiveMaxKeyword?, minItemsKeyword?, maxItemsKeyword?, itemsKeyword?, itemsKeyword2?, additionalItemsKeyword?, additionalItemsKeyword2?, additionalItemsKeyword3?, additionalItemsKeyword4?, propertiesKeyword?, patternPropertiesKeyword?, patternPropertiesKeyword2?, arrayWithOnlyNumber?, onlyRequired?, dependenciesKeyword?, dependenciesKeyword2?, patternRequiredKeyword?, patternRequiredKeyword2?, onlyProperties?, onlyProperties2?, onlyItems?, onlyItems2?, onlyAdditionalItems?, booleanType?, additionalPropertiesKeyword?, additionalPropertiesKeyword2?, propertyNamesKeyword?, constKeyword?, constKeyword2?, ifThenElseKeyword?, ifThenElseKeyword2?, stringKeyword?, arrayKeyword?, arrayKeyword2?, arrayKeyword3?, arrayKeyword4?, arrayKeyword5?, arrayKeyword6?, arrayKeyword7?, arrayKeyword8?, arrayKeyword9?, arrayKeyword10?, arrayKeyword11?, arrayKeyword12?, arrayKeyword13?, arrayKeyword14?, arrayKeyword15?, arrayKeyword16?, arrayKeyword17?, arrayKeyword18?, arrayKeyword19?, recursion?, extending?, longString?, integerEqualsTo5?, integerWithMinimum?, integerNotWithMinimum?, integerWithNotMinMax?, integerWithExclusiveMinimum?, integerWithExclusiveMaximum?, integerNotZero?, integerZero?, numberWithMinimum?, multipleOfProp?, notMultipleOf?, stringWithMinAndMaxLength?, strictFormat?, strictFormat2?, uniqueItemsProp?, numberAndDescription?, oneOfnumberAndDescriptionAndArray?, maxPropertiesAndMinProperties?, objectTest?, objectTest2?, objectTest3?, objectTest4?, objectTest5?, objectTest6?, objectTest7?, objectTest8?, objectTest9?, stringWithEmptyPattern?, likeArray?, arrayWithEmptyItemsAndEmptyAdditionalItemsAndEmptyContains?, numberWithoutType?, numberWithoutType2?, stringWithoutType?, arrayWithoutType?, additionalItemsFalse?, requiredWithoutType?, dependenciesWithoutType?, propertyNamesWithoutType?, patternRequiredWithoutType?, additionalPropertiesWithoutType?, maxPropertiesWithoutType?, justAnObject?, arrayWithAbsolutePath?, allOfKeyword?, enumWithDescription?, constWithDescription?, itemsTrue?, emptyConst?, oneConst?, constWithEmptyString?, refAndAnyOf?, additionalPropertiesInsideOneOf?, additionalPropertiesInsideOneOf2?, singleContainsItems?, objectWithPropertyDependency?, objectWithPropertyDependency2?, objectWithPropertyDependency3?, objectWithPropertyDependency4?, oneOfWithIf?, constWithArrayNotation?, constWithObjectNotation?, additionalItemsWithoutType?, additionalItemsWithoutType2?, additionalItemsWithoutType3?, containsAndAdditionalItems?, containsInsideItem?, emptyObject?, nonEmptyObject?, nonEmptyObject2?, notEnum?, notConst?, notNumber?, notInteger?, notString?, notBoolean?, notArray?, notObject?, notNull?, notNotNull?, NotNotNotNull?, notMultipleTypes?, notMaxItemsArray?, noTypeLikeNumberMinimum?, noTypeLikeNumberMaximum?, noTypeLikeNumberExclusiveMinimum?, noTypeLikeNumberExclusiveMaximum?, minimumWithTypeNumber?, maximumWithTypeNumber?, exclusiveMinimumWithTypeNumber?, exclusiveMaximumWithTypeNumber?, noTypeLikeNumberMultipleOf?, multipleOfWithNumberType?, noTypeLikeStringMinLength?, noTypeLikeStringMaxLength?, stringWithMinLength?, stringWithMaxLength?, noTypeLikeStringPattern?, patternWithStringType?, noTypeLikeStringFormat?, stringWithFormat?, noTypeLikeStringFormatMaximum?, stringWithFormatMaximum?, multipleInstanceof?, noTypeLikeObjectPatternRequired?, objectWithPatternRequired?, noTypeLikeStringMinLength1?, noTypeLikeArrayMinItems?, noTypeLikeArrayMinItems1?, arrayWithMinItems?, noTypeMinProperties?, noTypeMinProperties1?, objectMinProperties?, noTypeLikeArrayMaxItems?, arrayMaxItems?, noTypeLikeObjectMaxProperties?, objectMaxProperties?, noTypeLikeArrayUniqueItems?, arrayWithUniqueItems?, noTypeLikeArrayAdditionalItems?, arrayWithAdditionalItems?, noTypeLikeArrayContains?, arrayWithContains?, anyOfNoTypeInItem?, oneOfNoTypeInItem?, noTypeLikeObjectPropertyNames?, objectPropertyNames?, noTypeLikeObjectDependencies?, objectWithDependencies?, noTypeLikeObjectAdditionalProperties?, noTypeLikeObjectRequired?, dollarData?, dollarData2?, enumNested?, testAbsolutePath?, notEmptyString?, notEmptyString2?, emptyString?, emptyString2?, enumKeywordAndUndefined?, arrayStringAndEnum?, arrayStringAndEnumAndNoUndefined? } The 'debug' property was removed in webpack 2.0.0. Loaders should be updated to allow passing this option via loader options in module.rules. Until loaders are updated one can use the LoaderOptionsPlugin to switch loaders into debug mode: @@ -1825,7 +1855,7 @@ exports[`Validation should fail validation for terser-webpack-plugin name 1`] = exports[`Validation should fail validation for undefined configuration 1`] = ` "Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration should be an object: - object { amd?, bail?, cache?, context?, dependencies?, devServer?, stringKeywordWithLink?, devtool?, entry?, externals?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions?, minLengthOne?, minLengthTwo?, integerType?, nullType?, allOfRef?, customObject?, objectType?, anyOfKeyword?, nestedArrayWithoutItems?, nestedObjectWithoutItems?, arrayType?, arrayType2?, multipleTypes?, zeroMaxItems?, multipleContains?, multipleContains2?, exclusiveMinimumKeyword?, exclusiveMaximumKeyword?, uniqueItemsKeyword?, minPropertiesKeyword?, maxPropertiesKeyword?, requiredKeyword?, requiredKeywordWithAdditionalProperties?, enumKeyword?, formatMinimumKeyword?, formatMaximumKeyword?, formatExclusiveMinimumKeyword?, formatExclusiveMaximumKeyword?, formatMinMaxExclusiveMinKeyword?, formatMinMaxExclusiveMaxKeyword?, minItemsKeyword?, maxItemsKeyword?, itemsKeyword?, itemsKeyword2?, additionalItemsKeyword?, additionalItemsKeyword2?, additionalItemsKeyword3?, additionalItemsKeyword4?, propertiesKeyword?, patternPropertiesKeyword?, patternPropertiesKeyword2?, arrayWithOnlyNumber?, onlyRequired?, dependenciesKeyword?, dependenciesKeyword2?, patternRequiredKeyword?, patternRequiredKeyword2?, onlyProperties?, onlyProperties2?, onlyItems?, onlyItems2?, onlyAdditionalItems?, booleanType?, additionalPropertiesKeyword?, additionalPropertiesKeyword2?, propertyNamesKeyword?, constKeyword?, constKeyword2?, ifThenElseKeyword?, ifThenElseKeyword2?, stringKeyword?, arrayKeyword?, arrayKeyword2?, arrayKeyword3?, arrayKeyword4?, arrayKeyword5?, arrayKeyword6?, arrayKeyword7?, arrayKeyword8?, arrayKeyword9?, arrayKeyword10?, arrayKeyword11?, arrayKeyword12?, arrayKeyword13?, arrayKeyword14?, arrayKeyword15?, arrayKeyword16?, arrayKeyword17?, arrayKeyword18?, arrayKeyword19?, recursion?, extending?, longString?, integerEqualsTo5?, integerWithMinimum?, integerNotWithMinimum?, integerWithNotMinMax?, integerWithExclusiveMinimum?, integerWithExclusiveMaximum?, integerNotZero?, integerZero?, numberWithMinimum?, multipleOfProp?, notMultipleOf?, stringWithMinAndMaxLength?, strictFormat?, strictFormat2?, uniqueItemsProp?, numberAndDescription?, oneOfnumberAndDescriptionAndArray?, maxPropertiesAndMinProperties?, objectTest?, objectTest2?, objectTest3?, objectTest4?, objectTest5?, objectTest6?, objectTest7?, objectTest8?, objectTest9?, stringWithEmptyPattern?, likeArray?, arrayWithEmptyItemsAndEmptyAdditionalItemsAndEmptyContains?, numberWithoutType?, numberWithoutType2?, stringWithoutType?, arrayWithoutType?, additionalItemsFalse?, requiredWithoutType?, dependenciesWithoutType?, propertyNamesWithoutType?, patternRequiredWithoutType?, additionalPropertiesWithoutType?, maxPropertiesWithoutType?, justAnObject?, arrayWithAbsolutePath?, allOfKeyword?, enumWithDescription?, constWithDescription?, itemsTrue?, emptyConst?, oneConst?, constWithEmptyString?, refAndAnyOf?, additionalPropertiesInsideOneOf?, additionalPropertiesInsideOneOf2?, singleContainsItems?, objectWithPropertyDependency?, objectWithPropertyDependency2?, objectWithPropertyDependency3?, objectWithPropertyDependency4?, oneOfWithIf?, constWithArrayNotation?, constWithObjectNotation?, additionalItemsWithoutType?, additionalItemsWithoutType2?, additionalItemsWithoutType3?, containsAndAdditionalItems?, containsInsideItem?, emptyObject?, nonEmptyObject?, nonEmptyObject2?, notEnum?, notConst?, notNumber?, notInteger?, notString?, notBoolean?, notArray?, notObject?, notNull?, notNotNull?, NotNotNotNull?, notMultipleTypes?, notMaxItemsArray?, noTypeLikeNumberMinimum?, noTypeLikeNumberMaximum?, noTypeLikeNumberExclusiveMinimum?, noTypeLikeNumberExclusiveMaximum?, minimumWithTypeNumber?, maximumWithTypeNumber?, exclusiveMinimumWithTypeNumber?, exclusiveMaximumWithTypeNumber?, noTypeLikeNumberMultipleOf?, multipleOfWithNumberType?, noTypeLikeStringMinLength?, noTypeLikeStringMaxLength?, stringWithMinLength?, stringWithMaxLength?, noTypeLikeStringPattern?, patternWithStringType?, noTypeLikeStringFormat?, stringWithFormat?, noTypeLikeStringFormatMaximum?, stringWithFormatMaximum?, multipleInstanceof?, noTypeLikeObjectPatternRequired?, objectWithPatternRequired?, noTypeLikeStringMinLength1?, noTypeLikeArrayMinItems?, noTypeLikeArrayMinItems1?, arrayWithMinItems?, noTypeMinProperties?, noTypeMinProperties1?, objectMinProperties?, noTypeLikeArrayMaxItems?, arrayMaxItems?, noTypeLikeObjectMaxProperties?, objectMaxProperties?, noTypeLikeArrayUniqueItems?, arrayWithUniqueItems?, noTypeLikeArrayAdditionalItems?, arrayWithAdditionalItems?, noTypeLikeArrayContains?, arrayWithContains?, anyOfNoTypeInItem?, oneOfNoTypeInItem?, noTypeLikeObjectPropertyNames?, objectPropertyNames?, noTypeLikeObjectDependencies?, objectWithDependencies?, noTypeLikeObjectAdditionalProperties?, noTypeLikeObjectRequired?, dollarData?, dollarData2?, enumNested?, testAbsolutePath?, notEmptyString?, notEmptyString2?, emptyString?, emptyString2? }" + object { amd?, bail?, cache?, context?, dependencies?, devServer?, stringKeywordWithLink?, devtool?, entry?, externals?, loader?, mode?, module?, name?, node?, optimization?, output?, parallelism?, performance?, plugins?, profile?, recordsInputPath?, recordsOutputPath?, recordsPath?, resolve?, resolveLoader?, serve?, stats?, target?, watch?, watchOptions?, minLengthOne?, minLengthTwo?, integerType?, nullType?, allOfRef?, customObject?, objectType?, anyOfKeyword?, nestedArrayWithoutItems?, nestedObjectWithoutItems?, arrayType?, arrayType2?, multipleTypes?, zeroMaxItems?, multipleContains?, multipleContains2?, exclusiveMinimumKeyword?, exclusiveMaximumKeyword?, uniqueItemsKeyword?, minPropertiesKeyword?, maxPropertiesKeyword?, requiredKeyword?, requiredKeywordWithAdditionalProperties?, enumKeyword?, formatMinimumKeyword?, formatMaximumKeyword?, formatExclusiveMinimumKeyword?, formatExclusiveMaximumKeyword?, formatMinMaxExclusiveMinKeyword?, formatMinMaxExclusiveMaxKeyword?, minItemsKeyword?, maxItemsKeyword?, itemsKeyword?, itemsKeyword2?, additionalItemsKeyword?, additionalItemsKeyword2?, additionalItemsKeyword3?, additionalItemsKeyword4?, propertiesKeyword?, patternPropertiesKeyword?, patternPropertiesKeyword2?, arrayWithOnlyNumber?, onlyRequired?, dependenciesKeyword?, dependenciesKeyword2?, patternRequiredKeyword?, patternRequiredKeyword2?, onlyProperties?, onlyProperties2?, onlyItems?, onlyItems2?, onlyAdditionalItems?, booleanType?, additionalPropertiesKeyword?, additionalPropertiesKeyword2?, propertyNamesKeyword?, constKeyword?, constKeyword2?, ifThenElseKeyword?, ifThenElseKeyword2?, stringKeyword?, arrayKeyword?, arrayKeyword2?, arrayKeyword3?, arrayKeyword4?, arrayKeyword5?, arrayKeyword6?, arrayKeyword7?, arrayKeyword8?, arrayKeyword9?, arrayKeyword10?, arrayKeyword11?, arrayKeyword12?, arrayKeyword13?, arrayKeyword14?, arrayKeyword15?, arrayKeyword16?, arrayKeyword17?, arrayKeyword18?, arrayKeyword19?, recursion?, extending?, longString?, integerEqualsTo5?, integerWithMinimum?, integerNotWithMinimum?, integerWithNotMinMax?, integerWithExclusiveMinimum?, integerWithExclusiveMaximum?, integerNotZero?, integerZero?, numberWithMinimum?, multipleOfProp?, notMultipleOf?, stringWithMinAndMaxLength?, strictFormat?, strictFormat2?, uniqueItemsProp?, numberAndDescription?, oneOfnumberAndDescriptionAndArray?, maxPropertiesAndMinProperties?, objectTest?, objectTest2?, objectTest3?, objectTest4?, objectTest5?, objectTest6?, objectTest7?, objectTest8?, objectTest9?, stringWithEmptyPattern?, likeArray?, arrayWithEmptyItemsAndEmptyAdditionalItemsAndEmptyContains?, numberWithoutType?, numberWithoutType2?, stringWithoutType?, arrayWithoutType?, additionalItemsFalse?, requiredWithoutType?, dependenciesWithoutType?, propertyNamesWithoutType?, patternRequiredWithoutType?, additionalPropertiesWithoutType?, maxPropertiesWithoutType?, justAnObject?, arrayWithAbsolutePath?, allOfKeyword?, enumWithDescription?, constWithDescription?, itemsTrue?, emptyConst?, oneConst?, constWithEmptyString?, refAndAnyOf?, additionalPropertiesInsideOneOf?, additionalPropertiesInsideOneOf2?, singleContainsItems?, objectWithPropertyDependency?, objectWithPropertyDependency2?, objectWithPropertyDependency3?, objectWithPropertyDependency4?, oneOfWithIf?, constWithArrayNotation?, constWithObjectNotation?, additionalItemsWithoutType?, additionalItemsWithoutType2?, additionalItemsWithoutType3?, containsAndAdditionalItems?, containsInsideItem?, emptyObject?, nonEmptyObject?, nonEmptyObject2?, notEnum?, notConst?, notNumber?, notInteger?, notString?, notBoolean?, notArray?, notObject?, notNull?, notNotNull?, NotNotNotNull?, notMultipleTypes?, notMaxItemsArray?, noTypeLikeNumberMinimum?, noTypeLikeNumberMaximum?, noTypeLikeNumberExclusiveMinimum?, noTypeLikeNumberExclusiveMaximum?, minimumWithTypeNumber?, maximumWithTypeNumber?, exclusiveMinimumWithTypeNumber?, exclusiveMaximumWithTypeNumber?, noTypeLikeNumberMultipleOf?, multipleOfWithNumberType?, noTypeLikeStringMinLength?, noTypeLikeStringMaxLength?, stringWithMinLength?, stringWithMaxLength?, noTypeLikeStringPattern?, patternWithStringType?, noTypeLikeStringFormat?, stringWithFormat?, noTypeLikeStringFormatMaximum?, stringWithFormatMaximum?, multipleInstanceof?, noTypeLikeObjectPatternRequired?, objectWithPatternRequired?, noTypeLikeStringMinLength1?, noTypeLikeArrayMinItems?, noTypeLikeArrayMinItems1?, arrayWithMinItems?, noTypeMinProperties?, noTypeMinProperties1?, objectMinProperties?, noTypeLikeArrayMaxItems?, arrayMaxItems?, noTypeLikeObjectMaxProperties?, objectMaxProperties?, noTypeLikeArrayUniqueItems?, arrayWithUniqueItems?, noTypeLikeArrayAdditionalItems?, arrayWithAdditionalItems?, noTypeLikeArrayContains?, arrayWithContains?, anyOfNoTypeInItem?, oneOfNoTypeInItem?, noTypeLikeObjectPropertyNames?, objectPropertyNames?, noTypeLikeObjectDependencies?, objectWithDependencies?, noTypeLikeObjectAdditionalProperties?, noTypeLikeObjectRequired?, dollarData?, dollarData2?, enumNested?, testAbsolutePath?, notEmptyString?, notEmptyString2?, emptyString?, emptyString2?, enumKeywordAndUndefined?, arrayStringAndEnum?, arrayStringAndEnumAndNoUndefined? }" `; exports[`Validation should fail validation for uniqueItems #2 1`] = ` diff --git a/test/fixtures/schema.json b/test/fixtures/schema.json index 9959144..20be001 100644 --- a/test/fixtures/schema.json +++ b/test/fixtures/schema.json @@ -3786,6 +3786,42 @@ "emptyString2": { "maxLength": 0, "type": "string" + }, + "enumKeywordAndUndefined": { + "undefinedAsNull": true, + "enum": [ 0, false, "", null ] + }, + "arrayStringAndEnum": { + "description": "References to other configurations to depend on.", + "type": "array", + "items": { + "anyOf": [ + { + "undefinedAsNull": true, + "enum": [ 0, false, "", null ] + }, + { + "type": "string", + "minLength": 1 + } + ] + } + }, + "arrayStringAndEnumAndNoUndefined": { + "description": "References to other configurations to depend on.", + "type": "array", + "items": { + "anyOf": [ + { + "undefinedAsNull": false, + "enum": [ 0, false, "", null ] + }, + { + "type": "string", + "minLength": 1 + } + ] + } } } } diff --git a/test/index.test.js b/test/index.test.js index fa24356..159c2d9 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -2971,4 +2971,53 @@ describe("Validation", () => { {}, webpackSchema ); + + createSuccessTestCase("enum with undefined", { + // eslint-disable-next-line no-undefined + enumKeywordAndUndefined: undefined, + }); + + createSuccessTestCase("enum with undefined #2", { + enumKeywordAndUndefined: 0, + }); + + createSuccessTestCase("array with enum and undefined", { + arrayStringAndEnum: ["a", "b", "c"], + }); + + createSuccessTestCase("array with enum and undefined #2", { + // eslint-disable-next-line no-undefined + arrayStringAndEnum: [undefined, false, undefined, 0, "test", undefined], + }); + + createSuccessTestCase("array with enum and undefined #3", { + // eslint-disable-next-line no-undefined + arrayStringAndEnum: [undefined, null, false, 0, ""], + }); + + createFailedTestCase( + "array with enum and undefined", + { + arrayStringAndEnum: ["foo", "bar", 1], + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + "array with enum and undefined #2", + { + // eslint-disable-next-line no-undefined + arrayStringAndEnum: ["foo", "bar", undefined, 1], + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + "array with enum and undefined #3", + { + // eslint-disable-next-line no-undefined + arrayStringAndEnumAndNoUndefined: ["foo", "bar", undefined], + }, + (msg) => expect(msg).toMatchSnapshot() + ); });