Allow overriding URL for staging OpenAPI resources

Hi @Tess,
I stumbled on this thread while looking for a solution for a similar problem as the OP. I'm also using an OpenAPI resource in retool which fetches an OpenAPI 3.0.0 spec which also includes more than one server endpoint:
{ ... "servers": [{ "url": "/some/path" }, { "url": "/another/path" }], ...}

However, I do not see the server variables section you've mentioned. Could you please elaborate how this feature works exactly?

Edit: I think you were referring to OpenAPI server variables here instead so I updated the OpenAPI spec accordingly. Now I'm receiving an error when using the following:

"servers": [
    {
      "url": "https://foo.bar/{baz}",
      "description": "Lorem ipsum",
      "variables": {
        "baz": {
          "enum": ["foo", "bar", "baz"],
          "default": "foo"
        }
      }
    }
  ],

Edit2: After applying this new resource in an app within Retool it's actually working and the server variable section is shown within the app's resource section. Thus, (more or less) everything is working as expected. Thanks!
It's worth noting though, that the server variable section was only visible for newly created resources - it was not visible for existing resources which point to the updated OpenAPI spec file. This might be a pitfall for someone else as well.

1 Like