From 1aa671ed8cc7ad844e1f0dac236b93fe0303f53d Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Thu, 12 Jun 2014 13:42:46 +0200 Subject: [PATCH 1/2] fixed string constraints --- js/server/modules/org/arangodb/foxx/request_context.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/server/modules/org/arangodb/foxx/request_context.js b/js/server/modules/org/arangodb/foxx/request_context.js index 07d081f957..aa5b0ec4dc 100644 --- a/js/server/modules/org/arangodb/foxx/request_context.js +++ b/js/server/modules/org/arangodb/foxx/request_context.js @@ -143,7 +143,7 @@ RequestContext = function (executionBuffer, models, route) { this.typeToRegex = { "int": "/[0-9]+/", "integer": "/[0-9]+/", - "string": "/.+/" + "string": "/[^/]+/" }; this.docs = new SwaggerDocs(this.route.docs, models); From cec32b981a596f42ed8aa2ed3145f94828d29708 Mon Sep 17 00:00:00 2001 From: Lucas Dohmen Date: Thu, 12 Jun 2014 14:24:50 +0200 Subject: [PATCH 2/2] Adjust tests to @fceller's bug fix --- js/server/tests/shell-foxx.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/server/tests/shell-foxx.js b/js/server/tests/shell-foxx.js index af9972371c..0edbace73c 100644 --- a/js/server/tests/shell-foxx.js +++ b/js/server/tests/shell-foxx.js @@ -283,7 +283,7 @@ function DocumentationAndConstraintsSpec () { assertEqual(routes.length, 1); - assertEqual(routes[0].url.constraint.foxx, "/.+/"); + assertEqual(routes[0].url.constraint.foxx, "/[^/]+/"); assertEqual(routes[0].docs.parameters[0].paramType, "path"); assertEqual(routes[0].docs.parameters[0].name, "foxx"); assertEqual(routes[0].docs.parameters[0].description, "Kind of Foxx"); @@ -309,7 +309,7 @@ function DocumentationAndConstraintsSpec () { assertEqual(routes.length, 1); - assertEqual(routes[0].url.constraint.foxxParam, "/.+/"); + assertEqual(routes[0].url.constraint.foxxParam, "/[^/]+/"); assertEqual(routes[0].docs.parameters[0].paramType, "path"); assertEqual(routes[0].docs.parameters[0].name, "foxxParam"); assertEqual(routes[0].docs.parameters[0].description, "Kind of Foxx");