diff --git a/web/api/v1/api.go b/web/api/v1/api.go index c114b62fe..bcc6c2993 100644 --- a/web/api/v1/api.go +++ b/web/api/v1/api.go @@ -1589,12 +1589,12 @@ func parseListRulesPaginationRequest(r *http.Request) (*listRulesPaginationReque err error ) - if r.URL.Query().Get("max_rule_groups") != "" { - maxRuleGroups, err = strconv.ParseInt(r.URL.Query().Get("max_rule_groups"), 10, 32) + if r.URL.Query().Get("max_groups") != "" { + maxRuleGroups, err = strconv.ParseInt(r.URL.Query().Get("max_groups"), 10, 32) if err != nil || maxRuleGroups < 0 { return nil, &parsePaginationError{ - err: fmt.Errorf("max_rule_groups need to be a valid number greater than or equal to 0: %w", err), - parameter: "max_rule_groups", + err: fmt.Errorf("max_groups need to be a valid number greater than or equal to 0: %w", err), + parameter: "max_groups", } } } diff --git a/web/api/v1/api_test.go b/web/api/v1/api_test.go index 95a0edacc..b2b72b007 100644 --- a/web/api/v1/api_test.go +++ b/web/api/v1/api_test.go @@ -2744,7 +2744,7 @@ func testEndpoints(t *testing.T, api *API, tr *testTargetRetriever, es storage.E { endpoint: api.rules, query: url.Values{ - "max_rule_groups": []string{"1"}, + "max_groups": []string{"1"}, }, response: &RuleDiscovery{ NextToken: getRuleGroupNextToken("/path/to/file", "grp2"), @@ -2840,8 +2840,8 @@ func testEndpoints(t *testing.T, api *API, tr *testTargetRetriever, es storage.E { endpoint: api.rules, query: url.Values{ - "max_rule_groups": []string{"1"}, - "next_token": []string{getRuleGroupNextToken("/path/to/file", "grp2")}, + "max_groups": []string{"1"}, + "next_token": []string{getRuleGroupNextToken("/path/to/file", "grp2")}, }, response: &RuleDiscovery{ RuleGroups: []*RuleGroup{