mrplow
mrplow

Reputation: 163

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.",

Upvotes: 7

Views: 9800

Answers (1)

Chris
Chris

Reputation: 136880

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.",

Upvotes: 9

Related Questions