title: How to expose different swagger APIs (on different ports) on same local server
body: <p>I have a project made by four different microservices. Each service is implemented using SpringBoot  and documented with SpringDoc (Open Api Swagger 3). I can happly reach all APIs documentation by opening different URLs, such as:</p>
  <p><code>http://localhost:8080/swagger-ui/index.html</code></p>
  <p><code>http://localhost:8081/swagger-ui/index.html</code></p>
  <p><code>http://localhost:8082/swagger-ui/index.html</code></p>
  <p>etc...</p>
  <p>Assuming that all microservices are running on the same host, I'd like to have the &quot;servers&quot; drop-down menu allowing to switch between the URLs. I tried something like this (for just 2 components):</p>
  <pre><code>public OpenAPI initOpenAPI() {
      
      OpenAPI defaultOpenAPI = new OpenAPI();
      
      defaultOpenAPI.info(new Info()
                      .title(&quot;My repository&quot;)
                      .description(&quot;Repository APIs to store my data&quot;)
                      .version(&quot;v1.0.0&quot;)
  
      Server server_1 = new Server();
      server_1.setDescription(&quot;Component 1&quot;);
      server_1.setUrl(&quot;http://localhost:8080/swagger-ui/index.html&quot;);
  
      Server server_2 = new Server();
      server_1.setDescription(&quot;Component 2&quot;);
      server_2.setUrl(&quot;http://localhost:8081/spider/swagger-ui/index.html&quot;);
      
      defaultOpenAPI.setServers(Arrays.asList(server_1, server_2));
  
      return defaultOpenAPI;
  }
  </code></pre>
  <p>And indeed I have all URL in the &quot;servers&quot; drop-down, but when I click on them nothing happens.
  How can allow to switch from one URL to another by choosing the target URL in the &quot;servers&quot; combo-box?</p>