Refixed Swagger.php

reincluded the check for argument "serialize".

added to array typecast for resource object.