Leverage MultipleApiVersions in Swagger with attribute versioning
.EnableSwagger(c => c.MultipleApiVersions(
(apiDesc, version) =>
{
var path = apiDesc.RelativePath.Split('/');
var pathVersion = path[1];
return CultureInfo.InvariantCulture.CompareInfo.IndexOf(pathVersion, version, CompareOptions.IgnoreCase) >= 0;
},
vc =>
{
vc.Version("v2", "Swashbuckle Dummy API V2"); //add this line when v2 is released
// ReSharper disable once ConvertToLambdaExpression
vc.Version("v1", "Swashbuckle Dummy API V1");
}
))