Question · NestJS course · Module 11: Swagger and OpenAPI

Nested DTO in Swagger

How do you describe a nested DTO object in the @ApiProperty decorator?

Answer options

  • @ApiProperty({ nested: true })
  • @ApiProperty({ ref: 'AddressDto' })
  • @ApiProperty({ type: AddressDto })
  • @ApiProperty({ schema: AddressDto })

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