Is it possible?
const isNotValidated = <T>(req: NextApiRequest, res, schema: any): req.body is T => {}
NextApiRequest cannot be changed:
declare type NextApiRequest = IncomingMessage & {
/**
* Object of `query` values from url
*/
query: {
[key: string]: string | string[];
};
/**
* Object of `cookies` from header
*/
cookies: {
[key: string]: string;
};
body: any;
};