OpenAPI: using different Base URL than Specification URL

We have two environments currently, staging and production. In both of these environments we would like to make use of the same specification URL but the api calls should use a different base url.

So for example the specification file is located at:
https://server1/specification.json

For staging the api calls should go to https://server1 but for production we would like the to got https://server2.

We already change our OpenAPI specification file to contain two servers and we creating a new query resource of type OpenAPI we're now able to select a server. The problem now is that this setting is not saved depending on the selected environment.

When we change the server for staging it will also be changed to that same server for production. So at this point we get stuck in our approach to have two different server urls. Is there a way to set the server depending on the environment or is this a bug/missing feature? Can this be implemented?

Seems like this is the same issue like this thread:

1 Like

You're right. Any progress on this?

1 Like

"Moonwalk" (OpenAPI 4.0) is planning to separate deployment configuration and what's being called the "API shape" (the actual set of endpoints, parameters, request and responses, etc.) so that you can use the same shape with different deployments.

The OpenAPI team is looking at backporting as many Moonwalk ideas to 3.2+ as possible while still keeping 3.2, 3.3, etc. as actual minor releases so they can be supported more quickly than 3.1. For now, tools are kind of on their own to work around the spec limitations, but hopefully that will get better without needing to wait for 4.0.

Hi there!

If you have server variables set up, it should expose this field on the resource page. You could set the variables to be different for each environment: