【发布时间】:2019-11-02 19:41:43
【问题描述】:
我有 REST API 主体和响应的模型架构。 XML cmets 已定义,但我无法找到一种方法在 API body 和 response 中包含 Swagger UI 3.0 中模型模式的 XML 文档? p>
【问题讨论】:
标签: asp.net-core swagger swagger-ui openapi
我有 REST API 主体和响应的模型架构。 XML cmets 已定义,但我无法找到一种方法在 API body 和 response 中包含 Swagger UI 3.0 中模型模式的 XML 文档? p>
【问题讨论】:
标签: asp.net-core swagger swagger-ui openapi
我错过了这个,它现在可以工作了。我让架构分布在不同的 asp.net 核心程序集上,而 Swagger UI 3.0 确实支持添加多个 XML 源。
要包含控制器 cmets 本身,我们必须设置 includeControllerXmlComments: true
c.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, "test1.xml"), includeControllerXmlComments: true);
c.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, "test2.xml"), includeControllerXmlComments: true);
c.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, "test3.xml"), includeControllerXmlComments: true);
【讨论】: