GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Improve error messages for auto generated mappings · Issue #2788 · mapstruct/mapstruct

Improve error messages for auto generated mappings #2788

New issue
Copy link
New issue
Copy link
Closed
#3522
Closed
Improve error messages for auto generated mappings#2788
#3522
Copy link
Assignees
Zegveld
Labels
enhancement
Milestone
1.6.0.Beta2

Description

@afwlehmann
afwlehmann
opened on Mar 17, 2022
Issue body actions
  • 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.

Reacted by wirekang

Activity

  1. filiphr commented on Apr 2, 2022

    @filiphr
    filiphr
    on Apr 2, 2022
    Member
    More actions

    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.

  2. filiphr
    changed the title [-]Avoid using `disableSubMappingMethodsGeneration` by improving error messages[/-] [+]Improving error messages for auto generated mappings[/+] on Apr 2, 2022
  3. filiphr commented on Apr 2, 2022

    @filiphr
    filiphr
    on Apr 2, 2022
    Member
    More actions

    I forgot to ask, how does the error look like now?

  4. Zegveld commented on Nov 2, 2023

    @Zegveld
    Zegveld
    on Nov 2, 2023
    Contributor
    More actions

    image
    perhaps changing the unmapped source property error to be like the unmapped target property error would suffice.

  5. Zegveld
    self-assigned this
    on Feb 5, 2024
  6. Zegveld commented on Feb 5, 2024

    @Zegveld
    Zegveld
    on Feb 5, 2024
    Contributor
    More actions

    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.

  7. Zegveld
    added 6 commits that reference this issue on Feb 8, 2024

    mapstruct#2788 unmapped source properties for forgedMethods now conta…

    a6106d1

    mapstruct#2788 Removed incorrect test location.

    31045a0

    mapstruct#2788 introduced tests at DottedErrorMessageTest. (1/2 due t…

    b05359e

    mapstruct#2788 introduced tests at DottedErrorMessageTest. (2/2 due t…

    41110bb

    mapstruct#2788 fixed line length and UnmappableTarget's still assume …

    efa7d79

    mapstruct#2788 added issuekey annotations

    394cb01
  8. filiphr
    added this to the 1.6.0.Beta2 milestone on Feb 11, 2024
  9. filiphr
    added a commit that references this issue on Feb 11, 2024

    #2788 Improve unmapped source properties message for forged methods

    bb1cd63
  10. filiphr
    closed this as completedin #3522on Feb 11, 2024
  11. filiphr
    added
    enhancement
    on May 9, 2024
  12. filiphr
    changed the title [-]Improving error messages for auto generated mappings[/-] [+]Improve error messages for auto generated mappings[/+] on May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @Zegveld
    Zegveld

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    • 1.6.0.Beta2

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.