Problem
In src/v2/task/ZodBuilder.mjs (or the CLI equivalent src/task/ZodBuilder.mjs), the default() option handler always stores the value as a string, even when the primitive type is number().
Example: A parameter defined as z: { primitive: 'number()', options: 'default(100)' } will produce a Zod schema with z.number().default("100") instead of z.number().default(100).
Impact
Any schema with a numeric parameter that has a default value sends the wrong type to the API. This affects common parameters like:
limit (default 10, 25, 100, etc.)
page (default 1)
offset (default 0)
startblock / endblock (default 0)
Expected Behavior
The default case in #insertOption() should check the primitive type:
number() → parse value with Number() or parseInt()/parseFloat()
boolean() → parse value as value === 'true'
string() → keep as string (current behavior)
Reproduction
// Schema definition
z: { primitive: 'number()', options: 'default(100)' }
// Current: z.number().default("100") ← wrong type
// Expected: z.number().default(100) ← correct type
Priority
P0 — Affects all schemas with numeric defaults.
Problem
In
src/v2/task/ZodBuilder.mjs(or the CLI equivalentsrc/task/ZodBuilder.mjs), thedefault()option handler always stores the value as a string, even when the primitive type isnumber().Example: A parameter defined as
z: { primitive: 'number()', options: 'default(100)' }will produce a Zod schema withz.number().default("100")instead ofz.number().default(100).Impact
Any schema with a numeric parameter that has a default value sends the wrong type to the API. This affects common parameters like:
limit(default 10, 25, 100, etc.)page(default 1)offset(default 0)startblock/endblock(default 0)Expected Behavior
The
defaultcase in#insertOption()should check the primitive type:number()→ parse value withNumber()orparseInt()/parseFloat()boolean()→ parse value asvalue === 'true'string()→ keep as string (current behavior)Reproduction
Priority
P0 — Affects all schemas with numeric defaults.