You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
trying to generate a PHP client library, using multipart/form-data parameters for POST request.
i see in the PHP api.mustache that $multipart is initially set to false and only if a file parameter has been received it it's value is changed to true:
therefore, when sending a POST request with form parameters without a file parameter (not mandatory parameter), the generated client library does not send the request as a multipart/form-data parameters request.
what might fix it is to set the multipart to true not only if a file was received as a parameter, but to check the content-type header parameter instead.
The text was updated successfully, but these errors were encountered:
Description
trying to generate a PHP client library, using multipart/form-data parameters for POST request.
i see in the PHP api.mustache that $multipart is initially set to false and only if a file parameter has been received it it's value is changed to true:
Later in the same file we see that only if $multipart is set to true a multipart request is created:
this is my swagger json file:
therefore, when sending a POST request with form parameters without a file parameter (not mandatory parameter), the generated client library does not send the request as a multipart/form-data parameters request.
Swagger-codegen version
version 2.3.1
Swagger declaration file content or url
Command line used for generation
java -DdebugOperations -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate
-i mail.json
-l php
-o ~/workspace/swagger-codegen/mail-service-php
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement
what might fix it is to set the multipart to true not only if a file was received as a parameter, but to check the content-type header parameter instead.
The text was updated successfully, but these errors were encountered: