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}}
|
||||
input.request_body.append(output);
|
||||
{{/isContainer}}{{/bodyParams}}{{#headerParams}}
|
||||
if ({{paramName}} != nullptr) {
|
||||
input.headers.insert("{{baseName}}", {{paramName}});
|
||||
if (!::{{cppNamespace}}::toStringValue({{paramName}}).isEmpty()) {
|
||||
input.headers.insert("{{baseName}}", ::{{cppNamespace}}::toStringValue({{paramName}}));
|
||||
}
|
||||
{{/headerParams}}
|
||||
|
||||
|
@ -135,8 +135,8 @@ void PFXPetApi::deletePet(const qint64 &pet_id, const QString &api_key) {
|
||||
worker->setWorkingDirectory(_workingDirectory);
|
||||
PFXHttpRequestInput input(fullPath, "DELETE");
|
||||
|
||||
if (api_key != nullptr) {
|
||||
input.headers.insert("api_key", api_key);
|
||||
if (!::test_namespace::toStringValue(api_key).isEmpty()) {
|
||||
input.headers.insert("api_key", ::test_namespace::toStringValue(api_key));
|
||||
}
|
||||
|
||||
foreach (QString key, this->defaultHeaders.keys()) { input.headers.insert(key, this->defaultHeaders.value(key)); }
|
||||
|
Loading…
x
Reference in New Issue
Block a user