We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在 FastEndpoint 框架中使用 Knife4jUI 和 FastEndpoints.Swagger 的对比。
FastEndpoint
Knife4jUI
FastEndpoints.Swagger
先定义 4 个 Endpoint ,分别如下:
- MyEndpoint : Endpoint<MyRequest, MyResponse> - TheyEndpoint : Endpoint<UserRequest<TheyReqDto>, UserResponse<TheyInfo>> - UserEndpoint : Endpoint<UserRequest<UserReqDto>, UserResponse<UserInfo>> - YourEndpoint : Endpoint<YourRequest<YourReqDto>, YourResponse<YourInfo>>
MyRequest
UserRequest<TheyReqDto>
UserEndpoint (get请求)也是类似的问题,但是注意和 TheyEndpoint 对比,在 UserEndpoint 中 UserReqDto 属性中还存在 UserFeatures 类型;
UserEndpoint
UserReqDto
UserFeatures
YourEndpoint (post请求)参数说明 "args": {} 也未能正常显示对应的 DTO 模型属性
"args": {}
项目环境配置说明:
<PropertyGroup> <TargetFramework>net7.0</TargetFramework> <Nullable>enable</Nullable> <ImplicitUsings>enable</ImplicitUsings> <GenerateDocumentationFile>true</GenerateDocumentationFile> </PropertyGroup>
注意:把 GenerateDocumentationFile 设置为 false 再对比查看,显示不一样的效果。
GenerateDocumentationFile
false
说明:AddSwaggerDoc 中设置了 settings.OperationProcessors.Add(new DefaultValueOperationProcessor());
AddSwaggerDoc
settings.OperationProcessors.Add(new DefaultValueOperationProcessor());
这几个 Endpoint 注意仔细对比,都有对应参照,在原生 Swagger(FastEndpoints.Swagger) 显示相对正常,但是 Knife4jUI 中显示就不太符合预期。
Endpoint
Swagger(FastEndpoints.Swagger)
完整 demo 请查看这里 => Solution1.zip
demo
The text was updated successfully, but these errors were encountered:
No branches or pull requests
在
FastEndpoint
框架中使用Knife4jUI
和FastEndpoints.Swagger
的对比。先定义 4 个 Endpoint ,分别如下:
MyRequest
的属性注释)UserRequest<TheyReqDto>
的属性注释)UserEndpoint (get请求)也是类似的问题,但是注意和 TheyEndpoint 对比,在
UserEndpoint
中UserReqDto
属性中还存在UserFeatures
类型;YourEndpoint (post请求)参数说明
"args": {}
也未能正常显示对应的 DTO 模型属性项目环境配置说明:
注意:把
GenerateDocumentationFile
设置为false
再对比查看,显示不一样的效果。说明:
AddSwaggerDoc
中设置了settings.OperationProcessors.Add(new DefaultValueOperationProcessor());
这几个
Endpoint
注意仔细对比,都有对应参照,在原生Swagger(FastEndpoints.Swagger)
显示相对正常,但是Knife4jUI
中显示就不太符合预期。完整
demo
请查看这里 => Solution1.zipThe text was updated successfully, but these errors were encountered: