mapstruct / mapstruct-examples

Examples for using MapStruct
Other
1.29k stars 508 forks source link

Add example for Immutables+MapStruct #65

Open deepaks829 opened 5 years ago

deepaks829 commented 5 years ago

Would be nice to have an example that shows the usage of MapStruct with Immutables.

I was trying to use MapStruct with Immutables and couldn't find a comprehensive example or guide that could walk users through this set up. Would be nice to have this example.

I created a sample Spring REST service that uses MapStruct and Immutables to post my question on StackOverflow.

If you think this is a good addition, with some help and guidance I am willing to improve this to have it included as an example.

filiphr commented 5 years ago

Thanks for creating the issue @deepaks829. We already have some integration tests with immutables. However, it is always good to have an example in our repo :).

Your example is quite good. Would you be willing to reduce your example to only having the Source and Target POJOs plus the mapper? I think that if we exclude Spring and Jackson it would be a bit easier for people that are not familiar with them to see how it can be used with Immutables (I think Immutables is also used in the Android world 😄)