OpenAPITools / OpenAPITools/openapi-generator

[BUG] [Doc:AsciiDoc] double quotes cannot be fully unescaped

Open
#14,835 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Bug Report Checklist
  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

Double quotation marks in description fields of parameters for API methods get html escaped to ". When using {{{description}}} in the corresponding .mustache file to disable escaping, the double quotation marks are output as ".

openapi-generator version

openapi-generator version 6.2.1

OpenAPI declaration file content or url
Generation Details

The openapi.yaml file contains the unescaped quotation marks. When generating the .adoc files using the asciidoc configuration of the generator, the quotation marks get escaped.

Steps to reproduce

Prepare API-method annotations for documentation generation with double quotation marks in the description -> execute the documentation generation
A custom .mustache file can be configured to produce both forms of escaping, as mentioned above.

Related issues/PRs

https://github.com/OpenAPITools/openapi-generator/issues/11349
https://github.com/OpenAPITools/openapi-generator/issues/9324
These two issues describe the same behaviour, but the only fix still results in the quotation marks being escaped with backslash " which is not optimal.

Suggest a fix

Some clean workaround or way to configure the generator to not escape the quotation marks in any way.

Thanks for helping in advance!

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

No source file or test is named. Start by tracing AsciiDoc documentation generation and the escaping path for parameter descriptions, then compare the behavior described in issues 11349 and 9324. Done means double quotation marks are emitted without HTML escaping or backslash escaping, including when custom .mustache templates are used.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.