mapstruct-idea icon indicating copy to clipboard operation
mapstruct-idea copied to clipboard

MapStruct plugin does not support kotlin's data classes annotated with `@JvmRecord`

Open maratik123 opened this issue 8 months ago • 1 comments

If you have such data class:

@JvmRecord
data class Service(
    val serviceId: Long,
}

and such java record:

record Service2(
  long serviceId
) {}

and use them in mapping:

@Mapper
interface ServiceMapper {
  Service2 fromService(Service service);
}

Then plugin will false warn about absent target mapping, but MapStruct itself works well.

maratik123 avatar Jun 11 '25 11:06 maratik123

Thanks for reporting this @maratik123. We need to improve the kotlin support in the plugin a bit

filiphr avatar Jun 14 '25 21:06 filiphr