Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eden Treaty ignores t.Transform() #662

Open
Guibi1 opened this issue May 30, 2024 · 0 comments
Open

Eden Treaty ignores t.Transform() #662

Guibi1 opened this issue May 30, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Guibi1
Copy link

Guibi1 commented May 30, 2024

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:

// 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 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

@Guibi1 Guibi1 added the bug Something isn't working label May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant