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 need, on a parameter in body, to add a type to it and validate to it.
import{t}from'elysia'typeObjType={prop1: string
...
}app.post('/',({ body })=>{// use body.query is of the ObjType type with optional properties},{body: t.Object({query: t.Object<Partial<ObjType>>({},{additionalProperties: true/* Allow all properties of ObjType as optional */})})})
With TypeScript v5.5.4 (VSCode typecheck), I get:
Type instantiation is excessively deep and possibly infinite.ts(2589)(parameter) body: { query: { [x: string]: any; };}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I need, on a parameter in body, to add a type to it and validate to it.
With TypeScript v5.5.4 (VSCode typecheck), I get:
Beta Was this translation helpful? Give feedback.
All reactions