mapstruct-idea
mapstruct-idea copied to clipboard
An IntelliJ IDEA plugin for working with MapStruct
See https://github.com/mapstruct/mapstruct-idea/issues/245
Example mapper: ``` @Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE, componentModel = MappingConstants.ComponentModel.SPRING) public interface OrderMapper { OrderGetAllDto toOrderDto(Order order); default R mapFromAggregateReference(AggregateReference aggregateReference) { if (aggregateReference == null) { return null; } return...
For [Map to Bean](https://mapstruct.org/documentation/stable/reference/html/#mapping-map-to-bean) mappings like ```java @Mapping(source = "exDate", target = "exDate", dateFormat = "yyyy-MM-dd") @Mapping(source = "payDate", target = "payDate", dateFormat = "yyyy-MM-dd") @Mapping(source = "recordDate", target =...
I think it should not show warning in unit test code with no component scan. ``` @InjectMocks private JobService jobService; @Spy JobEntityMapper jobEntityMapper = Mappers.getMapper(JobEntityMapper.class); ```
With MapStruct 1.7.0 it is possible to provide ignored arguments with the new annotation `@Ignored`: * https://github.com/mapstruct/mapstruct/issues/1958 The `UnmappedTargetPropertiesInspection` needs to consider them, else we would get false warnings. This...
Referencing a target that does not exist results in a compilation error. Therefore we should support the check of target properties (`MapstructTargetReference`) for that annotation. ```java interface FooMapper { @Ignored(targets...
If you have such data class: ```kotlin @JvmRecord data class Service( val serviceId: Long, } ``` and such java record: ```java record Service2( long serviceId ) {} ``` and use...
Reading [IDEA-368383](https://youtrack.jetbrains.com/issue/IDEA-368383/Create-a-new-extension-point-to-register-error-highlighting-fixes) it looks like we could do something for the errors that MapStruct is creating during annotation processing. This issue is open in order to analyze that.
[reopen]Redundant default parameter value assignment warning shouldn't appear if target is a string
Hi, with mapstruct-1.5.5.Final.jar and IntelliJ IDEA 2024.3.2 (Ultimate Edition), I am facing the same issue as #93 [https://github.com/mapstruct/mapstruct-idea/issues/93](url) ` @Mapping(target = "myFied", constant = "") ` ` Type2 toType2(final Type1...