-
-
Notifications
You must be signed in to change notification settings - Fork 408
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
Query param type safety only works for the first param. #1525
Comments
With further investigating, this issue was introduced in the 0.9.0next. Which I downloaded for the middleware, will post under that thread |
This seems to exist in |
So I think this may have something to do with how TypeScript’s To be honest I’m not sure how to easily fix this—only allow the explicit |
Hey @drwpow, So it seems like there's two issues here. One is that the params can have arbitrary keys outside of the specified ones. I found that TypeScript 5.4 will be adding a new intrinsic type called The other issue is that once you add one optional parameter to the request, the rest of the optional parameters do not show up in autocomplete. This issue seems specific to version ^0.9.0 of openapi-fetch. I can look into that and make a PR if I find anything. Edit: |
I confirm I have both problems 🥲 I also tested in both 8 and 9, and the problem is present. |
Description
When supplying multiple query params. it seems that when entering the first one correct it turns in to some sort of "Any" type. Allowing for any type of param and no autocomplete either.
First one autocompletes fine.
the second one does not allow for auto complete and does not throw a type error.
this is the object that it expects
Reproduction
Have an endpoint that expects multiple query params and try to fill in more then 1 in the options payload.
Expected result
Type safety when typing multiple
Checklist
The text was updated successfully, but these errors were encountered: