-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[cpprest] arrays of arrays or maps causes compilation error #7100
Comments
Another approach would also be interesting to hear. |
One way is
but it's not pretty. Aother way I can think of is to update the datatype directly in postProcessOperations, postProcessModels. |
I fixed this for Qt5 by inspecting the items but like you said it is not pretty. |
I'm having similar issues with vectors (on 2.3.1)
Would you like me to open a different issue and/or link to my conan setup? |
@p-groarke |
@etherealjoy This is my first use of swagger-codegen and swagger, so I have no idea (yet). I'm digging in your generator :) Will let you know/send a PR if I have a solution. The build scripts aren't up yet as they're probably broken, but if I can't find any solution I'll at least upload them so you can test and debug with a pretty good and large public swagger api. |
@p-groarke |
@etherealjoy https://esi.tech.ccp.is/latest/swagger.json Will upload my conan package soon. |
@etherealjoy https://github.com/p-groarke/cpprest-esi The cmake I use (for conan) : https://github.com/p-groarke/cpprest-esi-cmake/blob/master/CMakeLists.txt Cheers |
Solved in #7571 |
I had the same problem in 2023 and tried multiple historical versions of swagger-codegen-cli and the problem persisted. Curious why? Hasn't MR fixed the vector nesting problem? |
Description
When the Definition is an array of array or array of maps then the generated code is trying to use a method fromJson which is not present in the vector or map.
The code is trying to invoke fromJson from an array which is obviously wrong.
Swagger-codegen version
2.3.0
3.0.0
Swagger declaration file content or url
Array of maps
Array of arrays
Command line used for generation
java -jar /home/dev/swagger-codegen/modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i /home/dev/gen-test/yaml/docker-v132-subset.yaml -o /home/dev/gen-test/gen/ -l cpprest
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement
I could fix this for example, but I don't know how to perform member items datatype or container type check. If someone could hint me I could try fixing this.
This problem does not exist with the qt5cpp for example as the static method tries to use the recursive method to serialize or deserialize.
The text was updated successfully, but these errors were encountered: