diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml
index 23d3b7fb9b8..9cf59ca1bca 100644
--- a/.generator/schemas/v2/openapi.yaml
+++ b/.generator/schemas/v2/openapi.yaml
@@ -117479,7 +117479,7 @@ components:
`filter.indexes` is not supported and is ignored.
properties:
compute:
- description: The list of metrics or timeseries to compute for the retrieved buckets.
+ description: The list of metrics or timeseries to compute for the retrieved buckets. All rules must have the same `type`; mixing `total` and `timeseries` rules is rejected.
items:
$ref: "#/components/schemas/RUMCompute"
type: array
@@ -117497,7 +117497,7 @@ components:
type: object
RUMAggregateSort:
description: A sort rule.
- example: {"aggregation": "count", "order": "asc"}
+ example: {"aggregation": "count", "order": "asc", "type": "measure"}
properties:
aggregation:
$ref: "#/components/schemas/RUMAggregationFunction"
@@ -117512,7 +117512,7 @@ components:
type: object
RUMAggregateSortType:
default: "alphabetical"
- description: The type of sorting algorithm. `alphabetical` sorts buckets by the facet value. `measure` sorts them by a computed aggregation.
+ description: The type of sorting algorithm. `alphabetical` sorts buckets by the facet value. `measure` sorts them by a computed aggregation, and is required when the sort sets `aggregation` or `metric`.
enum: ["alphabetical", "measure"]
type: string
x-enum-varnames: ["ALPHABETICAL", "MEASURE"]
@@ -247505,6 +247505,7 @@ paths:
sort:
aggregation: count
order: asc
+ type: measure
options:
timezone: GMT
page:
diff --git a/src/main/java/com/datadog/api/client/v2/model/RUMAggregateRequest.java b/src/main/java/com/datadog/api/client/v2/model/RUMAggregateRequest.java
index 2bf270bf202..fa41e56c40a 100644
--- a/src/main/java/com/datadog/api/client/v2/model/RUMAggregateRequest.java
+++ b/src/main/java/com/datadog/api/client/v2/model/RUMAggregateRequest.java
@@ -68,7 +68,9 @@ public RUMAggregateRequest addComputeItem(RUMCompute computeItem) {
}
/**
- * The list of metrics or timeseries to compute for the retrieved buckets.
+ * The list of metrics or timeseries to compute for the retrieved buckets. All rules must have the
+ * same type; mixing total and timeseries rules is
+ * rejected.
*
* @return compute
*/
diff --git a/src/main/java/com/datadog/api/client/v2/model/RUMAggregateSort.java b/src/main/java/com/datadog/api/client/v2/model/RUMAggregateSort.java
index 6a2b1b76227..4ca3bee9815 100644
--- a/src/main/java/com/datadog/api/client/v2/model/RUMAggregateSort.java
+++ b/src/main/java/com/datadog/api/client/v2/model/RUMAggregateSort.java
@@ -122,7 +122,8 @@ public RUMAggregateSort type(RUMAggregateSortType type) {
/**
* The type of sorting algorithm. alphabetical sorts buckets by the facet value.
- * measure sorts them by a computed aggregation.
+ * measure sorts them by a computed aggregation, and is required when the sort sets
+ * aggregation or metric.
*
* @return type
*/
diff --git a/src/main/java/com/datadog/api/client/v2/model/RUMAggregateSortType.java b/src/main/java/com/datadog/api/client/v2/model/RUMAggregateSortType.java
index a31deb38dce..f76a4c24251 100644
--- a/src/main/java/com/datadog/api/client/v2/model/RUMAggregateSortType.java
+++ b/src/main/java/com/datadog/api/client/v2/model/RUMAggregateSortType.java
@@ -20,7 +20,8 @@
/**
* The type of sorting algorithm. alphabetical sorts buckets by the facet value.
- * measure sorts them by a computed aggregation.
+ * measure sorts them by a computed aggregation, and is required when the sort sets
+ * aggregation or metric.
*/
@JsonSerialize(using = RUMAggregateSortType.RUMAggregateSortTypeSerializer.class)
public class RUMAggregateSortType extends ModelEnum {
diff --git a/src/test/resources/com/datadog/api/client/v2/api/rum.feature b/src/test/resources/com/datadog/api/client/v2/api/rum.feature
index cb0c222ced4..e2d0141d6e8 100644
--- a/src/test/resources/com/datadog/api/client/v2/api/rum.feature
+++ b/src/test/resources/com/datadog/api/client/v2/api/rum.feature
@@ -13,7 +13,7 @@ Feature: RUM
@generated @skip @team:ddoghq/rum-backend
Scenario: Aggregate RUM events returns "Bad Request" response
Given new "AggregateRUMEvents" request
- And body with value {"compute": [{"aggregation": "pc90", "interval": "5m", "metric": "@view.loading_time", "type": "total"}], "filter": {"from": "now-15m", "query": "@type:session AND @session.type:user", "to": "now"}, "group_by": [{"facet": "@view.name", "histogram": {"interval": 10, "max": 100, "min": 50}, "limit": 10, "sort": {"aggregation": "count", "order": "asc"}, "total": false}], "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}}
+ And body with value {"compute": [{"aggregation": "pc90", "interval": "5m", "metric": "@view.loading_time", "type": "total"}], "filter": {"from": "now-15m", "query": "@type:session AND @session.type:user", "to": "now"}, "group_by": [{"facet": "@view.name", "histogram": {"interval": 10, "max": 100, "min": 50}, "limit": 10, "sort": {"aggregation": "count", "order": "asc", "type": "measure"}, "total": false}], "options": {"timezone": "GMT"}, "page": {"cursor": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==", "limit": 25}}
When the request is sent
Then the response status is 400 Bad Request