lukeautry / tsoa

Build OpenAPI-compliant REST APIs using TypeScript and Node
MIT License
3.56k stars 499 forks source link

Incorrect variable name in koa.hbs #863

Closed mdoi2 closed 3 years ago

mdoi2 commented 3 years ago

Sorting

Issue

https://github.com/lukeautry/tsoa/blob/36c2a081d964c7e3389d9c4cda7f60dd3ae739cb/packages/cli/src/routeGeneration/templates/koa.hbs#L79

It ’s a very small problem, but ... There is no variable named request on this Koa template. After modifying request tocontext.request, it worked fine.


// const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(request) : iocContainer;
const container: IocContainer = typeof iocContainer === 'function' ? (iocContainer as IocContainerFactory)(context.request) : iocContainer;
WoH commented 3 years ago

Feel free to submit this fix as a PR