OpenAPITools / OpenAPITools/openapi-generator
[REQ][HTML] YAML multiline string formatting of descriptions should be translated to HTML
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Is your feature request related to a problem? Please describe.
When using the literal style indicator (|) in a block scalar for a description, the formatting is ignored when inserted into HTML.
paths:
/employees/{id}:
get:
description: |
First line
Second line
But right now this come out as First line Second line in the rendered HTML.
Describe the solution you'd like
When the literal style indicator is specified in the YAML, a <br> tag should be inserted at each newline when generating the HTML.
Additional context
Inserting <br> tags is how the Swagger UI does this and the formatting works great there.
Here's a good reference link on YAML multiline syntax.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the HTML generation path for OpenAPI descriptions and reproduce the issue with the YAML literal block example in the report. Compare the generated output with Swagger UI's newline behavior; the work is done when each newline in a literal-style description is represented by a
tag in the rendered HTML.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, yaml
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100