fix(middleware): 解决Swagger文档无法正常显示的问题
- 添加 /swagger 路径到 ApiResponseMiddleware 的 PassthroughPrefixes 列表 - 确保 Swagger/OpenAPI 文档保持原始结构不被包裹成统一响应格式 - 避免 Swagger UI 无法识别 openapi 字段导致的文档加载失败
This commit is contained in:
parent
bdde5b9b8a
commit
ade4beacdb
@ -108,6 +108,8 @@ public class BuildFlowHostModule : AbpModule
|
|||||||
services.Configure<BuildFlow.Shared.Api.ApiResponseMiddlewareOptions>(opts =>
|
services.Configure<BuildFlow.Shared.Api.ApiResponseMiddlewareOptions>(opts =>
|
||||||
{
|
{
|
||||||
opts.PassthroughPrefixes.Add("/api/files/download");
|
opts.PassthroughPrefixes.Add("/api/files/download");
|
||||||
|
// Swagger/OpenAPI 文档必须保持原始结构,不能包裹成 { code, data, message },否则 Swagger UI 无法识别 openapi 字段。
|
||||||
|
opts.PassthroughPrefixes.Add("/swagger");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user