Skip to content

Commit

Permalink
[php] Set $multipart to true if content-type is multipart/form-data (#…
Browse files Browse the repository at this point in the history
…5536) (#18991)

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

Related: #5536

* [php] Use isMultipart variable

---------

Co-authored-by: Simon Hammes <[email protected]>
  • Loading branch information
simonhammes and simonhammes authored Dec 15, 2024
1 parent cdfab4e commit 9b3484c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/openapi-generator/src/main/resources/php/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,9 @@ use {{invokerPackage}}\ObjectSerializer;
}
{{/formParams}}

{{#isMultipart}}
$multipart = true;
{{/isMultipart}}
$headers = $this->headerSelector->selectHeaders(
[{{#produces}}'{{{mediaType}}}', {{/produces}}],
$contentType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2571,6 +2571,7 @@ public function uploadFileRequest($pet_id, $additional_metadata = null, $file =
}
}

$multipart = true;
$headers = $this->headerSelector->selectHeaders(
['application/json', ],
$contentType,
Expand Down Expand Up @@ -2917,6 +2918,7 @@ public function uploadFileWithRequiredFileRequest($pet_id, $required_file, $addi
}
}

$multipart = true;
$headers = $this->headerSelector->selectHeaders(
['application/json', ],
$contentType,
Expand Down

0 comments on commit 9b3484c

Please sign in to comment.