Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

making range aggregation untagged union #2725

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

l-trotta
Copy link
Contributor

@l-trotta l-trotta commented Jul 16, 2024

fixes #2641
draft for now because I still have to figure out if we're mapping the responses right

@@ -610,6 +610,7 @@ export default async function validateModel (apiModel: model.Model, restSpec: Ma
} else if (variants.kind === 'untagged') {
if (fqn(parentName) !== '_types.query_dsl:DecayFunction' &&
fqn(parentName) !== '_types.query_dsl:DistanceFeatureQuery' &&
fqn(parentName) !== '_types.aggregations:AggregationRange' &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Let's keep the names in alphabetical order please :-)

export type AggregationRange =
| UntypedAggregationRange
| NumberAggregationRange
| StringAggregationRange
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's check, if we can have "term" range aggregations and if yes, rename this variant to TermAggregationRange.

We as well most likely want to have either a Date- or even a DateMath variant.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DateRangeAggregation can be part of the union yes. so untyped | number | term | date, like range query?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just noticed that DateRangeAggregation, like IpRangeAggregation, has its own field in the AggregationContainer (date_range). does it make sense to also add it here?

@l-trotta l-trotta marked this pull request as ready for review July 18, 2024 14:42
Copy link
Member

@flobernd flobernd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression on AggregationRange - incorrect types for from and to fields
2 participants