-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
TypeScript only evaluating to any
when using @fastify/type-provider-json-schema-to-ts
#12
Comments
@RafaelGSS Just tested this on the TypeScript playground and the type resolution appears to be working ok (TS 4.7.4) @rmehner Just have a quick check that your |
Hey, I am getting the same error as @rmehner . I can see how the linked playground example works, but when I copy the code into my project, it stops to infer the type from the schema. Even if I use the example from the ReadMe I get type
I am using:
|
Just for later reference, I found my problem. I had a wrong setting in my Removing the setting lets the type inferring from json-schema work like a charm 👌 |
Hi there,
migrating to fastify v4 I was very excited for better TS support on JSON schemas. So I went ahead and tried the example provided on the docs site: https://www.fastify.io/docs/latest/Reference/Type-Providers/#json-schema-to-ts
However, if I do that,
foo
andbar
will always be of typeany
. Am I holding it wrong? I was expecting the types to benumber
andstring
respectively.Thank you for your help already!
Your Environment
The text was updated successfully, but these errors were encountered: