title: How can I make url path in Swashbuckle/Swaggerwork when api is served from inside another project?
body: <p>all. I am trying to document a WebApi 2 using Swashbuckle package. </p>
  
  <p>All works great if the API is running by itself i.e. <em>localhost/api/swagger</em> brings me to ui and <em>localhost/api/swagger/docs/v1</em> to json.</p>
  
  <p>However the producation app initializes this same Webapi project by running webapiconfig method of this project from global.asax.cs in another - now web project (the main application one). So the api url looks like <em>localhost/web/api</em> instead of localhost/api.</p>
  
  <p>Now swashbuckle doesn't work like that at all.</p>
  
  <ul>
  <li>localhost/api/swagger generates error cannot load
  'API.WebApiApplication', well of course </li>
  <li>localhost/web/swagger = 404</li>
  <li>localhost/web/api/swagger = 404</li>
  </ul>
  
  <p>I tried to look everywhere, but all I found is workaround.</p>
  
  <pre><code>c.RootUrl(req =&gt; req.RequestUri.GetLeftPart(UriPartial.Authority) + VirtualPathUtility.ToAbsolute("~/").TrimEnd('/'));
  </code></pre>
  
  <p>Unfortunately it doesn't work, now maybe it should and I just need to change something but I don't even know what exactly this property expects and what it should be set to.</p>
  
  <p>May be it's not even applicable - maybe setup we have requires something else or some swashbuckle code changes. </p>
  
  <p>I will appreciate any help you can provide. I really starting to like swagger (and swashbuckle) for rest documentation.</p>