Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@DecoratedWith is not work with mapstruct-spring-extensions #116

Open
Cloud-Lego opened this issue Oct 2, 2024 · 6 comments
Open

@DecoratedWith is not work with mapstruct-spring-extensions #116

Cloud-Lego opened this issue Oct 2, 2024 · 6 comments

Comments

@Cloud-Lego
Copy link

I try to user mapstruct-spring-extensions to optimize my mapper,but find @DecoratedWith(xxxDecorator.class) is not work when user ConversionService.conver(object,xxx.class),this is a bug or I use is wrong way?

@Chessray
Copy link
Collaborator

Chessray commented Oct 2, 2024

Could you please provide an example project of what you're asking? What do you mean when you say the annotation doesn't work?

Generally speaking, some of MapStruct's advanced features such as @DecoratdWith clash with Spring's ConversionService. There are definitely cases where you want to avoid following the Converter pattern. This might be one.

@Cloud-Lego
Copy link
Author

Cloud-Lego commented Oct 3, 2024 via email

@Chessray
Copy link
Collaborator

Chessray commented Oct 3, 2024

just see the attachment,this is a spring boot applicaiton, UserMapper is declared as a converter with @DecoratdWith class,when I use ConversionService to mapping,this class is not work.

Sorry, there's no attachment.

@Cloud-Lego
Copy link
Author

Cloud-Lego commented Oct 3, 2024 via email

@Chessray
Copy link
Collaborator

Chessray commented Oct 3, 2024

Sorry, it looks like GitHub removes everything such as links and attachments from your emails. Could you please respond in the issue thread?

@Cloud-Lego
Copy link
Author

demo1.zip
image
image

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

No branches or pull requests

2 participants