-
-
Notifications
You must be signed in to change notification settings - Fork 529
params always required #1778
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
Comments
I think the problem is here:
A couple problems:
If I change it to this:
It fixes it, but I'm not sure if that causes any regressions. |
I tracked this down to behavioral differences based on the type Parameters = {
query?: {
name?: string;
status?: string;
};
header?: never;
path: {
petId: number;
};
cookie?: never;
};
The problem is most noticeable in the case mentioned in the original issue, when no parameters are defined: type Parameters = {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
I think we could fix this by replacing type RequiredKeysOf<T> = {
[K in keyof T]: {} extends Pick<T, K> ? never : K;
}[keyof T]; |
The following snippet of code should be valid, as per the README:
However, it is failing with:
If I change it to:
the error goes away.
Is this a recent regression? I don't remember it doing this before. I'm using typescript
5.5.4
, openapi-fetch0.10.2
, and openapi-typscript7.1.0
.my
tsconfig.json
:Checklist
The text was updated successfully, but these errors were encountered: