Skip to content

Commit dd476d9

Browse files
manorlhmanorll
andauthored
support multiple instances of the validator for multiple yaml files (#149)
Co-authored-by: manorlahagani <[email protected]>
1 parent 4b54d90 commit dd476d9

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
### Improvements
44
- Update dependencies to address security vulnerabilities
55

6+
# 3.2.1 - 9 December, 2020
7+
8+
### Fixes
9+
10+
- Add getNewMiddleware to index.d.ts #149
11+
612
# 3.2.0 - 26 November, 2020
713

814
### Features

types/index.d.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,23 @@ export interface inputValidationOptions {
7373
beautifyErrors?: boolean;
7474
firstError?: boolean;
7575
}
76+
77+
declare class MiddlewareClass {
78+
InputValidationError: InputValidationError;
79+
80+
init(schemaPath: string, options?: ajvValidatorOptions): void;
81+
// eslint-disable-next-line no-dupe-class-members
82+
init(jsonSchema: Record<string, any>, options?: ajvValidatorOptions): void;
83+
initAsync(schemaPath: string, options?: ajvValidatorOptions): Promise<void>;
84+
// eslint-disable-next-line no-dupe-class-members
85+
initAsync(jsonSchema: Record<string, any>, options?: ajvValidatorOptions): Promise<void>;
86+
87+
validate(ctx: Object, next: Function): void; // koa
88+
// eslint-disable-next-line no-dupe-class-members
89+
validate(req: Object, res: Object, next: Function): void; // express
90+
// eslint-disable-next-line no-dupe-class-members
91+
validate(options: FastifyPluginOptions): any; // fastify
92+
}
93+
94+
declare function getNewMiddleware(schemaPath: string, options?: ajvValidatorOptions): MiddlewareClass;
95+
export { getNewMiddleware };

0 commit comments

Comments
 (0)