swagger-api / swagger-api/swagger-codegen

[JAVA] Javadoc backslash escape issue

Open
#6,240 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Client: Java Feature: Documentation help wanted Issue: Bug
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

When codegen renders a method description into a Javadoc comment it seems to not correctly remove \"escapes.

Sample

"description":"Test\nRequires user permission: \"system.variables-rest:view\"."

Result:

     * Test  Requires user permission: \"system.variables-rest:view\".

It does not preserve the linebreaks and it does preserve the \

Swagger-codegen version

2.2.3

Swagger declaration file content or url
    "description":"Test\nRequires user permission: \"system.variables-rest:view\"."
Command line used for generation
java -jar ... generate -l java -i swagger.json -o .

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

Start with the swagger.json example and run the shown Java generation command to reproduce the generated Javadoc output. Compare the result with the description's expected line breaks and quotation marks; done means escaped quotes render correctly and the newline is preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
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.