[php] Set $multipart to true if content-type is multipart/form-data (#5536) (#18991)

* [php] Set $multipart to true if content-type is multipart/form-data (#5536)

Related: https://github.com/OpenAPITools/openapi-generator/issues/5536

* [php] Use isMultipart variable

---------

Co-authored-by: Simon Hammes <simonhammes@users.noreply.github.com>
This commit is contained in:
Simon 2024-12-15 10:29:12 +01:00 committed by GitHub
parent cdfab4eee3
commit 9b3484cc99
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View File

@ -688,6 +688,9 @@ use {{invokerPackage}}\ObjectSerializer;
}
{{/formParams}}
{{#isMultipart}}
$multipart = true;
{{/isMultipart}}
$headers = $this->headerSelector->selectHeaders(
[{{#produces}}'{{{mediaType}}}', {{/produces}}],
$contentType,

View File

@ -2571,6 +2571,7 @@ class PetApi
}
}
$multipart = true;
$headers = $this->headerSelector->selectHeaders(
['application/json', ],
$contentType,
@ -2917,6 +2918,7 @@ class PetApi
}
}
$multipart = true;
$headers = $this->headerSelector->selectHeaders(
['application/json', ],
$contentType,