title: How to customize Swagger endpoint url?
body: <p>I have multiple web api projects (microservices), and I want to expose them using only one <em>swagger-ui</em> link.
  I'll call each web api project <strong>EndpointA</strong> and <strong>EndpointB</strong> for the sake of this post.</p>
  
  <p>I've created a <em>swagger-ui</em> project, and I've added each endpoint to this project.</p>
  
  <p>My <em>swagger-ui</em> project <code>Startup.cs</code></p>
  
  <pre><code>public void Configure(IApplicationBuilder app, IHostingEnvironment env)
  {
      app.UseSwaggerUI(c =&gt; {
          c.SwaggerEndpoint("/EndpointA/swagger/v1/swagger.json", "EndpointA");
          c.SwaggerEndpoint("/EndpointB/swagger/v1/swagger.json", "EndpointB");
      });
  }
  </code></pre>
  
  <p>My endpoints A/B <code>Startup.cs</code></p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
  {
      services.AddSwaggerGen(c =&gt;
      {
          c.SwaggerDoc("v1", new Info
          {
              Version = "v1",
              Title = "EndpointA", // or "EndpointB",
          });
      });
  }
  </code></pre>
  
  <hr>
  
  <p>My problem is that each of the <code>swagger.json</code> files doesn't contains the endpoint prefix. Instead of being <code>/EndpointA/Controller/Action</code>, the paths are <code>/Controller/Action</code>, which are not valid.</p>
  
  <hr>
  
  <p>I have tried to set a custom url prefix in my swagger ui project like this <code>c.RoutePrefix = "EndpointA";</code>. It works for my <em>EndpointA</em>, but I can only set one for all endpoints so <em>EndpointB</em> won't works.</p>
  
  <p>I also tried to set a prefix directly in each endpoint using <code>SwaggerGen</code>, but I don't know how / if it's possible.</p>