From ebfa1e67e67a8d042a82167416414ee4e5f63b6b Mon Sep 17 00:00:00 2001 From: Quynh Nguyen Date: Tue, 26 Oct 2021 09:39:19 -0500 Subject: [PATCH] [ML] Fix validation on schema to only check it it's defined/not null --- x-pack/plugins/transform/common/api_schemas/transforms.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/transform/common/api_schemas/transforms.ts b/x-pack/plugins/transform/common/api_schemas/transforms.ts index 6cdf7ec58b514..59165199fe7d3 100644 --- a/x-pack/plugins/transform/common/api_schemas/transforms.ts +++ b/x-pack/plugins/transform/common/api_schemas/transforms.ts @@ -100,8 +100,8 @@ export const _metaSchema = schema.object( unknowns: 'allow', validate: (v: object) => { // Values should all be objects - if (Object.values(v).some((arg) => !(typeof arg === 'object' && arg !== null))) { - return 'Invalid _meta request, expected only object'; + if (Object.values(v).some((arg) => arg === undefined || arg === null)) { + return 'Invalid _meta request'; } }, }