Serializer/Job/SerializationHelper.php
public function serializeReturnValue($type, $value)
    {
        $jobType = $this->registry->get($type);

        return $this->serializer->serialize($value, 'json', $this->getResponseSerializationContext($jobType));
    }
public function serializeReturnValue($type, $value)
    {
        $jobType = $this->registry->get($type);

        return $this->serializer->serialize($value, 'json', $this->getResponseSerializationContext($jobType));
    }
Serializes the return value of a job.

@param string $type The job type
@param mixed  $value
@return string