diff --git a/x-pack/legacy/plugins/watcher/server/np_ready/routes/api/indices/register_get_route.ts b/x-pack/legacy/plugins/watcher/server/np_ready/routes/api/indices/register_get_route.ts index fecc5e016de5c2..6b6b643dc4adf1 100644 --- a/x-pack/legacy/plugins/watcher/server/np_ready/routes/api/indices/register_get_route.ts +++ b/x-pack/legacy/plugins/watcher/server/np_ready/routes/api/indices/register_get_route.ts @@ -4,6 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ +import { schema } from '@kbn/config-schema'; import { RequestHandler } from 'src/core/server'; import { reduce, size } from 'lodash'; import { callWithRequestFactory } from '../../../lib/call_with_request_factory'; @@ -82,7 +83,9 @@ export function registerGetRoute(deps: RouteDependencies, legacy: ServerShim) { deps.router.post( { path: '/api/watcher/indices', - validate: false, + validate: { + body: schema.object({}, { allowUnknowns: true }), + }, }, licensePreRoutingFactory(legacy, handler) ); diff --git a/x-pack/legacy/plugins/watcher/server/np_ready/routes/api/register_list_fields_route.ts b/x-pack/legacy/plugins/watcher/server/np_ready/routes/api/register_list_fields_route.ts index 75622ce12adb3b..f3222d24f0adf9 100644 --- a/x-pack/legacy/plugins/watcher/server/np_ready/routes/api/register_list_fields_route.ts +++ b/x-pack/legacy/plugins/watcher/server/np_ready/routes/api/register_list_fields_route.ts @@ -4,6 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ +import { schema } from '@kbn/config-schema'; import { RequestHandler } from 'src/core/server'; import { callWithRequestFactory } from '../../lib/call_with_request_factory'; import { isEsError } from '../../lib/is_es_error'; @@ -53,7 +54,11 @@ export function registerListFieldsRoute(deps: RouteDependencies, legacy: ServerS deps.router.post( { path: '/api/watcher/fields', - validate: false, + validate: { + body: schema.object({ + indexes: schema.arrayOf(schema.string()), + }), + }, }, licensePreRoutingFactory(legacy, handler) );