From a68eaf22c944faf16740e78ac64b5f13703f0aeb Mon Sep 17 00:00:00 2001 From: Pete Harverson Date: Tue, 24 Mar 2020 20:18:53 +0000 Subject: [PATCH] [ML] Allow edits to jobs with additional custom_settings props (#61067) * [ML] Allow edits to jobs with additional custom_settings props * [ML] Minor text edit Co-authored-by: Elastic Machine --- .../server/routes/schemas/anomaly_detectors_schema.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/ml/server/routes/schemas/anomaly_detectors_schema.ts b/x-pack/plugins/ml/server/routes/schemas/anomaly_detectors_schema.ts index 6002bb218c41b2..22c3d94dfb29e8 100644 --- a/x-pack/plugins/ml/server/routes/schemas/anomaly_detectors_schema.ts +++ b/x-pack/plugins/ml/server/routes/schemas/anomaly_detectors_schema.ts @@ -35,10 +35,13 @@ const customUrlSchema = { time_range: schema.maybe(schema.any()), }; -const customSettingsSchema = schema.object({ - created_by: schema.maybe(schema.string()), - custom_urls: schema.maybe(schema.arrayOf(schema.maybe(schema.object({ ...customUrlSchema })))), -}); +const customSettingsSchema = schema.object( + { + created_by: schema.maybe(schema.string()), + custom_urls: schema.maybe(schema.arrayOf(schema.maybe(schema.object({ ...customUrlSchema })))), + }, + { unknowns: 'allow' } // Create / Update job API allows other fields to be added to custom_settings. +); export const anomalyDetectionUpdateJobSchema = { description: schema.maybe(schema.string()),