forked from loafle/openapi-generator-original
fix for #224, added safe php comparison
This commit is contained in:
@@ -49,20 +49,20 @@ class {{classname}} {
|
|||||||
$headerParams['Content-Type'] = '{{#consumes}}{{mediaType}}{{#hasMore}},{{/hasMore}}{{/consumes}}';
|
$headerParams['Content-Type'] = '{{#consumes}}{{mediaType}}{{#hasMore}},{{/hasMore}}{{/consumes}}';
|
||||||
|
|
||||||
{{#queryParams}}// query params
|
{{#queryParams}}// query params
|
||||||
if(${{paramName}} != null) {
|
if(${{paramName}} !== null) {
|
||||||
$queryParams['{{paramName}}'] = $this->apiClient->toQueryValue(${{paramName}});
|
$queryParams['{{paramName}}'] = $this->apiClient->toQueryValue(${{paramName}});
|
||||||
}{{/queryParams}}
|
}{{/queryParams}}
|
||||||
{{#headerParams}}// header params
|
{{#headerParams}}// header params
|
||||||
if(${{paramName}} != null) {
|
if(${{paramName}} !== null) {
|
||||||
$headerParams['{{paramName}}'] = $this->apiClient->toHeaderValue(${{paramName}});
|
$headerParams['{{paramName}}'] = $this->apiClient->toHeaderValue(${{paramName}});
|
||||||
}{{/headerParams}}
|
}{{/headerParams}}
|
||||||
{{#pathParams}}// path params
|
{{#pathParams}}// path params
|
||||||
if(${{paramName}} != null) {
|
if(${{paramName}} !== null) {
|
||||||
$resourcePath = str_replace("{" . "{{paramName}}" . "}",
|
$resourcePath = str_replace("{" . "{{paramName}}" . "}",
|
||||||
$this->apiClient->toPathValue(${{paramName}}), $resourcePath);
|
$this->apiClient->toPathValue(${{paramName}}), $resourcePath);
|
||||||
}{{/pathParams}}
|
}{{/pathParams}}
|
||||||
{{#formParams}}
|
{{#formParams}}
|
||||||
if (${{paramName}} != null) {
|
if (${{paramName}} !== null) {
|
||||||
$formParams[{{paramName}}] = {{#isFile}}'@' . {{/isFile}}${{paramName}};
|
$formParams[{{paramName}}] = {{#isFile}}'@' . {{/isFile}}${{paramName}};
|
||||||
}{{/formParams}}
|
}{{/formParams}}
|
||||||
{{#bodyParams}}// body params
|
{{#bodyParams}}// body params
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ class PetApi {
|
|||||||
$headerParams['Content-Type'] = '';
|
$headerParams['Content-Type'] = '';
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
if($status != null) {
|
if($status !== null) {
|
||||||
$queryParams['status'] = $this->apiClient->toQueryValue($status);
|
$queryParams['status'] = $this->apiClient->toQueryValue($status);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,7 +188,7 @@ class PetApi {
|
|||||||
$headerParams['Content-Type'] = '';
|
$headerParams['Content-Type'] = '';
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
if($tags != null) {
|
if($tags !== null) {
|
||||||
$queryParams['tags'] = $this->apiClient->toQueryValue($tags);
|
$queryParams['tags'] = $this->apiClient->toQueryValue($tags);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -240,7 +240,7 @@ class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
// path params
|
// path params
|
||||||
if($petId != null) {
|
if($petId !== null) {
|
||||||
$resourcePath = str_replace("{" . "petId" . "}",
|
$resourcePath = str_replace("{" . "petId" . "}",
|
||||||
$this->apiClient->toPathValue($petId), $resourcePath);
|
$this->apiClient->toPathValue($petId), $resourcePath);
|
||||||
}
|
}
|
||||||
@@ -293,15 +293,15 @@ class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
// path params
|
// path params
|
||||||
if($petId != null) {
|
if($petId !== null) {
|
||||||
$resourcePath = str_replace("{" . "petId" . "}",
|
$resourcePath = str_replace("{" . "petId" . "}",
|
||||||
$this->apiClient->toPathValue($petId), $resourcePath);
|
$this->apiClient->toPathValue($petId), $resourcePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($name != null) {
|
if ($name !== null) {
|
||||||
$formParams[name] = $name;
|
$formParams[name] = $name;
|
||||||
}
|
}
|
||||||
if ($status != null) {
|
if ($status !== null) {
|
||||||
$formParams[status] = $status;
|
$formParams[status] = $status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -344,11 +344,11 @@ class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
// header params
|
// header params
|
||||||
if($api_key != null) {
|
if($api_key !== null) {
|
||||||
$headerParams['api_key'] = $this->apiClient->toHeaderValue($api_key);
|
$headerParams['api_key'] = $this->apiClient->toHeaderValue($api_key);
|
||||||
}
|
}
|
||||||
// path params
|
// path params
|
||||||
if($petId != null) {
|
if($petId !== null) {
|
||||||
$resourcePath = str_replace("{" . "petId" . "}",
|
$resourcePath = str_replace("{" . "petId" . "}",
|
||||||
$this->apiClient->toPathValue($petId), $resourcePath);
|
$this->apiClient->toPathValue($petId), $resourcePath);
|
||||||
}
|
}
|
||||||
@@ -373,13 +373,14 @@ class PetApi {
|
|||||||
* uploadFile
|
* uploadFile
|
||||||
*
|
*
|
||||||
* uploads an image
|
* uploads an image
|
||||||
* additionalMetadata, string: Additional data to pass to server (required)
|
* petId, int: ID of pet to update (required)
|
||||||
|
* * additionalMetadata, string: Additional data to pass to server (required)
|
||||||
* * file, file: file to upload (required)
|
* * file, file: file to upload (required)
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public function uploadFile($additionalMetadata, $file) {
|
public function uploadFile($petId, $additionalMetadata, $file) {
|
||||||
|
|
||||||
// parse inputs
|
// parse inputs
|
||||||
$resourcePath = "/pet/{petId}/uploadImage";
|
$resourcePath = "/pet/{petId}/uploadImage";
|
||||||
@@ -393,12 +394,16 @@ class PetApi {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// path params
|
||||||
|
if($petId !== null) {
|
||||||
|
$resourcePath = str_replace("{" . "petId" . "}",
|
||||||
|
$this->apiClient->toPathValue($petId), $resourcePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($additionalMetadata !== null) {
|
||||||
if ($additionalMetadata != null) {
|
|
||||||
$formParams[additionalMetadata] = $additionalMetadata;
|
$formParams[additionalMetadata] = $additionalMetadata;
|
||||||
}
|
}
|
||||||
if ($file != null) {
|
if ($file !== null) {
|
||||||
$formParams[file] = '@' . $file;
|
$formParams[file] = '@' . $file;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ class StoreApi {
|
|||||||
|
|
||||||
|
|
||||||
// path params
|
// path params
|
||||||
if($orderId != null) {
|
if($orderId !== null) {
|
||||||
$resourcePath = str_replace("{" . "orderId" . "}",
|
$resourcePath = str_replace("{" . "orderId" . "}",
|
||||||
$this->apiClient->toPathValue($orderId), $resourcePath);
|
$this->apiClient->toPathValue($orderId), $resourcePath);
|
||||||
}
|
}
|
||||||
@@ -198,7 +198,7 @@ class StoreApi {
|
|||||||
|
|
||||||
|
|
||||||
// path params
|
// path params
|
||||||
if($orderId != null) {
|
if($orderId !== null) {
|
||||||
$resourcePath = str_replace("{" . "orderId" . "}",
|
$resourcePath = str_replace("{" . "orderId" . "}",
|
||||||
$this->apiClient->toPathValue($orderId), $resourcePath);
|
$this->apiClient->toPathValue($orderId), $resourcePath);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -184,10 +184,10 @@ class UserApi {
|
|||||||
$headerParams['Content-Type'] = '';
|
$headerParams['Content-Type'] = '';
|
||||||
|
|
||||||
// query params
|
// query params
|
||||||
if($username != null) {
|
if($username !== null) {
|
||||||
$queryParams['username'] = $this->apiClient->toQueryValue($username);
|
$queryParams['username'] = $this->apiClient->toQueryValue($username);
|
||||||
}// query params
|
}// query params
|
||||||
if($password != null) {
|
if($password !== null) {
|
||||||
$queryParams['password'] = $this->apiClient->toQueryValue($password);
|
$queryParams['password'] = $this->apiClient->toQueryValue($password);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,7 +279,7 @@ class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
// path params
|
// path params
|
||||||
if($username != null) {
|
if($username !== null) {
|
||||||
$resourcePath = str_replace("{" . "username" . "}",
|
$resourcePath = str_replace("{" . "username" . "}",
|
||||||
$this->apiClient->toPathValue($username), $resourcePath);
|
$this->apiClient->toPathValue($username), $resourcePath);
|
||||||
}
|
}
|
||||||
@@ -331,7 +331,7 @@ class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
// path params
|
// path params
|
||||||
if($username != null) {
|
if($username !== null) {
|
||||||
$resourcePath = str_replace("{" . "username" . "}",
|
$resourcePath = str_replace("{" . "username" . "}",
|
||||||
$this->apiClient->toPathValue($username), $resourcePath);
|
$this->apiClient->toPathValue($username), $resourcePath);
|
||||||
}
|
}
|
||||||
@@ -380,7 +380,7 @@ class UserApi {
|
|||||||
|
|
||||||
|
|
||||||
// path params
|
// path params
|
||||||
if($username != null) {
|
if($username !== null) {
|
||||||
$resourcePath = str_replace("{" . "username" . "}",
|
$resourcePath = str_replace("{" . "username" . "}",
|
||||||
$this->apiClient->toPathValue($username), $resourcePath);
|
$this->apiClient->toPathValue($username), $resourcePath);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user