Refixed Swagger.php

reincluded the check for argument "serialize".
Small fix

Export resource as array