mirror of https://gitee.com/bigwinds/arangodb
Store path (pattern) in RequestContext#path.
This commit is contained in:
parent
1cd0d0aa10
commit
0b410eb628
|
@ -148,13 +148,13 @@ extend(Controller.prototype, {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
handleRequest: function (method, route, callback) {
|
||||
var constraints = {queryParams: {}, urlParams: {}},
|
||||
newRoute = internal.constructRoute(method, route, callback, this, constraints),
|
||||
requestContext = new RequestContext(
|
||||
this.allRoutes, this.models, newRoute, this.rootElement, constraints, this.extensions
|
||||
),
|
||||
summary,
|
||||
undocumentedBody;
|
||||
var constraints = {queryParams: {}, urlParams: {}};
|
||||
var newRoute = internal.constructRoute(method, route, callback, this, constraints);
|
||||
var requestContext = new RequestContext(
|
||||
this.allRoutes, this.models, newRoute, route, this.rootElement, constraints, this.extensions
|
||||
);
|
||||
var summary;
|
||||
var undocumentedBody;
|
||||
|
||||
this.routingInfo.routes.push(newRoute);
|
||||
|
||||
|
@ -758,7 +758,6 @@ extend(Controller.prototype, {
|
|||
///
|
||||
/// @endDocuBlock
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extend: function(extensions) {
|
||||
var attr;
|
||||
for (attr in extensions) {
|
||||
|
|
|
@ -112,7 +112,8 @@ function validateOrThrow(raw, schema, allowInvalid) {
|
|||
/// Used for documenting and constraining the routes.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function RequestContext(executionBuffer, models, route, rootElement, constraints, extensions) {
|
||||
function RequestContext(executionBuffer, models, route, path, rootElement, constraints, extensions) {
|
||||
this.path = path;
|
||||
this.route = route;
|
||||
this.typeToRegex = {
|
||||
"int": "/[0-9]+/",
|
||||
|
|
Loading…
Reference in New Issue