I'm not familiar with MapStruct, but as far as I can tell, you would just inject the mapper into your controller and then call it in one of your controller actions. Something like this:
I think you have to set the
componentModel of your mappers to
"spring" for this to work.
A
word of warning. Automatic source code generation libraries are generally more trouble than they're worth. I can't speak for MapStruct, but Lombok is a huge pain.