From 26b220470acdf03217305eb2230211adfc83ecfa Mon Sep 17 00:00:00 2001 From: Maurice Date: Wed, 18 Nov 2026 13:24:09 +0100 Subject: [PATCH] fix(shared): parse an id param's digits with Number before the integer check The union of an integer and a digit string fed z.coerce.number() through pipe(), which Zod 4 types with an unknown input and tsc refuses. The digits are now turned into a number with Number and checked by z.number().int().positive(), the same rule as before. --- shared/src/common/primitives.schema.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shared/src/common/primitives.schema.ts b/shared/src/common/primitives.schema.ts index b564c31ba..313488683 100644 --- a/shared/src/common/primitives.schema.ts +++ b/shared/src/common/primitives.schema.ts @@ -18,7 +18,8 @@ export type Id = z.infer; */ export const idParamSchema = z .union([z.number().int(), z.string().regex(/^\d+$/)]) - .pipe(z.coerce.number().int().positive()); + .transform(Number) + .pipe(z.number().int().positive()); /** * A row id written as text: decimal digits naming a safe integer, kept as the