File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
packages/cli/src/routeGeneration/templates Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,11 @@ export function RegisterRoutes(router: KoaRouter) {
77
77
78
78
{{ #each controllers }}
79
79
{{ #each actions }}
80
+ const args{{ ../name }} _{{ name }} : Record<string , TsoaRoute.ParameterSchema> = {
81
+ {{ #each parameters }}
82
+ {{ @key }} : {{{ json this }}} ,
83
+ {{ /each }}
84
+ };
80
85
router.{{ method }} ('{{ fullPath }} ',
81
86
{{ #if security.length }}
82
87
authenticateMiddleware({{ json security }} ),
@@ -97,15 +102,10 @@ export function RegisterRoutes(router: KoaRouter) {
97
102
...(fetchMiddlewares<Middleware >({{ ../name }} .prototype.{{ name }} )),
98
103
99
104
async function {{ ../name }} _{{ name }} (context: Context, next: Next) {
100
- const args: Record<string , TsoaRoute.ParameterSchema> = {
101
- {{ #each parameters }}
102
- {{ @key }} : {{{ json this }}} ,
103
- {{ /each }}
104
- };
105
105
106
106
let validatedArgs: any[] = [];
107
107
try {
108
- validatedArgs = templateService.getValidatedArgs({ args, context, next });
108
+ validatedArgs = templateService.getValidatedArgs({ args: args {{ ../name }} _ {{ name }} , context, next });
109
109
} catch (err) {
110
110
const error = err as any;
111
111
error.message ||= JSON.stringify({ fields: error.fields });
You can’t perform that action at this time.
0 commit comments