Skip to content

Commit

Permalink
Making params optional
Browse files Browse the repository at this point in the history
  • Loading branch information
doakalexi committed May 15, 2023
1 parent 76f6fd9 commit bd6cab3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ const EsQueryRuleParamsSchemaProperties = {
threshold: schema.arrayOf(schema.number(), { minSize: 1, maxSize: 2 }),
thresholdComparator: getComparatorSchemaType(validateComparator),
// aggregation type
aggType: schema.string({ validate: validateAggType }),
aggType: schema.maybe(schema.string({ validate: validateAggType, defaultValue: 'count' })),
// aggregation field
aggField: schema.maybe(schema.string({ minLength: 1 })),
// how to group
groupBy: schema.string({ validate: validateGroupBy }),
groupBy: schema.maybe(schema.string({ validate: validateGroupBy, defaultValue: 'all' })),
// field to group on (for groupBy: top)
termField: schema.maybe(schema.string({ minLength: 1 })),
// limit on number of groups returned
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ export const CoreQueryParamsSchemaProperties = {
// field in index used for date/time
timeField: schema.string({ minLength: 1 }),
// aggregation type
aggType: schema.string({ validate: validateAggType }),
aggType: schema.maybe(schema.string({ validate: validateAggType, defaultValue: 'count' })),
// aggregation field
aggField: schema.maybe(schema.string({ minLength: 1 })),
// how to group
groupBy: schema.string({ validate: validateGroupBy }),
groupBy: schema.maybe(schema.string({ validate: validateGroupBy, defaultValue: 'all' })),
// field to group on (for groupBy: top)
termField: schema.maybe(schema.string({ minLength: 1 })),
// filter field
Expand Down

0 comments on commit bd6cab3

Please sign in to comment.