Skip to content

Validate Analytics Range Parameter and Return 400 for Unsupported Values #858

Description

@jikrana1

Description

Problem

The getTrends endpoint silently falls back to the default daily range whenever an unsupported range value is provided.

This behavior hides client-side mistakes and makes debugging more difficult because invalid requests still return successful responses.

Proposed Solution

  • Validate the range query parameter.
  • Accept only daily, weekly, and monthly.
  • Return HTTP 400 Bad Request for unsupported values.
  • Include a clear validation message listing the supported range values.
  • Remove the silent fallback behavior.

Benefits

  • Improves API validation.
  • Makes debugging easier.
  • Prevents unintended analytics results.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions