1
0
Fork 0

Store path (pattern) in RequestContext#path.

This commit is contained in:
Alan Plum 2015-05-07 01:28:50 +02:00
parent 1cd0d0aa10
commit 0b410eb628
2 changed files with 9 additions and 9 deletions

View File

@ -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) {

View File

@ -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]+/",