luoyunchong/IGeekFan.AspNetCore.Knife4jUI

设置了RoutePrefix访问就会报错

Closed this issue · 3 comments

设置了RoutePrefix访问就会报错,加载不出接口文档

目前只能这样,请求是Knife4j内部请求的,这边控制不了

    app.UseSwagger();
    app.UseKnife4UI(c =>
    {
        c.RoutePrefix = "k4"; // serve the UI at root
        c.SwaggerEndpoint("/v1/swagger.json", "V1 Docs");
    });c
app.UseEndpoints(endpoints =>
{
    endpoints.MapControllers();
    endpoints.MapSwagger("/k4/{documentName}/swagger.json");
});

就是说这个 nuget 解决不了?这种是不是应该算作 not planned 而不是 completed

app.UseKnife4UI(c => { c.RoutePrefix = "doc"; c.SwaggerEndpoint($"../{app.Key}/swagger.json", app.Value); });

路径里加上 ../ 居然有效~