diff --git a/x-pack/packages/kbn-slo-schema/src/schema/indicators.ts b/x-pack/packages/kbn-slo-schema/src/schema/indicators.ts index 6c3149c3c35e1..f246d36382c8f 100644 --- a/x-pack/packages/kbn-slo-schema/src/schema/indicators.ts +++ b/x-pack/packages/kbn-slo-schema/src/schema/indicators.ts @@ -11,26 +11,31 @@ import { allOrAnyString } from './common'; const kqlQuerySchema = t.string; const filtersSchema = t.array( - t.type({ - meta: t.partial({ - alias: t.union([t.string, t.null]), - disabled: t.boolean, - negate: t.boolean, - // controlledBy is there to identify who owns the filter - controlledBy: t.string, - // allows grouping of filters - group: t.string, - // index and type are optional only because when you create a new filter, there are no defaults - index: t.string, - isMultiIndex: t.boolean, - type: t.string, - key: t.string, - field: t.string, - params: t.any, - value: t.string, + t.intersection([ + t.type({ + meta: t.partial({ + alias: t.union([t.string, t.null]), + disabled: t.boolean, + negate: t.boolean, + // controlledBy is there to identify who owns the filter + controlledBy: t.string, + // allows grouping of filters + group: t.string, + // index and type are optional only because when you create a new filter, there are no defaults + index: t.string, + isMultiIndex: t.boolean, + type: t.string, + key: t.string, + field: t.string, + params: t.any, + value: t.string, + }), + query: t.record(t.string, t.any), + }), + t.partial({ + $state: t.any, }), - query: t.record(t.string, t.any), - }) + ]) ); const kqlWithFiltersSchema = t.type({