diff --git a/js/server/modules/org/arangodb/foxx/request_context.js b/js/server/modules/org/arangodb/foxx/request_context.js index 8684173bb4..67ac2ff939 100644 --- a/js/server/modules/org/arangodb/foxx/request_context.js +++ b/js/server/modules/org/arangodb/foxx/request_context.js @@ -142,6 +142,7 @@ RequestContext = function (executionBuffer, models, route) { this.route = route; this.typeToRegex = { "int": "/[0-9]+/", + "integer": "/[0-9]+/", "string": "/.+/" }; @@ -185,6 +186,9 @@ extend(RequestContext.prototype, { constraint = url.constraint || {}; constraint[paramName] = this.typeToRegex[attributes.type]; + if (!constraint[paramName]) { + throw new Error("Illegal attribute type: " + attributes.type); + } this.route.url = internal.constructUrlObject(url.match, constraint, url.methods[0]); this.docs.addPathParam(paramName, attributes.description, attributes.type); return this;