Skip to content

Commit

Permalink
updates for Coldbox 7 router which does not scope a handler on certai…
Browse files Browse the repository at this point in the history
…n declarations
  • Loading branch information
jclausen committed Sep 24, 2024
1 parent 73e21cf commit c700aeb
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions models/RoutesParser.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ component accessors="true" threadsafe singleton {
appendFunctionInfo(
methodName = methodName,
method = path[ lCase( methodName ) ],
functionName = actions[ methodList ],
functionName = listLast( actions[ methodList ], "." ),
handlerMetadata = arguments.handlerMetadata,
moduleName = len( arguments.routeConfig.module ) ? arguments.routeConfig.module : javacast(
"null",
Expand Down Expand Up @@ -424,10 +424,14 @@ component accessors="true" threadsafe singleton {
* @throws cbSwagger.RoutesParse.handlerSyntaxException
*/
private any function getHandlerMetadata( required any route ){
var handlerRoute = ( isNull( arguments.route.handler ) ? "" : arguments.route.handler );
var module = ( isNull( arguments.route.module ) ? "" : arguments.route.module );
var handlerRoute = ( isNull( arguments.route.handler ) ? "" : arguments.route.handler );
var fullEvent = ( isNull( arguments.route.event ) ? "" : arguments.route.event );

if( !len( handlerRoute ) && isStruct( arguments.route.action ) ){
var fullEvent = arguments.route.action[ arguments.route.action.keyArray().first() ];
}

// Do event's first, if found, use it for the handler location
if ( len( fullEvent ) ) {
// remove last part which should be the action
Expand Down Expand Up @@ -480,6 +484,10 @@ component accessors="true" threadsafe singleton {
); // Name

arguments.method[ "x-coldbox-operation" ] = operationPath & "." & arguments.functionName;
if( findnoCase( "timers.timers", arguments.method[ "x-coldbox-operation" ] ) ){
writeDUmp( arguments );
abort;
}
arguments.method[ "operationId" ] = arguments.method[ "x-coldbox-operation" ];
arguments.functionMetaData = getFunctionMetaData( arguments.functionName, arguments.handlerMetadata );
// Process function metadata
Expand Down

0 comments on commit c700aeb

Please sign in to comment.