Coder Social home page Coder Social logo

Comments (4)

filiphr avatar filiphr commented on June 25, 2024 1

From what I can see you have @Mapper which means that the default component model is used, which means that the generated mapper is not a Spring bean. In order for things to work properly with spring your mappers need to be spring beans as well. i.e. you need to use @Mapper(componentModel = "spring")

from mapstruct-spring-extensions.

Chessray avatar Chessray commented on June 25, 2024

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.

from mapstruct-spring-extensions.

marvk avatar marvk commented on June 25, 2024

@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 @Mapper is required to make the ConversionService pick up the generated converters. I don't know if this is an oversight or not, but I would kindly suggest describing that componentModel is required for this.

Thank you guys for the fast responses!

from mapstruct-spring-extensions.

Chessray avatar Chessray commented on June 25, 2024

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.

from mapstruct-spring-extensions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.