Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with introspectComments with @nestjs/swagger plugin #526

Open
4 of 9 tasks
RaviVadera opened this issue Dec 19, 2022 · 0 comments
Open
4 of 9 tasks
Labels
bug Something isn't working

Comments

@RaviVadera
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

AutoMapper transformer plugin @automapper/classes/transformer-plugin fails to map classes when

  • combined with @nestjs/swagger plugin
  • introspectComments set to true
  • doc comment defined on properties

Just removing doc comments from the property seems to work.

Models/DTOs/VMs

DTO

export default class PatchDto {
  /**
   * Software version
   * @example 0.1.0
   */
  @IsNotEmpty()
  @IsString()
  swVersion: string;
}

Model

export default class Patch {
  swVersion: string;
}

Mapping configuration

createMap(mapper, PatchDto, Patch);

Steps to reproduce

// console.log(patchModel); => Patch {}
const patchModel = await this.mapper.mapAsync(patchDto, PatchDto, Patch);

Expected behavior

The mapped object should have all properties.

Screenshots

No response

Minimum reproduction code

No response

Package

  • I don't know.
  • @automapper/core
  • @automapper/classes
  • @automapper/nestjs
  • @automapper/pojos
  • @automapper/mikro
  • @automapper/sequelize
  • Other (see below)

Other package and its version

No response

AutoMapper version

8.7.7

Additional context

Ubuntu
Node v16
Nest v9

@RaviVadera RaviVadera added the bug Something isn't working label Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant