openapi-generator
openapi-generator copied to clipboard
[BUG] Missing serverConf variable when emitting QT C++ clients
Description
QT C++ Client code generator generates references to a serverConf variable, but it does not emit the definition of this variable.
/tmp/client/OAIExternalEngineApi.cpp: In member function ‘void OpenAPI::OAIExternalEngineApi::initializeServerConfigs()’:
/tmp/client/OAIExternalEngineApi.cpp:39:5: error: ‘serverConf’ was not declared in this scope; did you mean ‘_serverConfigs’?
39 | serverConf.append(OAIServerConfiguration(
| ^~~~~~~~~~
| _serverConfigs
openapi-generator version
This problem happens at HEAD.
OpenAPI declaration file content or url
It's the lichess.org official API. There's a download link right at the top.
Generation Details
Happens with the C++ QT Client API generator.
Steps to reproduce
To reproduce the original issue, install QT build dependencies, then:
- go to https://lichess.org/api, click the "Download" link, save
openapi.jsonsomewhere -
java -jar target/openapi-generator-cli.jar generate -i /path/to/openapi.json -o /tmp/Lichess -g cpp-qt-client -
cd /tmp/Lichess/client -
mkdir build && cd build -
cmake .. -
make
Related issues/PRs
No existing ones.
Suggest a fix
Proposed fix: https://github.com/OpenAPITools/openapi-generator/pull/19859