Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Remove does_not_contain support (#4564)

Karl-Aksel Puulmanne8d544c841cc
diff --git a/lib/plausible/stats/filters/query_parser.ex b/lib/plausible/stats/filters/query_parser.ex
index 87873a1dd0..a0878122bc 100644
--- a/lib/plausible/stats/filters/query_parser.ex
+++ b/lib/plausible/stats/filters/query_parser.ex
@@ -79,8 +79,6 @@ defmodule Plausible.Stats.Filters.QueryParser do
defp parse_operator(["matches_wildcard_not" | _rest]), do: {:ok, :matches_wildcard_not}
defp parse_operator(["contains" | _rest]), do: {:ok, :contains}
defp parse_operator(["contains_not" | _rest]), do: {:ok, :contains_not}
- # :TODO: Remove this once frontend support is gone
- defp parse_operator(["does_not_contain" | _rest]), do: {:ok, :contains_not}
defp parse_operator(["not" | _rest]), do: {:ok, :not}
defp parse_operator(["and" | _rest]), do: {:ok, :and}
defp parse_operator(["or" | _rest]), do: {:ok, :or}
diff --git a/lib/plausible/stats/json_schema.ex b/lib/plausible/stats/json_schema.ex
index 81297dc76d..64db0da90c 100644
--- a/lib/plausible/stats/json_schema.ex
+++ b/lib/plausible/stats/json_schema.ex
@@ -17,11 +17,11 @@ defmodule Plausible.Stats.JSONSchema do
@internal_query_schema @raw_public_schema
# Add overrides for things allowed in the internal API
|> JSONPointer.add!(
- "#/definitions/filter_entry/oneOf/0/items/0/oneOf/0/enum/0",
+ "#/definitions/filter_entry/oneOf/0/items/0/enum/0",
"matches_wildcard"
)
|> JSONPointer.add!(
- "#/definitions/filter_entry/oneOf/0/items/0/oneOf/0/enum/0",
+ "#/definitions/filter_entry/oneOf/0/items/0/enum/0",
"matches_wildcard_not"
)
|> JSONPointer.add!("#/definitions/metric/oneOf/0", %{
diff --git a/priv/json-schemas/query-api-schema.json b/priv/json-schemas/query-api-schema.json
index 61258f88ae..15f5114884 100644
--- a/priv/json-schemas/query-api-schema.json
+++ b/priv/json-schemas/query-api-schema.json
@@ -243,21 +243,12 @@
"type": "array",
"items": [
{
- "oneOf": [
- {
- "type": "string",
- "enum": [
- "is_not",
- "contains_not",
- "matches",
- "matches_not"
- ]
- },
- {
- "const": "does_not_contain",
- "deprecationMessage": "Legacy support, will be removed next week",
- "deprecated": true
- }
+ "type": "string",
+ "enum": [
+ "is_not",
+ "contains_not",
+ "matches",
+ "matches_not"
],
"description": "filter operation"
},