Skip to content

Commit 61ea956

Browse files
committed
building a fix for postData that will pass TravisCI build
1 parent bfc1493 commit 61ea956

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/main/resources/php/Swagger.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class APIClient {
6666
}
6767

6868
if (is_object($postData) or is_array($postData)) {
69-
$postData = http_build_query($this->sanitizeForSerialization($postData));
69+
$postData = json_encode($this->sanitizeForSerialization($postData));
7070
}
7171

7272
$url = $this->apiServer . $resourcePath;

src/main/resources/php/api.mustache

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ class {{classname}} {
7777
{{/formParams}}
7878
if (empty($body)) {
7979
$body = null;
80+
} else if (strpos($headerParams['Content-Type'], "application/x-www-form-urlencoded") > -1) {
81+
$body = http_build_query($body);
8082
}
8183

8284
// Make the API Call

0 commit comments

Comments
 (0)