Skip to content

Cannot use ImplicitCollectionMappingTransformer with DSL?  #21

Description

@victormikhailov77

Hello!
I need to map machine-generated DTOs to object model, and I cannot annotate them , so im trying to convert previously annotation-based code to Kotlin DSL. While this is working fine for singluar fields, I cannot use this approach for collections - it shows compilation error.

example:

val mapper = mapper<FilterDto, Filter> {
     autoMap(AutoMappingStrategy.BY_NAME)
          FilterDto::targetTransformations mappedTo Filter::targetTransformations withTransformer ImplicitCollectionMappingTransformer::class. 
          FilterDto::valueTransformations mappedTo Filter::valueTransformations withTransformer ImplicitCollectionMappingTransformer::class
}    

which gives me compilation error "None of the following functions can be called with the arguments supplied:" on withTransformer usage.

Previous (annotation based) version was like this:

@MappedField(transformer = ImplicitCollectionMappingTransformer::class) val targetTransformations: List<TransformationDto>? = emptyList(),

What is correct usage of DSL-based version of ImplicitCollectionMappingTransformer ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions