-
Notifications
You must be signed in to change notification settings - Fork 13
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
Can't get the baseUrl from a scheme if using custom baseQuery #85
Comments
You'll have to do that by hand. Take a look here: reduxjs/redux-toolkit#1680 |
So if I understand you correctly, with release 1.0 I would create something like this: baseQuery.ts
pets.api.ts
and then the code generation makes a file that extends the api above with the endpoints from the swagger? curl -o petstore.json https://petstore3.swagger.io/api/v3/openapi.json and then I would do:
|
Essentially, but you have a config file now, which allows for much more configuration (including multi-file output etc). |
Awesome, this looks really promising! Looking forward to the release. I'll close this issue now |
I was digging around this looking into autogenerating our api client and typescript models for the FE from our swagger files and found this tool which looks awesome btw but I did get stuck on one thing. The thing is I want to make the generated api client get the accessToken for the user and add it to the header, I tried using a custom baseQuery but it doesn't seem to work.
Here's a code example:
baseQuery.ts
So based on this I would expect the output to be similar to what happens when you don't use a custom base query where you get this:
But what I actually get is this:
petstore-api.generated.ts output
Soo, any hints on how to get the baseUrl from our swagger file when using custom baseQuery?
The text was updated successfully, but these errors were encountered: