diff --git a/lib/swagger.js b/lib/swagger.js index 16b35e3..47d0487 100644 --- a/lib/swagger.js +++ b/lib/swagger.js @@ -209,8 +209,11 @@ function addRoute(app, uri, doc, opts, version) { doc.basePath = prefix + host + initialPath; } if (version === '2.0') { - doc.host = req.hostname; + doc.host = req.get('host'); doc.info.title = 'REST APIs for ' + pkg.name; + doc.definitions.any = doc.definitions.object = { + properties: {} + }; } res.status(200).send(doc); });