swagger-api / swagger-api/swagger-codegen

[HTML] Multi-line examples aren't displayed multi-line

Open
#3,661 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

Multi-line example return data isn't displayed as multi-line.

Swagger-codegen version

2.2.1

Swagger declaration file content or url

---
swagger: '2.0'
info:
  version: 0.0.0
  title: Simple API
paths:
  /:
      responses:
        200:
          description: OK
          schema:
            type: string
            example: |
              foo
              bar
Expected Result:

"foo bar"

Result:

"foo\nbar\n"

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Use the supplied Swagger 2.0 declaration as the reproduction case, focusing on the HTML output for the multi-line string example. Compare the expected and actual rendering, then verify that the generated result preserves the line break without the extra trailing newline; no source file or test is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, yaml
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.