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
  • #4537
Closed
Open
Issue created Nov 19, 2019 by Administrator@rootContributor

[BUG] Kotlin escaped reserved words have HTML entities not backticks

Created by: dalewking

Description

Note that this is difficult to express without markdown translating what I enter.

Kotlin supports escaping reserved words by surrounding it with backticks as in `data`

I have an API that has a parameter named data that is a reserved word in Kotlin and the generator is recognizing that it is reserved, but when the source file is written the backticks are being turned into HTML character entities.

So instead of seeing `data` in the code what I see is `data`

openapi-generator version

4.2.1

OpenAPI declaration file content or url

Here is the URL of the API I am trying to work with: https://api.youneedabudget.com/papi/spec-v1-swagger.json

Command line used for generation

Gradle.kts declaration I am using:

val swaggerInput = file("ynab-v1-swagger.json")
val swaggerOutputDir = file("build/swagger")

openApiGenerate {
    inputSpec.set(swaggerInput.toString())
    outputDir.set(swaggerOutputDir.toString())
    generatorName.set("kotlin")
    invokerPackage.set("mypackage.ynab.client")
    modelPackage.set("mypackage.ynab.client.model")
    apiPackage.set("mypackage.client.api")
    configOptions.put("dateLibrary", "java8")
}
Steps to reproduce

Generate kotlin code of an API that uses a reserved word

Assignee
Assign to
Time tracking