[英]Multiple versioning URL not working in Swashbuckle.AspNetCore 5.0.0rc
Multiple versioning was working with Swashbuckle.AspNetCore 4.0.1 but not working in 5.0.0rc.多版本控制适用于 Swashbuckle.AspNetCore 4.0.1,但不适用于 5.0.0rc。 Now only
api-limited-docs
working URL .现在只有
api-limited-docs
工作 URL 。 Other url not generating.其他网址未生成。
Following old code.遵循旧代码。
app.UseSwaggerUI(options =>
{
options.RoutePrefix = "api-docs";
string swaggerJsonBasePath = string.IsNullOrWhiteSpace(options.RoutePrefix) ? "." : "..";
options.SwaggerEndpoint($"{swaggerJsonBasePath}/swagger/swagger.json", "v1");
});
app.UseSwaggerUI(options =>
{
options.RoutePrefix = "api-limited-docs";
string swaggerJsonBasePath = string.IsNullOrWhiteSpace(options.RoutePrefix) ? "." : "..";
options.SwaggerEndpoint($"{swaggerJsonBasePath}/swagger/limitted/swagger.json", "v1");
});
Yes for the latest version it is available.是的,最新版本可用。 Here is the change.
这是变化。
services.AddSwaggerGen(c =>
{
c.EnableAnnotations();
c.SwaggerDoc("api", new OpenApiInfo { Title = "API - Title", Version = AppClientVersion.LatestVersion});
c.SwaggerDoc("limited", new OpenApiInfo { Title = "limited- Title", Version = AppClientVersion.LatestVersion});
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.