From 1265eac8621cddf2f4dad342efc2d76a169912f7 Mon Sep 17 00:00:00 2001 From: Alexander Akait <4567934+alexander-akait@users.noreply.github.com> Date: Thu, 8 Jun 2023 00:48:47 +0300 Subject: [PATCH] feat: implement `undefinedAsNull` keyword for `enum` type (#175) --- declarations/keywords/undefinedAsNull.d.ts | 15 +++++ declarations/validate.d.ts | 2 + src/ValidationError.js | 12 +++- src/keywords/undefinedAsNull.js | 39 ++++++++++++ src/validate.js | 4 ++ test/__snapshots__/index.test.js.snap | 54 +++++++++++++++-- test/fixtures/schema.json | 41 +++++++++++++ test/index.test.js | 69 ++++++++++++++++++++++ 8 files changed, 228 insertions(+), 8 deletions(-) create mode 100644 declarations/keywords/undefinedAsNull.d.ts create mode 100644 src/keywords/undefinedAsNull.js diff --git a/declarations/keywords/undefinedAsNull.d.ts b/declarations/keywords/undefinedAsNull.d.ts new file mode 100644 index 0000000..62a6604 --- /dev/null +++ b/declarations/keywords/undefinedAsNull.d.ts @@ -0,0 +1,15 @@ +export default addUndefinedAsNullKeyword; +export type Ajv = import("ajv").default; +export type SchemaValidateFunction = import("ajv").SchemaValidateFunction; +export type AnySchemaObject = import("ajv").AnySchemaObject; +export type ValidateFunction = import("ajv").ValidateFunction; +/** @typedef {import("ajv").default} Ajv */ +/** @typedef {import("ajv").SchemaValidateFunction} SchemaValidateFunction */ +/** @typedef {import("ajv").AnySchemaObject} AnySchemaObject */ +/** @typedef {import("ajv").ValidateFunction} ValidateFunction */ +/** + * + * @param {Ajv} ajv + * @returns {Ajv} + */ +declare function addUndefinedAsNullKeyword(ajv: Ajv): Ajv; diff --git a/declarations/validate.d.ts b/declarations/validate.d.ts index 423eea0..d7171ec 100644 --- a/declarations/validate.d.ts +++ b/declarations/validate.d.ts @@ -8,6 +8,7 @@ export type Extend = { formatExclusiveMinimum?: string | undefined; formatExclusiveMaximum?: string | undefined; link?: string | undefined; + undefinedAsNull?: boolean | undefined; }; export type Schema = (JSONSchema4 | JSONSchema6 | JSONSchema7) & Extend; export type SchemaUtilErrorObject = ErrorObject & { @@ -33,6 +34,7 @@ export type ValidationErrorConfiguration = { * @property {string=} formatExclusiveMinimum * @property {string=} formatExclusiveMaximum * @property {string=} link + * @property {boolean=} undefinedAsNull */ /** @typedef {(JSONSchema4 | JSONSchema6 | JSONSchema7) & Extend} Schema */ /** @typedef {ErrorObject & { children?: Array}} SchemaUtilErrorObject */ diff --git a/src/ValidationError.js b/src/ValidationError.js index 7ce8411..bc026b8 100644 --- a/src/ValidationError.js +++ b/src/ValidationError.js @@ -543,9 +543,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..363bc8e --- /dev/null +++ b/src/keywords/undefinedAsNull.js @@ -0,0 +1,39 @@ +/** @typedef {import("ajv").default} Ajv */ +/** @typedef {import("ajv").SchemaValidateFunction} SchemaValidateFunction */ +/** @typedef {import("ajv").AnySchemaObject} AnySchemaObject */ +/** @typedef {import("ajv").ValidateFunction} ValidateFunction */ + +/** + * + * @param {Ajv} ajv + * @returns {Ajv} + */ +function addUndefinedAsNullKeyword(ajv) { + ajv.addKeyword({ + keyword: "undefinedAsNull", + before: "enum", + modifying: true, + /** @type {SchemaValidateFunction} */ + validate(kwVal, data, metadata, dataCxt) { + if ( + kwVal && + dataCxt && + metadata && + typeof metadata.enum !== "undefined" + ) { + const idx = dataCxt.parentDataProperty; + + if (typeof dataCxt.parentData[idx] === "undefined") { + // eslint-disable-next-line no-param-reassign + dataCxt.parentData[dataCxt.parentDataProperty] = null; + } + } + + return true; + }, + }); + + return ajv; +} + +export default addUndefinedAsNullKeyword; diff --git a/src/validate.js b/src/validate.js index e5316c2..a072407 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"; @@ -48,8 +49,10 @@ const getAjv = memoize(() => { ajvKeywords(ajv, ["instanceof", "patternRequired"]); addFormats(ajv, { keywords: true }); + // Custom keywords addAbsolutePathKeyword(ajv); + addUndefinedAsNullKeyword(ajv); return ajv; }); @@ -66,6 +69,7 @@ const getAjv = memoize(() => { * @property {string=} formatExclusiveMinimum * @property {string=} 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 b839237..b970055 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?, formatExclusiveMaximum? }" + 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?, formatExclusiveMaximum?, enumKeywordAndUndefined?, arrayStringAndEnum?, arrayStringAndEnumAndNoUndefined?, stringTypeAndUndefinedAsNull? }" `; 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 undefinedAsNull #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 undefinedAsNull #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 undefinedAsNull 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: @@ -638,6 +668,12 @@ exports[`Validation should fail validation for enum 2`] = ` 2 | \\"foo\\" | {\\"foo\\":\\"bar\\"} | [1,2,3]" `; +exports[`Validation should fail validation for enum and undefinedAsNull 1`] = ` +"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. + - configuration.enumKeywordAndUndefined should be one of these: + 0 | false | \\"\\" | null | undefined" +`; + exports[`Validation should fail validation for enum nested 1`] = ` "Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.enumNested should be one of these: @@ -748,7 +784,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?, formatExclusiveMaximum? }" + 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?, formatExclusiveMaximum?, enumKeywordAndUndefined?, arrayStringAndEnum?, arrayStringAndEnumAndNoUndefined?, stringTypeAndUndefinedAsNull? }" `; exports[`Validation should fail validation for if/then/else #2 1`] = ` @@ -1364,7 +1400,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?, formatExclusiveMaximum? }" + 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?, formatExclusiveMaximum?, enumKeywordAndUndefined?, arrayStringAndEnum?, arrayStringAndEnumAndNoUndefined?, stringTypeAndUndefinedAsNull? }" `; exports[`Validation should fail validation for null type 1`] = ` @@ -1687,7 +1723,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?, formatExclusiveMaximum? } + 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?, formatExclusiveMaximum?, enumKeywordAndUndefined?, arrayStringAndEnum?, arrayStringAndEnumAndNoUndefined?, stringTypeAndUndefinedAsNull? } 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. @@ -1711,7 +1747,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?, formatExclusiveMaximum? } + 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?, formatExclusiveMaximum?, enumKeywordAndUndefined?, arrayStringAndEnum?, arrayStringAndEnumAndNoUndefined?, stringTypeAndUndefinedAsNull? } 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: @@ -1804,6 +1840,12 @@ exports[`Validation should fail validation for string 1`] = ` - configuration.stringKeyword should be longer than 10 characters." `; +exports[`Validation should fail validation for string and undefinedAsNull 1`] = ` +"Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. + - configuration.stringTypeAndUndefinedAsNull should be a string. + -> References to other configurations to depend on." +`; + exports[`Validation should fail validation for string with empty pattern 1`] = ` "Invalid configuration object. Object has been initialized using a configuration object that does not match the API schema. - configuration.stringWithEmptyPattern should be a string." @@ -1835,7 +1877,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?, formatExclusiveMaximum? }" + 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?, formatExclusiveMaximum?, enumKeywordAndUndefined?, arrayStringAndEnum?, arrayStringAndEnumAndNoUndefined?, stringTypeAndUndefinedAsNull? }" `; exports[`Validation should fail validation for uniqueItems #2 1`] = ` diff --git a/test/fixtures/schema.json b/test/fixtures/schema.json index e5f0d7c..b22f0d4 100644 --- a/test/fixtures/schema.json +++ b/test/fixtures/schema.json @@ -3791,6 +3791,47 @@ "format": "date", "formatMinimum": "2016-02-06", "formatExclusiveMaximum": "2016-12-27" + }, + "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 + } + ] + } + }, + "stringTypeAndUndefinedAsNull": { + "description": "References to other configurations to depend on.", + "type": "string", + "undefinedAsNull": true } } } diff --git a/test/index.test.js b/test/index.test.js index 1b2eadb..764a04a 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -314,6 +314,33 @@ describe("Validation", () => { }, }); + createSuccessTestCase("enum with undefinedAsNull", { + // eslint-disable-next-line no-undefined + enumKeywordAndUndefined: undefined, + }); + + createSuccessTestCase("enum with undefinedAsNull #2", { + enumKeywordAndUndefined: 0, + }); + + createSuccessTestCase("array with enum and undefinedAsNull", { + arrayStringAndEnum: ["a", "b", "c"], + }); + + createSuccessTestCase("array with enum and undefinedAsNull #2", { + // eslint-disable-next-line no-undefined + arrayStringAndEnum: [undefined, false, undefined, 0, "test", undefined], + }); + + createSuccessTestCase("array with enum and undefinedAsNull #3", { + // eslint-disable-next-line no-undefined + arrayStringAndEnum: [undefined, null, false, 0, ""], + }); + + createSuccessTestCase("string and undefinedAsNull #3", { + stringTypeAndUndefinedAsNull: "test", + }); + // The "name" option createFailedTestCase( "webpack name", @@ -2987,4 +3014,46 @@ describe("Validation", () => { }, (msg) => expect(msg).toMatchSnapshot() ); + + createFailedTestCase( + "enum and undefinedAsNull", + { + enumKeywordAndUndefined: "foo", + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + "array with enum and undefinedAsNull", + { + arrayStringAndEnum: ["foo", "bar", 1], + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + "array with enum and undefinedAsNull #2", + { + // eslint-disable-next-line no-undefined + arrayStringAndEnum: ["foo", "bar", undefined, 1], + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + "array with enum and undefinedAsNull #3", + { + // eslint-disable-next-line no-undefined + arrayStringAndEnumAndNoUndefined: ["foo", "bar", undefined], + }, + (msg) => expect(msg).toMatchSnapshot() + ); + + createFailedTestCase( + "string and undefinedAsNull", + { + stringTypeAndUndefinedAsNull: 1, + }, + (msg) => expect(msg).toMatchSnapshot() + ); });