-
-
Notifications
You must be signed in to change notification settings - Fork 265
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
Normalize doesn't seem to do anything with aot: false
#1020
Comments
If we import We can manually clean the response and things work as expected.
|
Another incredibly strange datapoint.... I have this route handler in the same Elysia instance as the above example (though the real code was swapped out for the foo/bar example) .get(
'',
async ({ query, recipeService }) => {
const search = query.search;
const recipes = await recipeService.getRecipes({
searchQuery: search,
filter: { idIn: query.idSearch ? query.idIn ?? [] : undefined },
});
return recipes;
},
{
response: RecipeListDTO,
query: t.Optional(
t.Object({
search: t.Optional(t.String()),
idSearch: t.Optional(t.Boolean()),
idIn: t.Optional(t.Array(t.String())),
}),
),
},
) In this code, I don't get a validation error on recipes (even though it's returning way more data than the DTO is asking for) and it also isn't normalized... literally nothing happens. And this is in the same instance as I get a validation error on my too-big object... |
This behavior is prevalent on the html plugin too where the |
Additionally I just realized that it's breaking automatic parsing of array string parameters: query: t.Optional(
t.Object({
idIn: t.Optional(t.Array(t.String())),
}),
),
This was working fine before i switched to aot: false/serverless |
I'm curious if there's any plans to address issues like that seem to affect |
What version of Elysia is running?
1.2.10
What steps can reproduce the bug?
In a cloudflare worker environment with
aot: false
, the default behavior of normalizing responses seems to be broken.For:
We get:
The text was updated successfully, but these errors were encountered: