All problems

Audit Log Query Replaces Explicit Zero Limit with Default

Level 2 · node · API · Explicit zero limit overwritten by default

Scenario

An internal audit API supports limit=0 for metadata-only requests. However, its service substitutes the default page size of 20 for an explicitly provided zero, returning audit rows. Trace the controller-facing service and repository contract to distinguish omitted limits from explicit zero.

Requirements

An omitted limit defaults to 20. Explicit zero returns no rows. Negative, greater-than-50, and noninteger limits return HTTP 400. Valid limits reach the repository unchanged.

Acceptance criteria

  • An omitted limit returns the default twenty rows
  • An explicit zero limit returns an empty list
  • A negative limit returns HTTP 400
  • A limit above fifty returns HTTP 400
  • A string limit returns HTTP 400