-
-
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
[cpp-pistache-server] newItem.fromJson() always called even when type is std::string #1251
Comments
@brianwaters3 thanks for reporting the issue. What does the correct code look like? cc @ravinikam (2017/07) @stkrwork (2017/07) @fvarose (2017/11) @etherealjoy (2018/02) @MartinDelille (2018/03) |
@brianwaters3 Publishing the code on a gist or a github repository would make the analysis easier. |
@wing328 It seems to me there is a regression somewhere that Array members don't have the type updated properly anymore. Update: |
Also interested in a fix |
Any news on this bug fix ? |
indeed, It solves at top level only. needs to be done still. |
I tried this now on the Fixed with #2653 |
Description
The fromJson method defined via model-source.mustache declares newItem to be of type items.datatype. When processing an array of stings this results in generating declaring newItem as std::string and subsequently attempting to execute the fromJson() method which is undefined. In this case, here is a snippet of the generated code for UePerLocationReport::fromJson(nlohmann:json& val).
openapi-generator version
3.3.0
OpenAPI declaration file content or url
Archive .zip contains the yaml and support files to reproduce the issue.
Archive.zip
Command line used for generation
java -jar ~/code/git/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -i updated/TS29122_MonitoringEvent.yaml -g cpp-pistache-server --config config -o ./src/MonitoringEvent/
Modify the openapi-generator-cli.jar path to match your system.
Steps to reproduce
g++ -g -pthread -std=c++11 -I ./include -I ./src/MonitoringEvent/api -I ./src/MonitoringEvent/impl -I t8/src/MonitoringEvent/model -c -o ./UePerLocationReport.o ./src/MonitoringEvent/model/UePerLocationReport.cpp
Related issues/PRs
Suggest a fix/enhancement
The text was updated successfully, but these errors were encountered: