Skip to content

broken new Line parsing YAML  #5475

@HenriPro

Description

@HenriPro

Q&A (please complete the following information)

  • OS: macOS
  • Browser: chrome, safari, firefox
  • Method of installation: dist bundle, swagger.io demo
  • Swagger-UI version: 3.18.3
  • Swagger/OpenAPI version: Swagger 2.0

Content & configuration

Screen Shot 2019-07-17 at 4 22 50 PM

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           

Describe the bug you're encountering

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.

To reproduce...

Steps to reproduce the behavior:
Load yaml file

Expected behavior

All new lines in parameter description to be rendered as separate lines in html

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions