From 3413cbbb1bbe323f40cb9c6b9ff7a98a32b534d8 Mon Sep 17 00:00:00 2001 From: Julia Date: Thu, 31 Oct 2024 15:40:36 +0100 Subject: [PATCH] [ResponseOps]]MaintenaceWindow] Increase MW table limit to 1k (#198504) Here in this PR I am increasing the limit for MW to 1K. Even I've changed schema for query params(deleted maybe) I did not add additional tests, because we already have one integration test for the case, when we do not have `page` and `per_page` params. --- .../apis/find/schemas/v1.ts | 38 +++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/x-pack/plugins/alerting/common/routes/maintenance_window/apis/find/schemas/v1.ts b/x-pack/plugins/alerting/common/routes/maintenance_window/apis/find/schemas/v1.ts index 0c79ae2480215..7c4dffdd1d94c 100644 --- a/x-pack/plugins/alerting/common/routes/maintenance_window/apis/find/schemas/v1.ts +++ b/x-pack/plugins/alerting/common/routes/maintenance_window/apis/find/schemas/v1.ts @@ -12,26 +12,24 @@ const MAX_DOCS = 10000; export const findMaintenanceWindowsRequestQuerySchema = schema.object( { - page: schema.maybe( - schema.number({ - defaultValue: 1, - min: 1, - max: MAX_DOCS, - meta: { - description: 'The page number to return.', - }, - }) - ), - per_page: schema.maybe( - schema.number({ - defaultValue: 20, - min: 0, - max: 100, - meta: { - description: 'The number of maintenance windows to return per page.', - }, - }) - ), + // we do not need to use schema.maybe here, because if we do not pass property page, defaultValue will be used + page: schema.number({ + defaultValue: 1, + min: 1, + max: MAX_DOCS, + meta: { + description: 'The page number to return.', + }, + }), + // we do not need to use schema.maybe here, because if we do not pass property per_page, defaultValue will be used + per_page: schema.number({ + defaultValue: 1000, + min: 0, + max: 100, + meta: { + description: 'The number of maintenance windows to return per page.', + }, + }), }, { validate: (params) => {