-
-
Notifications
You must be signed in to change notification settings - Fork 639
Openapi-fetch with promise-like interface #1226
Copy link
Copy link
Closed
Labels
PRs welcomePRs are welcome to solve this issue!PRs are welcome to solve this issue!enhancementNew feature or requestNew feature or requestopenapi-fetchRelevant to the openapi-fetch libraryRelevant to the openapi-fetch libraryquestionFurther information is requestedFurther information is requested
Metadata
Metadata
Assignees
Labels
PRs welcomePRs are welcome to solve this issue!PRs are welcome to solve this issue!enhancementNew feature or requestNew feature or requestopenapi-fetchRelevant to the openapi-fetch libraryRelevant to the openapi-fetch libraryquestionFurther information is requestedFurther information is requested
Description
When calling REST client functions, I expect to get Resolved with data when it was a success, and Reject with an error in case of failure.
Proposal
I'm trying to wrap for openapi-fetch like this:
But I can't get the types right. Apparently
url: Parameters<typeof put>[0], init: Parameters<typeof put>[1]does not do the trick and wrong operations are getting picked from the generated ts file.Any suggestions?