You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an endpoint. I use normalization and accept a schema of
t.Object({id: t.String()})
I can send along this body:
{id: "123",name: "elysia"}
and it will work just fine since the name field will just be filtered out by normalization. Now imagine I do this with an array of thousands of entries. I send along more data than needed since the name will be stripped away anyways.
I had this which resulted in a 413 HTTP status.
It would be SO cool if the client would already strip away fields not matching the body schema. E.g. know about the schema and run a typebox Type.Clean() on the values. Currently, I don't think this is possible since the client is only instatiated with a generic TS type derived from the api elysia instance. But maybe if we would instantiate the client with a full instance, the client could read the schema of each endpoint and run a clean on the bodies? Is this practical/possible at all?
The text was updated successfully, but these errors were encountered:
Imagine following scenario:
I have an endpoint. I use normalization and accept a schema of
I can send along this body:
and it will work just fine since the name field will just be filtered out by normalization. Now imagine I do this with an array of thousands of entries. I send along more data than needed since the name will be stripped away anyways.
I had this which resulted in a 413 HTTP status.
It would be SO cool if the client would already strip away fields not matching the body schema. E.g. know about the schema and run a typebox
Type.Clean()
on the values. Currently, I don't think this is possible since the client is only instatiated with a generic TS type derived from the api elysia instance. But maybe if we would instantiate the client with a full instance, the client could read the schema of each endpoint and run a clean on the bodies? Is this practical/possible at all?The text was updated successfully, but these errors were encountered: