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
  • #660
Closed
Open
Issue created Jul 26, 2018 by Administrator@rootContributor

[cpprestsdk] Clashing of cpp parameter names with local variables.

Created by: Jauler

Description

Some local variables declared in cpprestsdk api-source.mustache file are likely to clash with real parameter names in specs, for example, having spec:

......
    "parameters": [
     {
      "uniqueItems": true,
      "type": "string",
      "description": "path to the resource",
      "name": "path",
      "in": "path",
      "required": true
     },
     {
      "uniqueItems": true,
      "type": "string",
      "description": "Path is the URL path to use for the current proxy request to pod.",
      "name": "path",
      "in": "query"
     }
    ]
......

will generate function:

pplx::task<utility::string_t> CoreV1Api::connectCoreV1DeleteNamespacedPodProxy(utility::string_t name, utility::string_t _namespace, boost::optional<utility::string_t> path)

where parameter path will clash with local variable path:

utility::string_t path = utility::conversions::to_string_t("{{{path}}}");

in api source file.

openapi-generator version

3.1.2-SNAPSHOT

OpenAPI declaration file content or url

https://github.com/kubernetes/kubernetes/blob/release-1.10/api/openapi-spec/swagger.json

Command line used for generation

java -jar ./modules/openapi-generator-cli/target/openapi-generator-cli.jar generate --generator-name cpp-restsdk --output output -i https://raw.githubusercontent.com/kubernetes/kubernetes/release-1.10/api/openapi-spec/swagger.json

Suggest a fix/enhancement
  • Parameter names in api-source.mustache could be renamed, e.g. _<name>_ or _param_<name>_ or similar.
  • Variable names used in mustache files could be added to the list of reserved words, although I am not sure how easy it would be to keep this list up to date.
Assignee
Assign to
Time tracking