redoc
redoc copied to clipboard
Multiline string examples render wrong
If a string example includes \n (newline) characters, these are not honored when rendering examples.
Say you have a parameter like this:
parameters:
- description: The contents of the `php.ini` file.
in: query
name: content
schema:
example: |
[PHP]
; About php.ini
; php.ini is responsible for configuring many of the aspects of PHP's behavior.
pcre.backtrack_limit=100000
type: string
The Example printed to the output places the example on lines ignoring the \n characters.

Where as I would have expected something similar to:

Has this issue been fixed? I'm running into it too.
~~I have the same problem, and as a workaround, I'm using </br> instead to get around it.~~
Use \\\n instead of \n.
@doc("Hello\\\nWorld")
hoge: |
Hello \
World