Closed crishoj closed 1 week ago
In https://github.com/crishoj/elysia/commit/9cc09ed5a4bd1b218daf4bf98891b0725cf4f941 I used describe.each()
to run tests/validator/*
with and without aot
.
With { aot: false }
a number of validator tests fail, including these:
✗ Params Validator > create default number params [0.50ms]
Expected: "number"
Received: "string"
✗ Params Validator > coerce number object to numeric [0.17ms]
Expected: "boolean"
Received: "string"
@SaltyAom if you can point me to where type coercion without aot
takes place, I'd be happy to look into this issue.
What version of Elysia.JS is running?
1.1.3
What platform is your computer?
Darwin 23.5.0 arm64 arm
What steps can reproduce the bug?
What is the expected behavior?
I expect the param
id
to be cast tonumber
(according to the schema) regardless ofaot
.What do you see instead?
When
aot
is off, theid
param is passed to the handler asstring
, not asnumber
.Additional information
No response