GeezerVison is showing github.com — Improve error messages for auto generated mappings · Issue #2788 · mapstruct/mapstruct
Improve error messages for auto generated mappings #2788
Description
- Is this an issue (and hence not a question)?
The documentation of Mapper#disableSubMappingMethodsGeneration states that if one had to use it, the case should be reported, and here we go.
In our case we had a deeply nested hierarchy of types. For each of those types, a corresponding DTOs exists in another package, but these DTOs do not necessarily contain all of the fields of the source types. When working with the default setting of disableSubMappingMethodsGeneration == false, the error messages contain only the raw names of the unmapped source fields, but do not yield the information to which type each of the unmapped fields belongs. Hence turning off auto generation made it a lot easier to find the corresponding culprits. Maybe the error messages could be improved to something like Unmapped source property: typeA.typeB.foo.
Activity
filiphr commented on Apr 2, 2022
Thanks for raising this issue @afwlehmann. Do you have an example that would show this problem, I think it would be easier for us to work on a fix and provide a better error message for that.
changed the title
[-]Avoid using `disableSubMappingMethodsGeneration` by improving error messages[/-] [+]Improving error messages for auto generated mappings[/+] on Apr 2, 2022filiphr commented on Apr 2, 2022
I forgot to ask, how does the error look like now?
Zegveld commented on Nov 2, 2023

perhaps changing the unmapped source property error to be like the unmapped target property error would suffice.
Zegveld commented on Feb 5, 2024
I've got a situation where I need this fixed, because that would make life so much easier.
I hope that I'll be able to put out a PR somewhere this or next week.
added a commit that references this issue
on Feb 11, 2024#2788 Improve unmapped source properties message for forged methods
changed the title
[-]Improving error messages for auto generated mappings[/-] [+]Improve error messages for auto generated mappings[/+] on May 9, 2024
Metadata
Metadata
Development
No branches or pull requestsIssue actions