RicoSuter/NSwag

ReDoc hides document title in browser

オープン

#2,796 opened on 2020/04/15

 (4 件のコメント) (0 件のリアクション) (0 人の担当者)C# (1,356 件のフォーク)batch import
help wantedtype: enhancement

Repository metrics

Stars
 (7,358 個のスター)
PR merge metrics
 (PR metrics pending)

説明

I set document.Title in ConfigureServices. But in browser page title (<title> tag) is "ReDoc"

public void ConfigureServices(IServiceCollection services)
{
    services.AddOpenApiDocument(document =>
    {
        document.DocumentName = "v1.2";
        document.Title = "VERSTA Open API";
        document.Version = "1.2";
        document.SchemaType = SchemaType.OpenApi3;
     });
}

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
    app.UseOpenApi(s =>
    {
        s.DocumentName = "v1.2";
        s.Path = "/openapi/v1/swagger.json";
     });

     app.UseReDoc(options =>
     {
        options.Path = "/docs";
        options.DocumentPath = "/openapi/v1/swagger.json";
        options.TransformToExternalPath = (internalUiRoute, request) =>
        {
             if (internalUiRoute.StartsWith("/") && internalUiRoute.StartsWith(request.PathBase) == false)
             {
                  return request.PathBase + internalUiRoute;
             }
                  return internalUiRoute;
         };
     });
}

image

Do I something wrong to set page title with ReDoc or is there a way to specify It?

コントリビューターガイド