@@ -10,6 +10,7 @@ import { ObjectSanitizer } from 'valsan/object-sanitizer';
1010import { BaseApiRoute } from './base' ;
1111import { validateRequest } from './validation-middleware' ;
1212import { BadRequestError , HTTPError , UnprocessableEntityError } from '../error' ;
13+ import { ArrayValSan , ObjectValSan } from 'valsan' ;
1314
1415export type ApiRequest = ExpressRequest ;
1516export type ApiResponse = ExpressResponse ;
@@ -33,23 +34,23 @@ export abstract class BaseApiEndpoint extends BaseApiRoute {
3334 public method : EndpointMethod = EndpointMethod . GET ;
3435 public statusCode : number = 200 ;
3536
36- public body ?: ObjectSanitizer ;
37+ public body ?: ObjectSanitizer | ObjectValSan ;
3738 // eslint-disable-next-line @typescript-eslint/no-explicit-any
3839 public bodyExample ?: any ;
3940
40- public query ?: ObjectSanitizer ;
41+ public query ?: ObjectSanitizer | ObjectValSan ;
4142 // eslint-disable-next-line @typescript-eslint/no-explicit-any
4243 public queryExample ?: any ;
4344
44- public params ?: ObjectSanitizer ;
45+ public params ?: ObjectSanitizer | ObjectValSan ;
4546 // eslint-disable-next-line @typescript-eslint/no-explicit-any
4647 public paramsExample ?: any ;
4748
48- public headers ?: ObjectSanitizer ;
49+ public headers ?: ObjectSanitizer | ObjectValSan ;
4950 // eslint-disable-next-line @typescript-eslint/no-explicit-any
5051 public headersExample ?: any ;
5152
52- public response ?: ObjectSanitizer ;
53+ public response ?: ObjectSanitizer | ObjectValSan | ArrayValSan ;
5354 // eslint-disable-next-line @typescript-eslint/no-explicit-any
5455 public responseExample ?: any ;
5556
0 commit comments