Skip to content

Commit

Permalink
fix(php): update petstore samples
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahdi Dibaiee committed Nov 12, 2019
1 parent d4e1529 commit d50fe62
Show file tree
Hide file tree
Showing 15 changed files with 223 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ protected function call123TestSpecialTagsRequest($body)




// body params
$_tempBody = null;
if (isset($body)) {
Expand Down
97 changes: 80 additions & 17 deletions samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ protected function createXmlItemRequest($xml_item)




// body params
$_tempBody = null;
if (isset($xml_item)) {
Expand Down Expand Up @@ -524,6 +525,7 @@ protected function fakeOuterBooleanSerializeRequest($body = null)




// body params
$_tempBody = null;
if (isset($body)) {
Expand Down Expand Up @@ -781,6 +783,7 @@ protected function fakeOuterCompositeSerializeRequest($body = null)




// body params
$_tempBody = null;
if (isset($body)) {
Expand Down Expand Up @@ -1038,6 +1041,7 @@ protected function fakeOuterNumberSerializeRequest($body = null)




// body params
$_tempBody = null;
if (isset($body)) {
Expand Down Expand Up @@ -1295,6 +1299,7 @@ protected function fakeOuterStringSerializeRequest($body = null)




// body params
$_tempBody = null;
if (isset($body)) {
Expand Down Expand Up @@ -1510,6 +1515,7 @@ protected function testBodyWithFileSchemaRequest($body)




// body params
$_tempBody = null;
if (isset($body)) {
Expand Down Expand Up @@ -1734,12 +1740,18 @@ protected function testBodyWithQueryParamsRequest($query, $body)
$httpBody = '';
$multipart = false;


// query params
if (is_array($query)) {
$query = ObjectSerializer::serializeCollection($query, '', true);
}
if ($query !== null) {
$queryParams['query'] = ObjectSerializer::toQueryValue($query);
$queryParams['query'] = $query;
}




// body params
$_tempBody = null;
if (isset($body)) {
Expand Down Expand Up @@ -2007,6 +2019,7 @@ protected function testClientModelRequest($body)




// body params
$_tempBody = null;
if (isset($body)) {
Expand Down Expand Up @@ -2356,6 +2369,7 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with




// form params
if ($integer !== null) {
$formParams['integer'] = ObjectSerializer::toFormValue($integer);
Expand Down Expand Up @@ -2660,25 +2674,43 @@ protected function testEnumParametersRequest($enum_header_string_array = null, $
$httpBody = '';
$multipart = false;


// query params
if (is_array($enum_query_string_array)) {
$enum_query_string_array = ObjectSerializer::serializeCollection($enum_query_string_array, 'csv', true);
}
if ($enum_query_string_array !== null) {
$queryParams['enum_query_string_array'] = ObjectSerializer::toQueryValue($enum_query_string_array);
$queryParams['enum_query_string_array'] = $enum_query_string_array;
}


// query params
if (is_array($enum_query_string)) {
$enum_query_string = ObjectSerializer::serializeCollection($enum_query_string, '', true);
}
if ($enum_query_string !== null) {
$queryParams['enum_query_string'] = ObjectSerializer::toQueryValue($enum_query_string);
$queryParams['enum_query_string'] = $enum_query_string;
}


// query params
if (is_array($enum_query_integer)) {
$enum_query_integer = ObjectSerializer::serializeCollection($enum_query_integer, '', true);
}
if ($enum_query_integer !== null) {
$queryParams['enum_query_integer'] = ObjectSerializer::toQueryValue($enum_query_integer);
$queryParams['enum_query_integer'] = $enum_query_integer;
}


// query params
if (is_array($enum_query_double)) {
$enum_query_double = ObjectSerializer::serializeCollection($enum_query_double, '', true);
}
if ($enum_query_double !== null) {
$queryParams['enum_query_double'] = ObjectSerializer::toQueryValue($enum_query_double);
$queryParams['enum_query_double'] = $enum_query_double;
}


// header params
if (is_array($enum_header_string_array)) {
$enum_header_string_array = ObjectSerializer::serializeCollection($enum_header_string_array, 'csv');
Expand Down Expand Up @@ -2969,22 +3001,43 @@ protected function testGroupParametersRequest($associative_array)
$httpBody = '';
$multipart = false;


// query params
if (is_array($required_string_group)) {
$required_string_group = ObjectSerializer::serializeCollection($required_string_group, '', true);
}
if ($required_string_group !== null) {
$queryParams['required_string_group'] = ObjectSerializer::toQueryValue($required_string_group);
$queryParams['required_string_group'] = $required_string_group;
}


// query params
if (is_array($required_int64_group)) {
$required_int64_group = ObjectSerializer::serializeCollection($required_int64_group, '', true);
}
if ($required_int64_group !== null) {
$queryParams['required_int64_group'] = ObjectSerializer::toQueryValue($required_int64_group);
$queryParams['required_int64_group'] = $required_int64_group;
}


// query params
if (is_array($string_group)) {
$string_group = ObjectSerializer::serializeCollection($string_group, '', true);
}
if ($string_group !== null) {
$queryParams['string_group'] = ObjectSerializer::toQueryValue($string_group);
$queryParams['string_group'] = $string_group;
}


// query params
if (is_array($int64_group)) {
$int64_group = ObjectSerializer::serializeCollection($int64_group, '', true);
}
if ($int64_group !== null) {
$queryParams['int64_group'] = ObjectSerializer::toQueryValue($int64_group);
$queryParams['int64_group'] = $int64_group;
}


// header params
if ($required_boolean_group !== null) {
$headerParams['required_boolean_group'] = ObjectSerializer::toHeaderValue($required_boolean_group);
Expand Down Expand Up @@ -3211,6 +3264,7 @@ protected function testInlineAdditionalPropertiesRequest($param)




// body params
$_tempBody = null;
if (isset($param)) {
Expand Down Expand Up @@ -3441,6 +3495,7 @@ protected function testJsonFormDataRequest($param, $param2)




// form params
if ($param !== null) {
$formParams['param'] = ObjectSerializer::toFormValue($param);
Expand Down Expand Up @@ -3703,43 +3758,51 @@ protected function testQueryParameterCollectionFormatRequest($pipe, $ioutil, $ht
$httpBody = '';
$multipart = false;


// query params
if (is_array($pipe)) {
$pipe = ObjectSerializer::serializeCollection($pipe, 'csv', true);
}
if ($pipe !== null) {
$queryParams['pipe'] = ObjectSerializer::toQueryValue($pipe);
$queryParams['pipe'] = $pipe;
}


// query params
if (is_array($ioutil)) {
$ioutil = ObjectSerializer::serializeCollection($ioutil, 'csv', true);
}
if ($ioutil !== null) {
$queryParams['ioutil'] = ObjectSerializer::toQueryValue($ioutil);
$queryParams['ioutil'] = $ioutil;
}


// query params
if (is_array($http)) {
$http = ObjectSerializer::serializeCollection($http, 'space', true);
}
if ($http !== null) {
$queryParams['http'] = ObjectSerializer::toQueryValue($http);
$queryParams['http'] = $http;
}


// query params
if (is_array($url)) {
$url = ObjectSerializer::serializeCollection($url, 'csv', true);
}
if ($url !== null) {
$queryParams['url'] = ObjectSerializer::toQueryValue($url);
$queryParams['url'] = $url;
}


// query params
if (is_array($context)) {
$context = ObjectSerializer::serializeCollection($context, 'multi', true);
}
if ($context !== null) {
$queryParams['context'] = ObjectSerializer::toQueryValue($context);
$queryParams['context'] = $context;
}




// body params
$_tempBody = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ protected function testClassnameRequest($body)




// body params
$_tempBody = null;
if (isset($body)) {
Expand Down
17 changes: 15 additions & 2 deletions samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ protected function addPetRequest($body)




// body params
$_tempBody = null;
if (isset($body)) {
Expand Down Expand Up @@ -493,6 +494,7 @@ protected function deletePetRequest($pet_id, $api_key = null)
$httpBody = '';
$multipart = false;


// header params
if ($api_key !== null) {
$headerParams['api_key'] = ObjectSerializer::toHeaderValue($api_key);
Expand Down Expand Up @@ -773,15 +775,18 @@ protected function findPetsByStatusRequest($status)
$httpBody = '';
$multipart = false;


// query params
if (is_array($status)) {
$status = ObjectSerializer::serializeCollection($status, 'csv', true);
}
if ($status !== null) {
$queryParams['status'] = ObjectSerializer::toQueryValue($status);
$queryParams['status'] = $status;
}




// body params
$_tempBody = null;

Expand Down Expand Up @@ -1048,15 +1053,18 @@ protected function findPetsByTagsRequest($tags)
$httpBody = '';
$multipart = false;


// query params
if (is_array($tags)) {
$tags = ObjectSerializer::serializeCollection($tags, 'csv', true);
}
if ($tags !== null) {
$queryParams['tags'] = ObjectSerializer::toQueryValue($tags);
$queryParams['tags'] = $tags;
}




// body params
$_tempBody = null;

Expand Down Expand Up @@ -1324,6 +1332,7 @@ protected function getPetByIdRequest($pet_id)
$multipart = false;



// path params
if ($pet_id !== null) {
$resourcePath = str_replace(
Expand Down Expand Up @@ -1554,6 +1563,7 @@ protected function updatePetRequest($body)




// body params
$_tempBody = null;
if (isset($body)) {
Expand Down Expand Up @@ -1786,6 +1796,7 @@ protected function updatePetWithFormRequest($pet_id, $name = null, $status = nul
$multipart = false;



// path params
if ($pet_id !== null) {
$resourcePath = str_replace(
Expand Down Expand Up @@ -2080,6 +2091,7 @@ protected function uploadFileRequest($pet_id, $additional_metadata = null, $file
$multipart = false;



// path params
if ($pet_id !== null) {
$resourcePath = str_replace(
Expand Down Expand Up @@ -2381,6 +2393,7 @@ protected function uploadFileWithRequiredFileRequest($pet_id, $required_file, $a
$multipart = false;



// path params
if ($pet_id !== null) {
$resourcePath = str_replace(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ protected function deleteOrderRequest($order_id)
$multipart = false;



// path params
if ($order_id !== null) {
$resourcePath = str_replace(
Expand Down Expand Up @@ -528,6 +529,7 @@ protected function getInventoryRequest()




// body params
$_tempBody = null;

Expand Down Expand Up @@ -803,6 +805,7 @@ protected function getOrderByIdRequest($order_id)
$multipart = false;



// path params
if ($order_id !== null) {
$resourcePath = str_replace(
Expand Down Expand Up @@ -1076,6 +1079,7 @@ protected function placeOrderRequest($body)




// body params
$_tempBody = null;
if (isset($body)) {
Expand Down
Loading

0 comments on commit d50fe62

Please sign in to comment.