2016-10-04 140 views

回答

2

要做到這樣,你可以更新swaggerconfig文件,如下所示:

.EnableSwagger("{apiVersion}/swagger", c => 
     { 
      c.MultipleApiVersions(
       (apiDesc, targetApiVersion) => ResolveVersionSupportByRouteConstraint(apiDesc, targetApiVersion), 
       (vc) => 
       { 
        vc.Version("v2", "Swashbuckle Dummy API V2"); 
        vc.Version("v1", "Swashbuckle Dummy API V1"); 
       }); 
     }); 
+0

真棒感謝。是否有一個{apiVersion}可用於替換的已知令牌?還有什麼其他的代幣.. docs? – Mike

+0

我想你可以參考他們的文檔 - https://github.com/domaindrivendev/Swashbuckle#custom-routes –