OpenAPITools/openapi-generator

[C++] Error making the cpprestsdk generated files

Open

#6,726 opened on 2020年6月20日

GitHub で見る
 (4 comments) (0 reactions) (0 assignees)Java (26,243 stars) (7,516 forks)batch import
Client: C++HacktoberfestIssue: Bughelp wanted

説明

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

コントリビューターガイド