Skip to content

Commit

Permalink
Fix type to account for undefined group_key
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerry350 committed Jun 12, 2020
1 parent c9e56a2 commit 16608ee
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions x-pack/plugins/infra/common/alerting/logs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,19 @@ export const GroupedSearchQueryResponseRT = rt.intersection([
commonSearchSuccessResponseFieldsRT,
rt.type({
aggregations: rt.type({
groups: rt.type({
buckets: rt.array(
rt.type({
key: rt.record(rt.string, rt.string),
doc_count: rt.number,
})
),
after_key: rt.record(rt.string, rt.string),
}),
groups: rt.intersection([
rt.type({
buckets: rt.array(
rt.type({
key: rt.record(rt.string, rt.string),
doc_count: rt.number,
})
),
}),
rt.partial({
after_key: rt.record(rt.string, rt.string),
}),
]),
}),
hits: rt.type({
total: rt.type({
Expand Down

0 comments on commit 16608ee

Please sign in to comment.