Skip to content

Commit 0f25ca7

Browse files
simonhammestimon-sbr
authored andcommitted
[php] Set $multipart to true if content-type is multipart/form-data (OpenAPITools#5536) (OpenAPITools#18991)
* [php] Set $multipart to true if content-type is multipart/form-data (OpenAPITools#5536) Related: OpenAPITools#5536 * [php] Use isMultipart variable --------- Co-authored-by: Simon Hammes <[email protected]>
1 parent d03097e commit 0f25ca7

File tree

2 files changed

+5
-0
lines changed
  • modules/openapi-generator/src/main/resources/php
  • samples/client/petstore/php/OpenAPIClient-php/lib/Api

2 files changed

+5
-0
lines changed

modules/openapi-generator/src/main/resources/php/api.mustache

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,9 @@ use {{invokerPackage}}\ObjectSerializer;
688688
}
689689
{{/formParams}}
690690

691+
{{#isMultipart}}
692+
$multipart = true;
693+
{{/isMultipart}}
691694
$headers = $this->headerSelector->selectHeaders(
692695
[{{#produces}}'{{{mediaType}}}', {{/produces}}],
693696
$contentType,

samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2571,6 +2571,7 @@ public function uploadFileRequest($pet_id, $additional_metadata = null, $file =
25712571
}
25722572
}
25732573

2574+
$multipart = true;
25742575
$headers = $this->headerSelector->selectHeaders(
25752576
['application/json', ],
25762577
$contentType,
@@ -2917,6 +2918,7 @@ public function uploadFileWithRequiredFileRequest($pet_id, $required_file, $addi
29172918
}
29182919
}
29192920

2921+
$multipart = true;
29202922
$headers = $this->headerSelector->selectHeaders(
29212923
['application/json', ],
29222924
$contentType,

0 commit comments

Comments
 (0)