diff --git a/CHANGELOG b/CHANGELOG index 2850ad8487..55d9da933d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,23 @@ -v2.3.0-beta1 (2014-11-01) -------------------------- +v2.3.0 (XXXX-XX-XX) +------------------- + +* fixed issue #1075: Aardvark: user name required even if auth is off #1075 + + The fix for this prefills the username input field with the current user's + accout name if any and `root` (the default username) otherwise. Additionally, + the tooltip text has been slightly adjusted. + +* fixed issue #1069: Add 'raw' link to swagger ui so that the raw swagger + json can easily be retrieved + + This adds a link to the Swagger API docs to an application's detail view in + the **Applications** tab of the web interface. The link produces the Swagger + JSON directly. If authentication is turned on, the link requires authentication, + too. + + +v2.3.0-beta (2014-11-01) +------------------------ * added dedicated `NOT IN` operator for AQL diff --git a/js/apps/system/aardvark/aardvark.js b/js/apps/system/aardvark/aardvark.js index 8dc3248e46..fca0da4914 100644 --- a/js/apps/system/aardvark/aardvark.js +++ b/js/apps/system/aardvark/aardvark.js @@ -282,16 +282,17 @@ controller.get('/docus', function (req, res) { + " foxxes and supplies the paths for the swagger documentation"); /** Get Documentation for one Foxx * - * Get the complete documentation availabloe for one Foxx + * Get the complete documentation available for one Foxx * */ controller.get("/docu/:key",function (req, res) { var subPath = req.path.substr(0, req.path.lastIndexOf("[") - 1), key = req.params("key"), - path = req.protocol + "://" + req.headers.host + "/_db/" + req.database + subPath + "/" + key + "/"; + path = req.protocol + "://" + req.headers.host + + "/_db/" + encodeURIComponent(req.database) + subPath + "/" + encodeURIComponent(key) + "/"; res.json(docus.listOne(path, key)); -}).summary("List documentation of all foxxes.") +}).summary("List documentation of one foxxes.") .notes("This function simply returns one specific" + " foxx and supplies the paths for the swagger documentation"); @@ -309,6 +310,27 @@ controller.get('/docu/:key/*', function(req, res) { }).summary("List the API for one foxx") .notes("This function lists the API of the foxx" + " running under the given mount point"); + +/** Subroutes for API Documentation + * + * Get the Elements of the API Documentation subroutes + * + */ +controller.get('/swagger/:mount', function(req, res) { + var subPath = req.path.substr(0, req.path.lastIndexOf("[") - 1), + mount = decodeURIComponent(req.params("mount")), + path = req.protocol + "://" + req.headers.host + + "/_db/" + encodeURIComponent(req.database) + subPath + "/" + encodeURIComponent(mount) + "/", + candidate = db._aal.firstExample({ mount: mount }); + + if (candidate === null) { + throw "no entry found for mount"; + } + res.json(docus.show(mount)); +// res.json(docus.listOneForMount(path, mount)); +}).summary("Returns the generated Swagger JSON description for one foxx") + .notes("This function returns the Swagger JSON API description of the foxx" + + " running under the given mount point"); /** Move Foxx to other Mount * diff --git a/js/apps/system/aardvark/frontend/js/templates/foxxEditView.ejs b/js/apps/system/aardvark/frontend/js/templates/foxxEditView.ejs index b71584c6e4..23a01a575b 100644 --- a/js/apps/system/aardvark/frontend/js/templates/foxxEditView.ejs +++ b/js/apps/system/aardvark/frontend/js/templates/foxxEditView.ejs @@ -12,8 +12,8 @@