如何在Swashbuckle文档中添加换行符? [英] How to add line break to Swashbuckle documentation?

查看:93
本文介绍了如何在Swashbuckle文档中添加换行符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用swagger/swashbuckle为Web Api 2中实现的api生成文档.

I'm generating documentation for an api implemented in Web Api 2 using swagger/swashbuckle.

识别的唯一xml文档标签是<summary><remarks><param>.
这意味着我不能使用<para>标记在新行或段落中设置文本格式,所有内容都将在文档的实施注释"条目中生成为连续的长段落.

The only xml documentation tags recognized are the <summary>, <remarks> and <param>.
This means I cannot use <para> tag to format my text in new lines or paragraphs, everything is generated as a continuous long paragraph in the Implementation Notes entry of the docs.

有什么办法吗?

推荐答案

另一种实现方法是创建自定义OperationFilter并使用xml文档标签,如

Another way to achieve is creating a custom OperationFilter and use the xml documentation tags as explained in :

https://github.com/domaindrivendev/Swashbuckle/issues/258

希望这会有所帮助

山姆

这篇关于如何在Swashbuckle文档中添加换行符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆