Fix #1509: Discover existing mappers instead of providing 'Mapper.uses' class array by UtkarshSinghChauhan · Pull Request #4040 · mapstruct/mapstruct · GitHub
Skip to content

Fix #1509: Discover existing mappers instead of providing 'Mapper.uses' class array#4040

Open
UtkarshSinghChauhan wants to merge 1 commit intomapstruct:mainfrom
UtkarshSinghChauhan:fix/bughunter-issue-1509
Open

Fix #1509: Discover existing mappers instead of providing 'Mapper.uses' class array#4040
UtkarshSinghChauhan wants to merge 1 commit intomapstruct:mainfrom
UtkarshSinghChauhan:fix/bughunter-issue-1509

Conversation

@UtkarshSinghChauhan
Copy link
Copy Markdown

This PR fixes issue #1509 by introducing a new attribute 'usesPackage' in the 'Mapper' annotation, which allows users to specify a package where MapStruct can discover existing mappers. The library will then scan the specified package and its sub-packages for classes annotated with 'Mapper' and use them as mappers.

The fix includes a new test case to verify that MapStruct can discover and use existing mappers in the specified package.

Fixes #1509

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.

IMPROVEMENT: Discover existing mappers instead of providing "Mapper.uses" class array

1 participant