for me the following thing worked. as in context of nest js docs, This works for both cases and you don't need to create seprate middleware for raw or json body
import * as bodyParser from 'body-parser';
const app = await NestFactory.create(AppModule, {
rawBody: true,
bodyParser: true,
});