diff --git a/js/server/modules/@arangodb/foxx/routing.js b/js/server/modules/@arangodb/foxx/routing.js index 66e012b73e..4ddf358912 100644 --- a/js/server/modules/@arangodb/foxx/routing.js +++ b/js/server/modules/@arangodb/foxx/routing.js @@ -130,7 +130,7 @@ exports.routeApp = function (service, throwOnErrors) { return { exports: service.main.exports, routes: service.routes, - docs: service.docs + docs: service.legacy ? null : service.docs }; } @@ -170,7 +170,6 @@ exports.routeApp = function (service, throwOnErrors) { if (service.manifest.main) { try { service.main.exports = service.run(service.manifest.main); - // TODO mount routes } catch (e) { console.errorLines(`Cannot execute Foxx service at ${service.mount}: ${e.stack}`); error = e; @@ -187,7 +186,8 @@ exports.routeApp = function (service, throwOnErrors) { return { exports: service.main.exports, - routes: error ? createBrokenServiceRoute(service, error) : service.routes + routes: error ? createBrokenServiceRoute(service, error) : service.routes, + docs: service.legacy ? null : service.docs }; }; diff --git a/js/server/modules/@arangodb/foxx/swagger.js b/js/server/modules/@arangodb/foxx/swagger.js index 8cc3e3f266..e11b4c3d7f 100644 --- a/js/server/modules/@arangodb/foxx/swagger.js +++ b/js/server/modules/@arangodb/foxx/swagger.js @@ -114,7 +114,7 @@ function swaggerJson(req, res, opts) { } let docs = foxx.docs; if (!docs) { - var app = foxx.routes.foxxContext && foxx.routes.foxxContext.app; + var app = foxx.routes.foxxContext && foxx.routes.foxxContext.service; var swagger = parseRoutes(opts.appPath, foxx.routes.routes, foxx.routes.models); docs = { swagger: '2.0',