使用JSON时Swagger描述中的新段落

时间:2017-02-20 17:11:33

标签: json swagger-2.0 github-flavored-markdown

在使用JSON时,如何在Swagger中编写描述时如何创建新段落?

我只找到YAML的示例,当我像Markdown一样创建一个新段落时,验证失败,文档不再渲染。

我想要什么

  

第一段描述了这个电话。

     

另一段提供了有关通话的其他信息。

我尝试过但不起作用

"description": "The first paragraph describes the call.

Another paragraph gives additional information about the call.",

1 个答案:

答案 0 :(得分:2)

JSON不支持文字多行字符串。

\n替换换行符应该有用,例如:

"description": "The first paragraph describes the call.\n\nAnother paragraph gives additional information about the call.",