openapi-typescript
openapi-typescript copied to clipboard
Set baseUrl per request
Description
My app has an API that is per tenant, so I end up having to create a client every time I need to call the API, since the baseUrl varies.
Proposal
Ideally it would be as simple as:
client.GET("/api/region", {
baseUrl: "https://api.example.com",
})
Checklist
- [x] I’m willing to open a PR for this (see CONTRIBUTING.md)
I also need this for the same reason. It would also be nice to be able to set a baseUrl getter per client that would read the baseUrl from an external store on request or be able to set the baseUrl through a middleware.
This is an easy add and wouldn’t disrupt anything. Would welcome a PR for this 🙂
@Gruak I forgot about this, thanks for making that change! @drwpow can we get a release with the change soon?
Thank you for adding this feature. I was wondering if there are any plans to release it soon.
Thank you for adding this feature. I was wondering if there are any plans to release it soon.
Please see the CHANGELOG. This has already been released!