Open bertspaan opened 1 month ago
1.1.19
Darwin 23.5.0 arm64 arm
Create an Elysia instance with a route that contains multiple optional params (separated by a @ and . character, not by a /), validation of params fails:
@
.
/
params
import { Elysia, t } from 'elysia' new Elysia() .get( '/images/:imageId@:version?.:ext?', ({ params }) => { return { params } }, { params: t.Object({ imageId: t.String(), version: t.Optional(t.String()), ext: t.Optional(t.String()) }) } ) .listen(3000)
A params object of the following form:
t.Object({ imageId: t.String(), version: t.Optional(t.String()), ext: t.Optional(t.String()) })
A TypeBox error:
{ "type": "validation", "on": "params", "summary": "Property 'imageId' is missing", ... }
No response
node_modules
bun.lockb
Yes!
What version of Elysia is running?
1.1.19
What platform is your computer?
Darwin 23.5.0 arm64 arm
What steps can reproduce the bug?
Create an Elysia instance with a route that contains multiple optional params (separated by a
@
and.
character, not by a/
), validation ofparams
fails:What is the expected behavior?
A
params
object of the following form:What do you see instead?
A TypeBox error:
Additional information
No response
Have you try removing the
node_modules
andbun.lockb
and try again yet?Yes!