[BUG][PHP] ObjectSerializer.php throws ValueError when handling \SplFileObject type
Created by: robertsjumis
Description
/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php
ObjectSerializer.php throws ValueError when handling \SplFileObject type @ line 336. This is because SplFileObject can be passed to settype(), which then throws the said error.
There is no reason to handle 'object', 'mixed', '\DateTime' in line 336, because they're handled before.
Also - there is no reason for line 336 to handle '\SplFileObject', because this specific object type is handled below.
The said object types should be deleted from the array.
openapi-generator version
5.3.0. - 6.0.0.
OpenAPI declaration file content or url
.../samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php
Line 336
Generation Details
php client
Steps to reproduce
- Find an endpoint that returns a PDF file.
- Generate PHP client that makes a GET request to the said endpoint.
- Use client to call the endpoint.
Related issues/PRs
Suggest a fix
replace line 336 with:
if (in_array($class, ['array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'number', 'string', 'void'], true)) {