Skip to content

[BUG] [Qt5][client] Initialize contentCompression variables  #5833

@natanlaverde

Description

@natanlaverde
Bug Report Checklist
  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
Description

When contentCompression is not enabled, the variables isRequestCompressionEnabled and isResponseCompressionEnabled in HttpRequestWorker are not being initialized.
Without initialization the compress function could be called and the request content could be an empty QByteArray instead of original request body.

openapi-generator version

4.3.1-SNAPSHOT

OpenAPI declaration file content or url

N/A.

Command line used for generation
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate \
  -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml \
  -g cpp-qt5-client \
  -o /tmp/client/petstore/cpp-qt5-client
Steps to reproduce

Just generate without contentCompression option.

Related issues/PRs

N/A

Suggest a fix

Just initialize the variables isRequestCompressionEnabled and isResponseCompressionEnabled in HttpRequestWorker Class with default value false.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions