最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

asp.net core - Alternative to Swagger's IncludeXMLComments in native MS OpenApi on .NET9 - Stack Overflow

programmeradmin3浏览0评论

Is there an alternative to Swagger's configuration IncludeXMLComments in native MS OpenApi which is introduced on .NET9? I'm running a project on 8 and migrating to 9 and wanted to migrate to native OpenApi and Scalar support, but I'm relying on SwaggerGen to use methods' and properties' XML comments in code to generate meaningful descriptions in API specification. I could not find anything similar in native OpenAPI library.

Code snippet from Swagger related implementation:

//  add the xml comments to the swagger generated json
var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile);
config.IncludeXmlComments(xmlPath);
发布评论

评论列表(0)

  1. 暂无评论