Swashbuckle/Swagger not picking up routes from config
<p>I am using Swashbuckle (a .NET wrapper around swagger).</p>

<p>When I am generating my swagger documentation, it generates the URIs in the documentation from the controller names/parameters instead of the defined routes as they are defined in config at application startup.</p>

<p>So I have a controller:</p>

<pre><code>namespace Pat.PostingService.Api.Version1
{
    public class DeliveryStatusController : ApiController
    {
         [ResponseType(typeof(DeliveryStatusDto))]
         public dynamic Get(string deliveryType, Guid? orderId = null)
         {
             ...
         }
    }
{
</code></pre>

<p>and in the RouteConfig.cs file, I redefine the route:</p>

<pre><code>public void Configuration(IAppBuilder appBuilder)
{
    var config = new HttpConfiguration();

    ...

    config.Routes.MapHttpRoute(
         name: "DeliveryStatusService",
         routeTemplate: "SpecialDeliveryServiceStatus/{deliveryType}/{orderId}",
         defaults: new {
             controller = "DeliveryStatus",
             orderId = RouteParameter.Optional
         }
    );

    config.Routes.MapHttpRoute(
         name: "Default",
         routeTemplate: "{controller}/{id}",
         defaults: new { id = RouteParameter.Optional }
    );
}
</code></pre>

<p>When calling the API, I now cannot use the <code>/DeliveryStatus</code> endpoint, I must use the <code>/SpecialDeliveryServiceStatus</code> endpoint.</p>

<p>HOWEVER, the Swagger documentation states that the endpoint is <code>/DeliveryStatus</code>.</p>

<p>Together with my colleagues, we believe that <code>_apiExplorer.ApiDescriptions</code> (from System.Web.Http.Description.IApiExplorer used by SwaggerGenerator.cs in Swashbuckle.Core) is returning us the incorrect routes, although we may be wrong.</p>

<p>What have we missed? Is there something that we can use to ensure Swagger uses the routes used in config and not the default routes?</p>

<hr>

<p>edit:</p>

<p>We are also using SDammann for versioning (imagine a second RouteConfig.cs file in a version2 folder), which does not support [AttributeRouting], hence our need for the route to be picked up from the startup route config.</p>

<hr>

<p>edit 2:</p>

<p>Putting <code>action = "Get"</code> into the defaults for the routes doesn't solve the problem either.</p>