Skip to content

[BUG][cpp-qt-client] compile error code for primitive types in body of put requests #11984

@rejuce

Description

@rejuce

Bug Report Checklist

  • [ x] Have you provided a full/minimal spec to reproduce the issue?

  • [x ] Have you validated the input using an OpenAPI validator (example)?

  • [x ] Have you tested with the latest master to confirm the issue still exists?

  • [ x] Have you searched for related issues/PRs?

Description

PUT requests that have a primitive type, like int or double or bool in the spec, cause compile erros
OAIDefaultApi::putAvgF32BankNr(const qint32 &bank_nr, const ::OpenAPI::OptionalParam<double> &body)
is generated with body type "double"
later called with
QByteArray output = body.value().asJson().toUtf8();
which failes, as double is not class

openapi-generator version

5.4.0

OpenAPI declaration file content or url

see attached

Generation Details

default configuration

Steps to reproduce

generate qt client api with put request with primitive type request body

VHCx64CtrREST.json.txt

proposed solution

change the output array initialistion for primitive types to
QByteArray output = QByteArray::number(body.value());

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions