-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
[pistache-server](C++ stub) - POST not handled correctly - compile failed #258
Comments
I looked into it a bit. Seems like there is an error in the mustache files.
If you adapt this code piece to this
Your problem is resolved, but then there is the issue with the arrays, as std::vector<..> changes to std::vector. |
Can you check if it works with the changes in the pr #264 |
I just checked with the pr #264 and I notice nothing new :/ |
Any news on the future fix ? |
Fixed in #497 |
Description
I'm still trying to use the openAPI v3 Tutorial and I notice the openapi-generator tool seems to generate a wrong C++ code when handling a POST.
The compile command line and its stdout is :
Indeed, after having a look into the two generated files DefaultApi.h and DefaultApi.cpp I can notice that one method is called passing wrong arguments. See below.
The DefaultApi.cpp describes this
( see the line ==> this->artists_post(body, response); )
whereas the DefaultApi.h describes the prototype :
virtual void artists_post(const std::shared_ptr<Body> &body, Pistache::Http::ResponseWriter &response) = 0;
In other words, the method artists_post is called with the first argument as a Body type, whereas it should be called with a shared_ptr<Body> type. Or the opposite, I mean, may be the method call is correct and the prototype should be modified.
NOTE: The second solution is used by the swagger-codegen tool
openapi-generator version
v3.0.0
OpenAPI declaration file content or url
Based on the published openAPI V3 tutorial, I extract the short lines that generate the wrong behavior
Command line used for generation
openapi-generator-cli.sh generate -i ../../api-ms1/openapi.yaml -g cpp-pistache-server -c ./config.json -o .
Steps to reproduce
config.json content is :
Call the openapi-generator-cli as shown previously and then compile the code, for example :
Related issues/PRs
n/a
Suggest a fix/enhancement
Described above
The text was updated successfully, but these errors were encountered: