Q:

Incorrect link in Swagger

I am using the ASP.NET Core 2.0 with Swashbuckle.AspNetCore (2.4.0)  
in Startup ConfigureServices
services.AddSwaggerGen(c =>
        {
            c.OperationFilter<AuthorizationHeaderParameterOperationFilter>();
         c.SwaggerDoc("v1", new Info
            {
                Version = "v1",
                Title = "Library API",
                Description = "ASP.NET Core Web API",
                TermsOfService = "None",
                Contact = new Contact
                {
                    Name = "my name",
                    Email = "myname@mywebsite"
                }
            });
        });
      });

in Startup configure
          app.UseSwagger(c =>
        {
            c.RouteTemplate =
                "api-docs/{documentName}/swagger.json";
        });
        app.UseSwaggerUI(c =>
        {
            c.RoutePrefix = "api-docs";
            c.SwaggerEndpoint("v1/swagger.json", "Api v1");
        });

 public class AuthorizationHeaderParameterOperationFilter : IOperationFilter
    {
        public void Apply(Operation operation, OperationFilterContext context)
        {
            var filterPipeline = context.ApiDescription.ActionDescriptor.FilterDescriptors;
            var isAuthorized = filterPipeline.Select(filterInfo => filterInfo.Filter).Any(filter => filter is AuthorizeFilter);
            var allowAnonymous = filterPipeline.Select(filterInfo => filterInfo.Filter).Any(filter => filter is IAllowAnonymousFilter);

            if (isAuthorized && !allowAnonymous)
            {
                if (operation.Parameters == null)
                    operation.Parameters = new List<IParameter>();

                operation.Parameters.Add(new NonBodyParameter
                {
                    Name = "Authorization",
                    In = "header",
                    Description = "access token",
                    Required = true,
                    Type = "string"
                });
            }
        }
    }

which looks like this

however the links go to the url
about:blank

How do I set the v1/swagger.json link and the Terms of service link to go to the right place?

A:

Use c.SwaggerEndpoint("./v1/swagger.json", "Api v1");
It's looks like a bug that relative path (without '/') renders empty link but swagger.json is available and all works.
I use relative path to work properly with reverse proxies but this is other story...

