@@ -3189,34 +3189,15 @@ public function uploadImageFullFormDataNestedWithHttpInfo($pet_id, $pet = null,
31893189
31903190 switch ($ statusCode ) {
31913191 case 200 :
3192- if ('\OpenAPI\Client\Model\ApiResponse ' === '\SplFileObject ' ) {
3193- $ content = $ response ->getBody (); //stream goes to serializer
3194- } else {
3195- $ content = (string ) $ response ->getBody ();
3196- if ('\OpenAPI\Client\Model\ApiResponse ' !== 'string ' ) {
3197- try {
3198- $ content = json_decode ($ content , false , 512 , JSON_THROW_ON_ERROR );
3199- } catch (\JsonException $ exception ) {
3200- throw new ApiException (
3201- sprintf (
3202- 'Error JSON decoding server response (%s) ' ,
3203- $ request ->getUri ()
3204- ),
3205- $ statusCode ,
3206- $ response ->getHeaders (),
3207- $ content
3208- );
3209- }
3210- }
3211- }
3212-
3213- return [
3214- ObjectSerializer::deserialize ($ content , '\OpenAPI\Client\Model\ApiResponse ' , []),
3215- $ response ->getStatusCode (),
3216- $ response ->getHeaders ()
3217- ];
3192+ return $ this ->handleResponseWithDataType (
3193+ '\OpenAPI\Client\Model\ApiResponse ' ,
3194+ $ request ,
3195+ $ response ,
3196+ );
32183197 }
32193198
3199+
3200+
32203201 if ($ statusCode < 200 || $ statusCode > 299 ) {
32213202 throw new ApiException (
32223203 sprintf (
@@ -3230,34 +3211,11 @@ public function uploadImageFullFormDataNestedWithHttpInfo($pet_id, $pet = null,
32303211 );
32313212 }
32323213
3233- $ returnType = '\OpenAPI\Client\Model\ApiResponse ' ;
3234- if ($ returnType === '\SplFileObject ' ) {
3235- $ content = $ response ->getBody (); //stream goes to serializer
3236- } else {
3237- $ content = (string ) $ response ->getBody ();
3238- if ($ returnType !== 'string ' ) {
3239- try {
3240- $ content = json_decode ($ content , false , 512 , JSON_THROW_ON_ERROR );
3241- } catch (\JsonException $ exception ) {
3242- throw new ApiException (
3243- sprintf (
3244- 'Error JSON decoding server response (%s) ' ,
3245- $ request ->getUri ()
3246- ),
3247- $ statusCode ,
3248- $ response ->getHeaders (),
3249- $ content
3250- );
3251- }
3252- }
3253- }
3254-
3255- return [
3256- ObjectSerializer::deserialize ($ content , $ returnType , []),
3257- $ response ->getStatusCode (),
3258- $ response ->getHeaders ()
3259- ];
3260-
3214+ return $ this ->handleResponseWithDataType (
3215+ '\OpenAPI\Client\Model\ApiResponse ' ,
3216+ $ request ,
3217+ $ response ,
3218+ );
32613219 } catch (ApiException $ e ) {
32623220 switch ($ e ->getCode ()) {
32633221 case 200 :
@@ -3267,8 +3225,10 @@ public function uploadImageFullFormDataNestedWithHttpInfo($pet_id, $pet = null,
32673225 $ e ->getResponseHeaders ()
32683226 );
32693227 $ e ->setResponseObject ($ data );
3270- break ;
3228+ throw $ e ;
32713229 }
3230+
3231+
32723232 throw $ e ;
32733233 }
32743234 }
0 commit comments