From 0eda36518d4897e5922316c021baab1b6afb3db0 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Sun, 27 Nov 2022 08:17:35 +0530 Subject: [PATCH] fix: update schema for `index` and `methods` properties --- src/options.json | 4 ++-- .../validation-options.test.js.snap.webpack5 | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/options.json b/src/options.json index 9cee60776..0fa043a38 100644 --- a/src/options.json +++ b/src/options.json @@ -24,7 +24,7 @@ "type": "array", "items": { "type": "string", - "minlength": "1" + "minLength": 1 } }, "headers": { @@ -116,7 +116,7 @@ }, { "type": "string", - "minlength": "1" + "minLength": 1 } ] } diff --git a/test/__snapshots__/validation-options.test.js.snap.webpack5 b/test/__snapshots__/validation-options.test.js.snap.webpack5 index 7314e22c1..fd9f23597 100644 --- a/test/__snapshots__/validation-options.test.js.snap.webpack5 +++ b/test/__snapshots__/validation-options.test.js.snap.webpack5 @@ -42,29 +42,29 @@ exports[`validation should throw an error on the "headers" option with "true" va exports[`validation should throw an error on the "index" option with "{}" value 1`] = ` "Invalid options object. Dev Middleware has been initialized using an options object that does not match the API schema. - options.index should be one of these: - boolean | string + boolean | non-empty string -> Allows to serve an index of the directory. -> Read more at https://github.com/webpack/webpack-dev-middleware#index Details: * options.index should be a boolean. - * options.index should be a string." + * options.index should be a non-empty string." `; exports[`validation should throw an error on the "index" option with "0" value 1`] = ` "Invalid options object. Dev Middleware has been initialized using an options object that does not match the API schema. - options.index should be one of these: - boolean | string + boolean | non-empty string -> Allows to serve an index of the directory. -> Read more at https://github.com/webpack/webpack-dev-middleware#index Details: * options.index should be a boolean. - * options.index should be a string." + * options.index should be a non-empty string." `; exports[`validation should throw an error on the "methods" option with "{}" value 1`] = ` "Invalid options object. Dev Middleware has been initialized using an options object that does not match the API schema. - options.methods should be an array: - [string, ...] + [non-empty string, ...] -> Allows to pass the list of HTTP request methods accepted by the middleware. -> Read more at https://github.com/webpack/webpack-dev-middleware#methods" `; @@ -72,7 +72,7 @@ exports[`validation should throw an error on the "methods" option with "{}" valu exports[`validation should throw an error on the "methods" option with "true" value 1`] = ` "Invalid options object. Dev Middleware has been initialized using an options object that does not match the API schema. - options.methods should be an array: - [string, ...] + [non-empty string, ...] -> Allows to pass the list of HTTP request methods accepted by the middleware. -> Read more at https://github.com/webpack/webpack-dev-middleware#methods" `;