Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #4111
Closed
Open
Issue created Oct 09, 2019 by Administrator@rootContributor

[REQ] Support multiline and complex formatting in `description` fields

Created by: zippolyte

Is your feature request related to a problem? Please describe.

Many description fields for paths, parameters, or even the main description of the client need to be more than just one line long, and might even be markdown formatted. This can in theory be done in the specification file, thanks to the YAML syntax for multiline strings with | or >.

The problem is that when rendering the .md files for the documentation, the generator takes the escaped string in the description, which basically removes every new line and prevent any formatting to be done, like in this issue https://github.com/OpenAPITools/openapi-generator/issues/3704 for instance.

Describe the solution you'd like

I would like to be able to specify markdown in my template descriptions

A solution I see could be to use the unescaped variant of the multiline string. For example: use {{{unescapedNotes}}} instead of {{notes}} in https://github.com/OpenAPITools/openapi-generator/blob/e9a0a51b505ad0c376dc87c90586aad08b0a18a3/modules/openapi-generator/src/main/resources/Java/api_doc.mustache#L21

Describe alternatives you've considered

Another alternative, if the fully unescaped string is a problem, would be to provide and use the escapeTextWhileAllowingNewLines version of the string. (see https://github.com/OpenAPITools/openapi-generator/blob/e9a0a51b505ad0c376dc87c90586aad08b0a18a3/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java#L561)

Additional context

Assignee
Assign to
Time tracking