OpenAPITools / OpenAPITools/openapi-generator

[BUG] Missing serverConf variable when emitting QT C++ clients

Open
#19,860 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

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.json somewhere
  • 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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue identifies the cpp-qt-client generator and the generated client build as entry points. Start by running the listed OpenAPI Generator command with lichess openapi.json, then configure and build the generated client; done is a generated client that compiles without the missing-variable error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, openapi
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.