Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] cpp-restsdk generator produces broken code #2003

Closed
Findus79 opened this issue Jan 28, 2019 · 1 comment · Fixed by #5222
Closed

[BUG] cpp-restsdk generator produces broken code #2003

Findus79 opened this issue Jan 28, 2019 · 1 comment · Fixed by #5222

Comments

@Findus79
Copy link

Findus79 commented Jan 28, 2019

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

@auto-labeler
Copy link

auto-labeler bot commented Jan 28, 2019

👍 Thanks for opening this issue!
🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant