mapstruct-spring-extensions icon indicating copy to clipboard operation
mapstruct-spring-extensions copied to clipboard

Provide mechanism for adding annotations to generated code

Open Chessray opened this issue 1 year ago • 2 comments

In the spirit of the core's @AnnotateWith.

This would solve #3 as well.

Chessray avatar Nov 07 '23 18:11 Chessray

@Chessray just my 2 cents for this. You can already use @AnnotateWith, you don't need to use a new annotation in the project. You'll need to do similar work though to parse the annotation and get the data out of it

filiphr avatar Nov 13 '23 08:11 filiphr

I believe we can make use of the annotation only for one case at the moment. While the core is clear in generating one implementation per @Mapper annotation, the extension is primarily configuration based. There's no 1:1 relationship between annotated classes and generated elements. We can add it to the @DelegatingConverter points, but for the rest I'm looking at adding new attributes to the config annotation. I wouldn't be sure how to interpret an @AnnotateWith on the config class.

Chessray avatar Nov 13 '23 10:11 Chessray