-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Inferred type is always never
#93
Comments
When I define the schema without the const dogSchema = {
type: "object",
properties: {
name: { type: "string" },
age: { type: "integer" },
hobbies: { type: "array", items: { type: "string" } },
favoriteFood: { enum: ["pizza", "taco", "fries"] },
},
// required: ["name", "age"],
} as const; then I will get a type with all type Dog = {
[x: string]: unknown;
name?: undefined;
age?: undefined;
hobbies?: [] | undefined;
favoriteFood?: undefined;
} |
I found the problem. I had
for some reason in my After removing this, everything works like expected. |
Thanks @alphaone ! Will add it to the README ! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey,
I am trying the example for the README and I get
never
as the resulting type :\I am using Typescript
4.8
on MacOS12.6
and this is mypackage.json
:Any idea, what I am doing wrong?
The text was updated successfully, but these errors were encountered: