Swashbuckle.aspnetcore: UseSwaggerUi configuration overload not available

Created on 3 Oct 2016  路  5Comments  路  Source: domaindrivendev/Swashbuckle.AspNetCore

Hi,

I'm using 6.0.0-beta902 with net452. The UseSwaggerUi extension method does not accept any configuration.

In my project.json i have the following package: "Swashbuckle": "6.0.0-beta902",

When i try this, it fails as the extension method is missing:

app.UseSwaggerUi(c =>
{
c.SwaggerEndpoint("/swagger/v1/swagger.json", "V1 Docs");
c.EnabledValidator();
c.BooleanValues(new object[] { 0, 1 });
c.DocExpansion("full");
c.SupportedSubmitMethods(new[] { "get", "post", "put", "patch" });
c.InjectOnCompleteJavaScript("/ext/custom-script.js");
c.InjectStylesheet("/ext/custom-stylesheet.css");
});

This is the extension only method, that is available:

public static class SwaggerUiBuilderExtensions
{
public static IApplicationBuilder UseSwaggerUi(this IApplicationBuilder app, string baseRoute = "swagger/ui", string swaggerUrl = "/swagger/v1/swagger.json");
}

What am i missing?

Most helpful comment

I had the same issue but spotted it at the bottom of the readme on the main repository. That code is only in the preview versions on the authors MyGet repository that he provides. The Standard Nuget repository does not have the preview version that match the code. It would be good to see the preview versions making their way to standard nuget more often or 2 copies of the samples as i wasted a day before i worked it out as well

All 5 comments

Update:
I've clones the sources and added Swashbucke, Swashbuckle.Swagger, Swashbuckle.SwaggerGen and Swashbuckle.SwaggerUi as project references.

Looks like it's enough to add "net452": {}, to the frameworks section in project json of each project.

any update on this?

I had the same issue but spotted it at the bottom of the readme on the main repository. That code is only in the preview versions on the authors MyGet repository that he provides. The Standard Nuget repository does not have the preview version that match the code. It would be good to see the preview versions making their way to standard nuget more often or 2 copies of the samples as i wasted a day before i worked it out as well

Any ETA for a updated nuget package ?

Available with latest pre-release. Note the package rename to "Swashbuckle.AspNetCore.1.0.0-rc1"

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JoelAdamWeiss picture JoelAdamWeiss  路  4Comments

voroninp picture voroninp  路  3Comments

voroninp picture voroninp  路  3Comments

engelhardtda picture engelhardtda  路  3Comments

TimmyGilissen picture TimmyGilissen  路  3Comments