-
Notifications
You must be signed in to change notification settings - Fork 30
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
"No converter found capable of converting from type" in Spring Boot Starter Web project #40
Comments
From what I can see you have |
Hi, On top of what @filiphr already pointed out, the project is missing the central configuration which allows e.g. specifying the package name for the generated Adapter class. Without this, the Adapter would be generated into the default package which you typically don't want inside a SpringBoot project, because the component scan will miss it. |
@filiphr Yeah thanks, we found that out minutes before your comment! We just kinda followed the docs on this one and they're are ambiguous at best. The beginning of §3 very much reads like only Thank you guys for the fast responses! |
Thanks for the feedback. We'll consider it. :-) On another note: If all you want to do is register Mappers as converters, you don't need the extensions project. This is only required for more advanced use cases. |
Related to #22
We're trying to integrate mapstruct-spring-extensions into a project and hit a little bit of a roadblock.
I was under the impression that, when defining a mapper, extending
Converter
and adding a@Mapper
annotation would be enough forConversionService
to pick this mapper up automatically. However, this isn't happening in my Spring Boot project with Spring Boot Starter Web.This is how I defined a Mapper:
I've built an MCVE so that you can verify my test setup.
FooMapperImpl
is being generated as expected and so isConversionServiceAdapter
, and yet,ConversionService
fails to convert fromFoo
toFooDto
.Am I missing something here? Is there some configuration I need to do after all? I feel like I exhausted the available documentation on this issue. Thanks in advance!
edit: It doesn't seem to be a problem with Spring. I've just tested it, and Converters that aren't generated are detected automatically.
The text was updated successfully, but these errors were encountered: