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
  • #2003
Closed
Open
Issue created Jan 28, 2019 by Administrator@rootContributor

[BUG] cpp-restsdk generator produces broken code

Created by: Findus79

Description

When generating the interface for the sample json using cpp-restsdk generator, the resulting cpp is not compilable. One error is the generated helper function

template <typename T>
utility::string_t toString(const T value)
{
    std::ostringstream out;
    out << std::setprecision(std::numeric_limits<T>::digits10) << std::fixed << value;
    return out.str();
}

where std::ostringstream out; should be utility::ostringstream_t out;

The main problems are with the generated HttpContent class. A lot of non-existing method calls are generated, like fromJson, fromMultipart, get, toMultipart. Also non-existing constructors are called on HttpContent.

openapi-generator version

tried with 3.3.4 and 4.0.0 (latest master)

OpenAPI declaration file content or url

gist link to the json file: https://gist.github.com/Findus79/83044968492b225968c2c4bb749d2e21

Command line used for generation

java -jar openapi-generator-cli-3.4.4.jar generate -g cpp-restsdk -i input\openapi-cpprestsdk.json -o output

and

java -jar openapi-generator-cli-4.0.0.jar generate -g cpp-restsdk -i input\openapi-cpprestsdk.json -o output

Assignee
Assign to
Time tracking