Overview
The list endpoints in src/search/search.controller.ts accept pagination parameters (page/limit/offset/cursor). Ensure a sane maximum page size is enforced and invalid values are rejected, so a client cannot request an unbounded number of rows (a memory/DoS and performance risk) or pass negative/non-numeric values.
Specifications
Features:
- Page size is clamped to a documented maximum.
- Invalid pagination values (negative, zero, non-numeric, over-max) are rejected with 400.
- A consistent default page size is applied when none is provided.
Tasks:
- Add/replace pagination inputs with a validated pagination DTO (class-validator:
@IsInt, @Min, @Max) under src/search/dto.
- Apply the DTO to the list handlers in
src/search/search.controller.ts and clamp/validate the limit.
- Document the default and maximum page size.
Impacted Files:
- src/search/search.controller.ts
- src/search/dto/ (pagination DTO)
Acceptance Criteria
- Requesting an oversized limit is either clamped or rejected with 400 — never served unbounded.
- Invalid pagination values return 400.
- A default page size applies when parameters are omitted.
Overview
The list endpoints in
src/search/search.controller.tsaccept pagination parameters (page/limit/offset/cursor). Ensure a sane maximum page size is enforced and invalid values are rejected, so a client cannot request an unbounded number of rows (a memory/DoS and performance risk) or pass negative/non-numeric values.Specifications
Features:
Tasks:
@IsInt,@Min,@Max) undersrc/search/dto.src/search/search.controller.tsand clamp/validate the limit.Impacted Files:
Acceptance Criteria