Skip to content

Commit a8040d5

Browse files
kobikidanto
authored andcommitted
fix:koa middleware definition (#87)
* add Koa middleware definition * fix typings * Use any as type for context, req and res * Revert changes * Revert changes
1 parent af69e3c commit a8040d5

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

types/index.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ export function init(swaggerPath: string, options?: ajvValidatorOptions): void;
1212
* Middleware that validates the request against the swagger
1313
* file, according to the request method and route
1414
*/
15-
export function validate(req: object, res: object, next: Function): void;
15+
declare function validate(ctx: any, next: Function): void; // koa
16+
declare function validate(req: any, res: any, next: Function): void; // express
17+
export { validate };
1618

1719
export class InputValidationError extends Error {
1820
errors: Array<ErrorDetails | string>;

0 commit comments

Comments
 (0)