title: Multipart form data body is empty using NestJS and Fastify
body: <p>We are migrating from <code>express</code> to <code>fastify</code> in our <code>nestJS</code> application. The <code>multipart form data</code>(json body not files) which were supported in post controllers are not working after migration. We have <code>typeorm</code>, <code>swagger</code> as well plugged in. Any help is appreciated. Please find below code,</p>
  <pre><code>async function bootstrap() {
    const { AppModule } = require('./app.module');
    const adapter = new FastifyAdapter({
      logger: true,
    });
  
    await adapter.register(fastifyMultipart, {
      limits: {
        fieldNameSize: 100, // Max field name size in bytes
        fieldSize: 1000000, // Max field value size in bytes
        fields: 10,         // Max number of non-file fields
        fileSize: 100,      // For multipart forms, the max file size
        files: 1,           // Max number of file fields
        headerPairs: 2000,   // Max number of header key=&gt;value pairs
      } 
    });
  
    const app = await NestFactory.create&lt;NestFastifyApplication&gt;(
      AppModule,
      adapter,
    );
    await app.init();
    app.useGlobalPipes(new ValidationPipe());
    app.use(multer({ dest: './public/uploads/' }).single('file'));
  
    const config = new DocumentBuilder()
      .setTitle('Test API')
      .setDescription('Test Identity management')
      .setVersion('1.0')
      .build();
    const document = SwaggerModule.createDocument(app, config);
    SwaggerModule.setup('testapi', app, document);
    await app.listen(process.env.PORT, '0.0.0.0');
  }
  </code></pre>
  <p>And the controller code is,</p>
  <pre><code>    @Post('/Test/V2')
      @ApiOperation({ description: 'test' })
      @ApiResponse({ status: 200 })
      public async Test(@Request() req, @Body() requestDto: RequestDto, @Response() response) {
  }
  </code></pre>
  <p>Library versions are below,</p>
  <pre><code>@nestjs/axios: &quot;0.0.3&quot;,
  @nestjs/common: &quot;^8.2.0&quot;,
  @nestjs/core: &quot;^8.2.0&quot;,
  @nestjs/jwt: &quot;^8.0.0&quot;,
  @nestjs/passport: &quot;^8.0.1&quot;,
  @nestjs/platform-express: &quot;^8.2.0&quot;,
  @nestjs/platform-fastify: &quot;^8.2.0&quot;,
  @nestjs/swagger: &quot;^5.1.4&quot;,
  @nestjs/testing: &quot;^8.2.0&quot;,
  @nestjs/typeorm&quot;: &quot;^8.0.2&quot;
  </code></pre>