Create any endpoint with body validation using a t.Transform:
// Server
const app = new Elysia().post(
"/",
({ body }) => {
// Here value has the type `string`, which is GOOD
console.log(body);
},
{
body: t.Object({
value: numToStr,
}),
},
);
// Client
treaty<App>("_url_").index.post({ value: 2023 }); // Here the value has the type `string`, which is BAD
What version of Elysia.JS is running?
1.0.22
What platform is your computer?
No response
What steps can reproduce the bug?
Create any endpoint with body validation using a t.Transform:
What is the expected behavior?
The Treaty should asks for a number.
What do you see instead?
The Treaty asks for a
string
.Additional information
No response