OpenAPI Resource with a custom base url

  • Goal:
    I want an OpenAPI resource with swagger definitions, but for a different/custom base url.

  • Steps:
    I have tried to find if I could have a swagger definition from a url, but have a custom base url for a particular environment, but can't find any way of doing this.

  • Details:
    We have usage of an API with two 'environments': 'uat' and 'production'.
    Unfortunately these api's are outside of our control; a third party's API.

Their UAT api has a full swagger definition that works perfectly with retool resources.
But their production api (same endpoints/params/everything) just doesn't publish a swagger definition/json unfortunately.

So I'm wondering can I somehow have the production env resource use the uat env's swagger definition, but with their production api base url?
Or if there's anyway I can manually paste in a production swagger json into retool, so that the production env of this resource works like the uat environment.
(To ideally avoid having to build every endpoint call with retool's raw REST resource)

I've downloaded the swagger.json, manually added in the absolute base url of the production environment into the swagger.json, and then uploaded it to a github repo, and enabled github pages, so that retool can access the swagger via that .json raw url, but still point to the correct base url that's set inside the swagger.

Works perfectly.

Feedback: It would have been ideal not to publicly host this swagger, and just upload it to the retool resource as a json file.