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

[C++] Error making the cpprestsdk generated files #6726

Open
mull opened this issue Jun 20, 2020 · 4 comments
Open

[C++] Error making the cpprestsdk generated files #6726

mull opened this issue Jun 20, 2020 · 4 comments

Comments

@mull
Copy link

mull commented Jun 20, 2020

Description

After using the generator as described for cpp-restsdk and trying to make the project, I receive a bunch of errors. (I've been trying all day and only now realised that either I'm doing something really wrong, or the generated code is broken.)

I see the following errors:

[  1%] Building CXX object CMakeFiles/CppRestOpenAPIClient.dir/api/AccountsApi.cpp.o
In file included from /home/mull/code/peertuber/psdk/api/AccountsApi.cpp:13:
/home/mull/code/peertuber/psdk/api/AccountsApi.h:25:10: fatal error: OneOfnumberarray.h: No such file or directory
   25 | #include "OneOfnumberarray.h"
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/CppRestOpenAPIClient.dir/build.make:167: CMakeFiles/CppRestOpenAPIClient.dir/api/AccountsApi.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/CppRestOpenAPIClient.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
openapi-generator version

4.3.1

(libcpprest-dev version 2.10.15-1, installed from ubuntu)

OpenAPI declaration file content or url

https://raw.githubusercontent.com/Chocobozzz/PeerTube/develop/support/doc/api/openapi.yaml

Command line used for generation
npx @openapitools/openapi-generator-cli generate \
  -i https://raw.githubusercontent.com/Chocobozzz/PeerTube/develop/support/doc/api/openapi.yaml \
  -g cpp-restsdk \
  --additional-properties=apiPackage=psdk.api,modelPackage=psdk.model
Steps to reproduce
npx @openapitools/openapi-generator-cli generate \
  -i https://raw.githubusercontent.com/Chocobozzz/PeerTube/develop/support/doc/api/openapi.yaml \
  -g cpp-restsdk \
  --additional-properties=apiPackage=psdk.api,modelPackage=psdk.model
cd psdk
cmake -DCPPREST_ROOT=/usr -DCMAKE_CXX_FLAGS="-I/usr/local/opt/openssl/include" -DCMAKE_MODULE_LINKER_FLAGS="-L/usr/local/opt/openssl/lib"
make
Related issues/PRs
Suggest a fix/enhancement
@auto-labeler
Copy link

auto-labeler bot commented Jun 20, 2020

👍 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.

@mull
Copy link
Author

mull commented Jun 20, 2020

I might be using the lib wrong... the sample for cpp-restsdk is broken :|

@etherealjoy
Copy link
Contributor

etherealjoy commented Jun 20, 2020

@mull
The sample is compiling. I just tested it. You might want to use the latest master snapshot as well to check.

Regarding the oneOf I think we have an open bug for it.

We have an issue we need to work on for all C++ generators.
#6378

@mull
Copy link
Author

mull commented Jun 20, 2020

In the end it's about oneOf and these things. Using the spec that I linked to it'll produce stuff like

#include "OneOfnumberarray.h"
#include "OneOfstringarray.h"

Which are files that don't exist (or are not provided, at least.) I give up for now, but I'll follow that issue. Thanks!

mlebihan added a commit to mlebihan/openapi-generator that referenced this issue May 30, 2024
…meter generates a org::openapitools::server::model::std::optional<...> that doesn't compile OpenAPITools#18792

   Solving this issue has for goal to reduce the amount of work required to resolve the [[C++] Error making the cpprestsdk generated files](OpenAPITools#6726)
   and to put the `cpp-pistache-server` generator a the "same compilation problems" level than the `cpp-restsdk` generator in font of the OpenAPITools#6726.
wing328 pushed a commit that referenced this issue Jun 1, 2024
…meter generates a org::openapitools::server::model::std::optional<...> that doesn't compile #18792 (#18793)

Solving this issue has for goal to reduce the amount of work required to resolve the [[C++] Error making the cpprestsdk generated files](#6726)
   and to put the `cpp-pistache-server` generator a the "same compilation problems" level than the `cpp-restsdk` generator in font of the #6726.
welshm pushed a commit to welshm/openapi-generator that referenced this issue Jun 5, 2024
…meter generates a org::openapitools::server::model::std::optional<...> that doesn't compile OpenAPITools#18792 (OpenAPITools#18793)

Solving this issue has for goal to reduce the amount of work required to resolve the [[C++] Error making the cpprestsdk generated files](OpenAPITools#6726)
   and to put the `cpp-pistache-server` generator a the "same compilation problems" level than the `cpp-restsdk` generator in font of the OpenAPITools#6726.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants