1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | export interface FastifySchema {
|
8 | body?: unknown;
|
9 | querystring?: unknown;
|
10 | params?: unknown;
|
11 | headers?: unknown;
|
12 | response?: unknown;
|
13 | }
|
14 |
|
15 | export interface FastifyRouteSchemaDef {
|
16 | schema: FastifySchema;
|
17 | method: string;
|
18 | url: string;
|
19 | httpPart?: string;
|
20 | httpStatus?: string;
|
21 | }
|
22 |
|
23 | export interface FastifyValidationResult {
|
24 | errors?: FastifySchemaValidationError[] | null;
|
25 | }
|
26 |
|
27 | export interface FastifySchemaValidationError {
|
28 | message?: string;
|
29 | dataPath: string;
|
30 | }
|
31 |
|
32 |
|
33 |
|
34 |
|
35 | export type FastifySchemaCompiler = (routeSchema: FastifyRouteSchemaDef) => FastifyValidationResult
|