Question · NestJS course · Module 11: Swagger and OpenAPI

Optional Fields in DTO

Which decorator is used to mark optional fields in a DTO for Swagger?

Answer options

  • @ApiOptional()
  • @ApiNotRequired()
  • @ApiPropertyOptional()
  • @ApiNullable()

You can check the correct answer by solving this task in the CodeWorlds game.