File tree Expand file tree Collapse file tree
openapi-code-generator/src/typescript/server/typescript-koa
typescript-koa-runtime/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -99,12 +99,11 @@ export class KoaRouterBuilder extends AbstractRouterBuilder {
9999 operationId : builder . operationId ,
100100 statements : [
101101 `const ${ symbols . implPropName } = ${ responder . implementation } ` ,
102- `type ${ titleCase ( symbols . responderName ) } = typeof ${ symbols . implPropName } ['responder'] & KoaRuntimeResponder` ,
103102 buildExport ( {
104103 name : symbols . implTypeName ,
105104 value : `(
106105 params: ${ params . type } ,
107- respond: ${ titleCase ( symbols . responderName ) } ,
106+ respond: typeof ${ symbols . implPropName } ['responder'] ,
108107 ctx: RouterContext
109108 ) => Promise<KoaRuntimeResponse<unknown> | ${ [
110109 ...responseSchemas . specific . map (
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ function isValidStatusCode(status: unknown): status is StatusCode {
8787 return ! ( status < 100 || status > 599 )
8888}
8989
90- export const b = < T > ( fn : ( r : ResponderBuilder ) => T ) => {
90+ export const b = < T > ( fn : ( r : ResponderBuilder ) => T & KoaRuntimeResponder ) => {
9191 // biome-ignore lint/suspicious/noExplicitAny: <explanation>
9292 const responses : any [ ] = [ ]
9393 // biome-ignore lint/suspicious/noExplicitAny: <explanation>
You can’t perform that action at this time.
0 commit comments