Skip to content

Adding coersion of string 'true' 'false' etc to into true booleans via filter_var function in OrdersV0 ObjectSerializer #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/Clients/OrdersV0/ObjectSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* The Selling Partner API for Orders helps you programmatically retrieve order information. These APIs let you develop fast, flexible, custom applications in areas like order synchronization, order research, and demand-based decision support tools. The Orders API only supports orders that are less than two years old. Orders more than two years old will not show in the API response.
*
* OpenAPI spec version: v0
*
*
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 3.3.4
*/
Expand Down Expand Up @@ -274,7 +274,11 @@ public static function deserialize($data, $class, $httpHeaders = null)
return null;
}
} elseif (in_array($class, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) {
settype($data, $class);
if (in_array($class, ['bool', 'boolean']) && !is_null($data)) {
$data = filter_var($data, FILTER_VALIDATE_BOOLEAN);
} else {
settype($data, $class);
}
return $data;
} elseif ($class === '\SplFileObject') {
/** @var \Psr\Http\Message\StreamInterface $data */
Expand Down