Currently the return type of koaBody() has been fixed to Koa.Middleware<{}, {}>, which will be problematic if we would like to provide a different type combo, e.g.:
koaBody<{ userId: string }, ContextT, { status: number }>()
this pr will fix this issue by providing generic type params:
since koaBody() will inject body and files into ctx.request directly, it'll be fine to just keep the same input type combo for the return middleware function.
Currently the return type of
koaBody()
has been fixed toKoa.Middleware<{}, {}>
, which will be problematic if we would like to provide a different type combo, e.g.:this pr will fix this issue by providing generic type params:
since
koaBody()
will injectbody
andfiles
intoctx.request
directly, it'll be fine to just keep the same input type combo for the return middleware function.