
Example Swagger/OpenAPI definition:
swagger: '2.0'
info:
description: broken line break
version: 1.0
basePath: /test
schemes:
- https
securityDefinitions:
ApiKeyAuth:
type: apiKey
in: header
name: apikey
paths:
/test/brokennewline:
get:
tags:
- Broken New Line
summary: Broken new Line example
description: Broken new line YAML example
operationId: BrokenNewLine
consumes:
- application/json
produces:
- application/json
security:
- ApiKeyAuth: []
parameters:
- name: X-applicationNameA
description: |
This works note the dash on the line bellow
e.g. CXMOBILE-56789
in: header
required: true
type: string
- name: X-applicationNameB
description: |
This should be also be two lines
e.g. CXMOBILE156789
in: header
required: true
type: string
Fails to render new lines for parameter description as expected.
Both parameter descriptions should be two lines. Only the first one is rendered with a
The second without the dash does not get split into a new line. Adding a character like a comma or dash does result in correct render.
Steps to reproduce the behavior:
Load yaml file
All new lines in parameter description to be rendered as separate lines in html
Might be best to just remove our plaintext optimization to solve this:
Most helpful comment
Might be best to just remove our plaintext optimization to solve this:
https://github.com/swagger-api/swagger-ui/blob/15cdfe14dd2df48a91cf9088b6605b75dd3cee25/src/core/components/providers/markdown.jsx#L22-L27