diff --git a/CHANGELOG.md b/CHANGELOG.md index 08621734f925..ff06539c24ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ All notable changes to this project will be documented in this file. ### Fixed +- Validate empty filter clauses list in Stats API v2 - Fixed Stats API timeseries returning time buckets falling outside the queried range - Fixed issue with all non-interactive events being counted as interactive - Fixed countries map countries staying highlighted on Chrome diff --git a/assets/js/types/query-api.d.ts b/assets/js/types/query-api.d.ts index 3dce7f674337..a6607a9fca09 100644 --- a/assets/js/types/query-api.d.ts +++ b/assets/js/types/query-api.d.ts @@ -90,7 +90,10 @@ export type FilterWithoutGoals = * filter operation */ export type FilterOperationWithoutGoals = "is_not" | "contains_not"; -export type Clauses = (string | number)[]; +/** + * @minItems 1 + */ +export type Clauses = [string | number, ...(string | number)[]]; /** * @minItems 3 * @maxItems 4 diff --git a/priv/json-schemas/query-api-schema.json b/priv/json-schemas/query-api-schema.json index 99a50baddeae..1f692ef8682e 100644 --- a/priv/json-schemas/query-api-schema.json +++ b/priv/json-schemas/query-api-schema.json @@ -316,6 +316,7 @@ }, "clauses": { "type": "array", + "minItems": 1, "items": { "type": ["string", "integer"] }