in src/Transform/Functions.php [196:238]
public static function serializeInputLite(RequestModel $request, OperationInput $input, array $customSerializer = []): OperationInput
{
$ro = new \ReflectionObject($request);
//headers
$hp = $ro->getProperty('headers');
$hp->setAccessible(true);
$h = $hp->getValue($request);
if (is_array($h)) {
foreach ($h as $key => $value) {
$input->setHeader($key, (string)$value);
}
}
//parameters
$pp = $ro->getProperty('parameters');
$pp->setAccessible(true);
$p = $pp->getValue($request);
if (is_array($p)) {
foreach ($p as $key => $value) {
$input->setParameter($key, (string)$value);
}
}
//payload
$pd = $ro->getProperty('payload');
$pd->setAccessible(true);
$payload = $pd->getValue($request);
if ($payload instanceof \Psr\Http\Message\StreamInterface) {
$input->setBody($payload);
}
// custom serializer
foreach ($customSerializer as $serializer) {
if (\is_callable($serializer)) {
$serializer($request, $input);
} else {
call_user_func($serializer, $request, $input);
}
}
return $input;
}