Reputation: 985
Multiple versioning was working with Swashbuckle.AspNetCore 4.0.1 but not working in 5.0.0rc.
Now only api-limited-docs
working 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");
});
Upvotes: 1
Views: 194
Reputation: 985
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});
});
Upvotes: 1