File tree Expand file tree Collapse file tree 3 files changed +18
-18
lines changed
packages/cli/src/routeGeneration/templates Expand file tree Collapse file tree 3 files changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,11 @@ export function RegisterRoutes(app: Router) {
81
81
82
82
{{ #each controllers }}
83
83
{{ #each actions }}
84
+ const args{{ ../name }} _{{ name }} : Record<string , TsoaRoute.ParameterSchema> = {
85
+ {{ #each parameters }}
86
+ {{ @key }} : {{{ json this }}} ,
87
+ {{ /each }}
88
+ };
84
89
app.{{ method }} ('{{ fullPath }} ',
85
90
{{ #if security.length }}
86
91
authenticateMiddleware({{ json security }} ),
@@ -101,17 +106,12 @@ export function RegisterRoutes(app: Router) {
101
106
...(fetchMiddlewares<RequestHandler >({{ ../name }} .prototype.{{ name }} )),
102
107
103
108
async function {{ ../name }} _{{ name }} (request: ExRequest, response: ExResponse, next: any) {
104
- const args: Record<string , TsoaRoute.ParameterSchema> = {
105
- {{ #each parameters }}
106
- {{ @key }} : {{{ json this }}} ,
107
- {{ /each }}
108
- };
109
109
110
110
// WARNING: This file was auto-generated with tsoa. Please do not modify it. Re-run tsoa to re-generate this file: https://github.com/lukeautry/tsoa
111
111
112
112
let validatedArgs: any[] = [];
113
113
try {
114
- validatedArgs = templateService.getValidatedArgs({ args, request, response });
114
+ validatedArgs = templateService.getValidatedArgs({ args: args {{ ../name }} _ {{ name }} , request, response });
115
115
116
116
{{ #if ../../iocModule }}
117
117
const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer;
Original file line number Diff line number Diff line change @@ -59,6 +59,11 @@ export function RegisterRoutes(server: any) {
59
59
// ###########################################################################################################
60
60
{{ #each controllers }}
61
61
{{ #each actions }}
62
+ const args{{ ../name }} _{{ name }} : Record<string , TsoaRoute.ParameterSchema> = {
63
+ {{ #each parameters }}
64
+ {{ @key }} : {{{ json this }}} ,
65
+ {{ /each }}
66
+ };
62
67
server.route({
63
68
method: '{{ method }} ',
64
69
path: '{{ fullPath }} ',
@@ -92,15 +97,10 @@ export function RegisterRoutes(server: any) {
92
97
},
93
98
{{ /if }}
94
99
handler: {{ #if ../../iocModule }} async {{ /if }} function {{ ../name }} _{{ name }} (request: Request, h: ResponseToolkit) {
95
- const args: Record<string , TsoaRoute.ParameterSchema> = {
96
- {{ #each parameters }}
97
- {{ @key }} : {{{ json this }}} ,
98
- {{ /each }}
99
- };
100
100
101
101
let validatedArgs: any[] = [];
102
102
try {
103
- validatedArgs = templateService.getValidatedArgs({ args, request, h });
103
+ validatedArgs = templateService.getValidatedArgs({ args: args {{ ../name }} _ {{ name }} , request, h });
104
104
} catch (err) {
105
105
const error = err as any;
106
106
if (isBoom(error)) {
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