Swashbuckle.aspnetcore: DocumentTitle is missing in SwaggerUIOptions

Created on 16 Jun 2017  路  12Comments  路  Source: domaindrivendev/Swashbuckle.AspNetCore

Hi,

I've got Swashbuckle.AspNetCore 1.0.0 nuget package installed in my Asp.Net Core project.
But when I try to add DocumentTitle() in UseSwaggerUI middleware it seems to be not there.

// Enable middleware to serve swagger-ui (HTML, JS, CSS etc.), specifying the Swagger JSON endpoint.
            app.UseSwaggerUI(c =>
            {
                c.DocumentTitle("Custom API - Swagger UI");
            });

However I noticed it's there in github repository: https://github.com/domaindrivendev/Swashbuckle.AspNetCore/blob/98f64b09032c2949e669c319b5cf09ff0f4e2340/test/WebSites/CustomUIConfig/Startup.cs

Am I missing something?

Thanks in advance.

Most helpful comment

Looks like it was merged in 98f64b09032c2949e669c319b5cf09ff0f4e2340 a little over a month ago, just not on nuget yet. Any ETA?

All 12 comments

I have same issue, can't access that method like it is not existing.

The property is missing fromt the SwaggerUIOptions class

Experiencing the same issue here.

Looks like it was merged in 98f64b09032c2949e669c319b5cf09ff0f4e2340 a little over a month ago, just not on nuget yet. Any ETA?

This is probably my #1 missing feature since I first encountered Swagger. Still waiting...

Any update on this issue??

seems the field is a fake one!

This does seem to be missing, seems like it should have or has been there considering the docs?

I have done this as a work around with javascript (updates doc title and sets favicon)

app.UseSwaggerUI(options =>
            {
                options.InjectOnCompleteJavaScript("/js/swagger.js");
            });
(function () {
    $(function () {
        // Update Document Title
        document.title = "Api Documentation";

        // Replace Icon
        var link = document.querySelector("link[rel*='icon']") || document.createElement("link");
        link.type = "image/x-icon";
        link.rel = "shortcut icon";
        link.href = "/favicon.ico";
        document.getElementsByTagName("head")[0].appendChild(link);
    });
})();

Should be resolved as of v1.1.0

InjectOnCompleteJavaScript option is also removed in the release of 2.3.0 AspNetCore release

Any work around on this?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jderus picture jderus  路  4Comments

brucewilkins picture brucewilkins  路  3Comments

NinoFloris picture NinoFloris  路  3Comments

TimmyGilissen picture TimmyGilissen  路  3Comments

vanillajonathan picture vanillajonathan  路  3Comments