richhollis / swagger-docs

Generates swagger-ui json files for Rails APIs with a simple DSL.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add line breaks in notes

fernandomm opened this issue · comments

Is it possible to add line breaks in notes? I tried two options:

notes "Line 1\nLine 2"
notes "Line 1<br />Line 2"

But none of them worked.

Your first method is working fine for me:

notes "Line 1 \n Line 2"

have you checked if the notes are successfully generated in the json doc?

Yes, the json is generated like this:

"notes": "Line 1 \n Line 2",

But at Swagger UI, the line breaks aren't displayed.

I'm unable to reproduce it. Tried both your methods and both are working..
Can you provide more details on how it's setup?

Could you share which version of Swagger UI you tested?

I'm using 2.2.6 and noticed that line breaks aren't enabled. So I had to add this:

marked.setOptions({breaks: true});

before loading Swagger UI.

After all this issue isn't related to this gem, so I will close it.