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

[CPP-QT-QHTTPENGINE] Code errors generating server with petstore #11176

Closed
ipittau opened this issue Dec 22, 2021 · 1 comment · Fixed by #11177
Closed

[CPP-QT-QHTTPENGINE] Code errors generating server with petstore #11176

ipittau opened this issue Dec 22, 2021 · 1 comment · Fixed by #11177

Comments

@ipittau
Copy link
Contributor

ipittau commented Dec 22, 2021

Description

Server has some code errors that prevents build and to runtime good execution.

  1. Error on API Request handler lambda function for process, extra "m" is present
  2. Error on regular expression to capture ids on path
openapi-generator version

Generator version 5.3.1

OpenAPI declaration file content or url

Sample Petstore

Command line used for generation

docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate -i /local/petstore.yaml -g cpp-qt-qhttpengine-server -o /local/out/qt

Steps to reproduce

Generate the server and try to build.

  1. A build error is present because of undeclared m parameter
  2. Runtime a simple get will not be capture from regular expression (GET /v2/user/MyUser)
Suggest a fix/enhancement
  1. Fix on modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirouter.h.mustache line 39
    [this, socket, m] -> [this, socket]

  2. Fix on modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirouter.h.mustache line 94
    QRegularExpression parExpr( R"({([^\/\\s]+)})" ); -> QRegularExpression parExpr( R"({([^\/\s]+)})" ); ->

@wing328
Copy link
Member

wing328 commented Dec 22, 2021

@ipittau thanks for reporting the issue. Can you please file a PR with the suggested fix?

ipittau added a commit to ipittau/openapi-generator that referenced this issue Dec 22, 2021
ipittau added a commit to ipittau/openapi-generator that referenced this issue Dec 22, 2021
wing328 pushed a commit that referenced this issue Jan 4, 2022
* Fix extra m that prevents qt cpp server to build (#11176)

* Fix regular expression to capture IDs on path (#11176)

* Fix build issue missing QHttpEngine namespace (#10706)
@wing328 wing328 closed this as completed Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants