Coder Social home page Coder Social logo

Comments (5)

MicyToy avatar MicyToy commented on June 26, 2024 3

ConversionService also has this issue.

I fix it by configuring autowired in Spring config.

  @Autowired
    public void addFormatters(FormatterRegistry registry) {
        registry.addConverter(new CarMapperImpl());
    }

After doing like this, Spring can find mapping implementation.

from mapstruct-spring-extensions.

Chessray avatar Chessray commented on June 26, 2024 1

@marvk Please do not hijack this closed thread. Yes, the Mappers will be added to the ConversionService automatically in most cases. However, depending on your SpringBoot setup, this service might not be initialized in a standard fashion. The SpringBoot example project demonstrates one way to solve this in case e.g. spring-boot-starter-web isn't there.

from mapstruct-spring-extensions.

Chessray avatar Chessray commented on June 26, 2024

The idea is not to inject the generated adapter, but rather the ConversionService: https://mapstruct.org/documentation/spring-extensions/reference/html/#mapperAsConverter. Also, this is probably the same issue as #21 .

from mapstruct-spring-extensions.

marvk avatar marvk commented on June 26, 2024

We're trying to integrate mapstruct-spring-extensions into our project because it looked very promising. However, the solution suggested by @MicyToy isn't really satisfying in my opinion. I would expect the generated mappers to be added to, or else detected by, ConversionService automatically. Is this a configuration issue or are we really expected to register mappers by hand (for now)?

from mapstruct-spring-extensions.

marvk avatar marvk commented on June 26, 2024

@Chessray Sorry, I didn't want to open what I thought would be a duplicate. I'll have a look and if I can't get it to work, I'll open a new ticket. Cheers!

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.