Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[#3837] Add warning/error for redundant ignoreUnmappedSourceProperties entries#3906

Merged
filiphr merged 4 commits into
mapstruct:mainmapstruct/mapstruct:mainfrom
codeswithritesh:mainCopy head branch name to clipboard
Aug 24, 2025
Merged

[#3837] Add warning/error for redundant ignoreUnmappedSourceProperties entries#3906
filiphr merged 4 commits into
mapstruct:mainmapstruct/mapstruct:mainfrom
codeswithritesh:mainCopy head branch name to clipboard

Conversation

@codeswithritesh

@codeswithritesh codeswithritesh commented Jul 27, 2025

Copy link
Copy Markdown
Contributor

Enhancement: warn when mapped properties are listed in ignoreUnmappedSourceProperties (#3837)

…roperties are actually mapped.

Respects unmappedSourcePolicy and includes tests for redundant and valid ignore cases.
@gnuemacscoin

Copy link
Copy Markdown

Looks good, though the message grammar is a little off. I would rephrase it as "Source %s is mapped despite being listed in ignoreUnknownSourceProperties." or "Source %s is being mapped despite appearing in ignoreUnknownSourceProperties.".

…ion message. Updated the validation message to use clearer and more grammatically correct phrasing, e.g., "Source property 'email' is mapped despite being listed in ignoreUnmappedSourceProperties."
@codeswithritesh

codeswithritesh commented Aug 1, 2025

Copy link
Copy Markdown
Contributor Author

Thanks for the suggestion, gnuemacscoin! I have updated the validation messages as recommended.

Below are example warning/error messages generated by MapStruct using the format:
"Source %s mapped despite being listed in ignoreUnmappedSourceProperties."

• For a single source property:
"Source property 'email' is mapped despite being listed in ignoreUnmappedSourceProperties."

• For multiple source properties:
"Source properties 'email', 'username' are mapped despite being listed in ignoreUnmappedSourceProperties."

Let me know if you'd prefer a different phrasing.

@filiphr When you have a moment, could you please take a look at this PR? Your feedback would be appreciated.

@filiphr filiphr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The approach looks OK @codeswithritesh. I've left one comment that should be addressed before merging this, we should not need changes in the fullFeaturesTest/pom.xml. We should instead use Erroneous in the name of the mappers, that are producing compile errors, in our tests

Comment thread integrationtest/src/test/resources/fullFeatureTest/pom.xml Outdated
@codeswithritesh

Copy link
Copy Markdown
Contributor Author

Thank you, @filiphr!
Glad to hear the changes look good, and great to see the CI checks have passed.
Let me know if there’s anything else you'd like me to update. Otherwise, I’ll wait for you to proceed with the merge — looking forward to it! 🙂

@codeswithritesh
codeswithritesh requested a review from filiphr August 8, 2025 14:15
@filiphr
filiphr merged commit fe43563 into mapstruct:main Aug 24, 2025
4 checks passed
@filiphr

filiphr commented Aug 24, 2025

Copy link
Copy Markdown
Member

Thanks @codeswithritesh, I've merged this

@codeswithritesh

Copy link
Copy Markdown
Contributor Author

Thank you @filiphr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Report properties in ignoreUnmappedSourceProperties that actually do get mapped

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.