使用 spring rest 文档时,如何在描述中创建换行符?

问题描述

我尝试使用 \n 或 br 标签来换行,但它不起作用。

requestParameters(
                parameterWithName("name").description("This is the description <br/> in the table."),
<td class="tableblock halign-left valign-top"><p class="tableblock">This is the description &lt;br/&gt; in the table.</p></td>

如何在描述中换行?

解决方法

您只需要将字符串中的额外 "+" 与换行符 \n 组合起来。

parameterWithName("name").description("This is the description +" + "\n" + "in the table."),