Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

New paragraph in Swagger description when using JSON

How can I create a new paragraph when writing a description in Swagger when using JSON?

I only find examples for YAML and when I simply create a new paragraph as I would with Markdown, the validation fails and the document does not render anymore.

What I want

The first paragraph describes the call.

Another paragraph gives additional information about the call.

What I tried but does not work

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

Another paragraph gives additional information about the call.",
like image 600
mrplow Avatar asked Feb 20 '17 17:02

mrplow


1 Answers

JSON doesn't support literal multiline strings.

Replacing line breaks with \n should work, e.g.:

"description": "The first paragraph describes the call.\n\nAnother paragraph gives additional information about the call.",
like image 141
Chris Avatar answered Nov 15 '22 05:11

Chris