I need to overwrite the content parser for application/json
so my application accepts empty body. Right now it throws:
{
"statusCode": 400,
"code": "FST_ERR_CTP_EMPTY_JSON_BODY",
"error": "Bad Request",
"message": "Body cannot be empty when content-type is set to 'application/json'"
}
I'm trying with:
import { FastifyAdapter, NestFastifyApplication } from '@nestjs/platform-fastify';
import { NestFactory } from '@nestjs/core';
const fastifyAdapter = new FastifyAdapter({
addContentTypeParser: // what should go here
});
const app = await NestFactory.create<NestFastifyApplication>(AppModule, fastifyAdapter);
but I can't figure out what is expected under addContentTypeParser