require-constrained-schema-integer
Declare integer and lower-bound validation for numeric limit and version schema fields.
Why
A bare number schema accepts fractions and negative limits or versions. Encoding the domain in validation makes downstream arithmetic and pagination contracts explicit.
Fix
Use an integer schema with a positive lower bound for limit and a nonnegative lower bound for version, or reuse an existing named domain schema.
Examples
import { z } from "zod";const OptionsSchema = z.object({ limit: z.number() });import { z } from "zod";const OptionsSchema = z.object({ limit: z.number().int().positive(), version: z.int().nonnegative(),});