openapi-generator icon indicating copy to clipboard operation
openapi-generator copied to clipboard

[REQ] [cpp-qt-client] Download Progress

Open Jazzco opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe.

When downloading larger files via the generated API I miss a possibility to get the download progress. This could be achieved by connecting to the signal QNetworkReply::downloadProgress.

Describe the solution you'd like

I see two possible ways:

  1. pass the QNetworkReply::downloadProgress to the clients
    • add a downloadProgress signal to the HttpRequest header
    • connect the QNetworkReply::downloadProgress to the new signal in the HttpRequest body right before the connect to QNetworkReply::finished
    • add a downloadProgress signal to the api-header and connect this in the api-body right before the connect to HttpRequestWorker::on_execution_finished
  2. OR make the QNetworkReply available
    • add a parameter to a changeable reference pointer to the HttpRequest::execute that can be read in the client's major call (the first occurrence of nickname)

Solution 2 would make more interaction with the reply available but may also enable misusing it.

Describe alternatives you've considered

Additional context

Jazzco avatar Jun 14 '24 10:06 Jazzco

Here is an implementation of solution 1: https://github.com/Jazzco/openapi-generator/tree/qt-progress-info
On positive feedback I would create a PullRequest

Jazzco avatar Jun 14 '24 10:06 Jazzco

can you please create a PR to start with? I'll tag some contributors to review. thanks

wing328 avatar Jun 17 '24 03:06 wing328

Sure: https://github.com/OpenAPITools/openapi-generator/pull/18950

Jazzco avatar Jun 17 '24 17:06 Jazzco