forked from loafle/openapi-generator-original
Fix datatypes in headers other than strings (#6233)
This commit is contained in:
parent
c1d47a580b
commit
1f82facf82
@ -144,8 +144,8 @@ void {{classname}}::{{nickname}}({{#allParams}}const {{{dataType}}} &{{paramName
|
|||||||
QByteArray output = {{paramName}}.asByteArray();{{/isFile}}
|
QByteArray output = {{paramName}}.asByteArray();{{/isFile}}
|
||||||
input.request_body.append(output);
|
input.request_body.append(output);
|
||||||
{{/isContainer}}{{/bodyParams}}{{#headerParams}}
|
{{/isContainer}}{{/bodyParams}}{{#headerParams}}
|
||||||
if ({{paramName}} != nullptr) {
|
if (!::{{cppNamespace}}::toStringValue({{paramName}}).isEmpty()) {
|
||||||
input.headers.insert("{{baseName}}", {{paramName}});
|
input.headers.insert("{{baseName}}", ::{{cppNamespace}}::toStringValue({{paramName}}));
|
||||||
}
|
}
|
||||||
{{/headerParams}}
|
{{/headerParams}}
|
||||||
|
|
||||||
|
@ -135,8 +135,8 @@ void PFXPetApi::deletePet(const qint64 &pet_id, const QString &api_key) {
|
|||||||
worker->setWorkingDirectory(_workingDirectory);
|
worker->setWorkingDirectory(_workingDirectory);
|
||||||
PFXHttpRequestInput input(fullPath, "DELETE");
|
PFXHttpRequestInput input(fullPath, "DELETE");
|
||||||
|
|
||||||
if (api_key != nullptr) {
|
if (!::test_namespace::toStringValue(api_key).isEmpty()) {
|
||||||
input.headers.insert("api_key", api_key);
|
input.headers.insert("api_key", ::test_namespace::toStringValue(api_key));
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); }
|
foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user