Skip to content

Commit

Permalink
[ML] Allow edits to jobs with additional custom_settings props (#61067)…
Browse files Browse the repository at this point in the history
… (#61156)

* [ML] Allow edits to jobs with additional custom_settings props

* [ML] Minor text edit

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
peteharverson and elasticmachine authored Mar 25, 2020
1 parent aae59b1 commit e3c4048
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down

0 comments on commit e3c4048

Please sign in to comment.