-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Does not infer request property types from schema #167
Comments
same problem |
it's |
If you import it as |
Follow the instructions here: https://fastify.dev/docs/latest/Reference/Type-Providers/#type-definition-of-fastifyinstance--typeprovider, you need to add |
In my example, the type of |
Prerequisites
Fastify version
4.28.1
Plugin version
3.6.0
Node.js version
20.15.0
Typescript version
5.2.2 (also tested with 5.5.4)
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
archlinux in WSL
Description
I tried following Fastify documentation, but even when copy/pasting their example without any changes, the inferred type of
request.query
isunknown
.MRE:
Link to code that reproduces the bug
No response
Expected Behavior
request.query
should be correctly inferred to be of type{ foo: string, bar: string }
. Same problem withbody
,response
,headers
andparams
types.The text was updated successfully, but these errors were encountered: