Multiple interceptors on the same @Maps
cbeaujoin opened this issue · 2 comments
Hello,
When I try to add multiple interceptors on the same Maps it only generate the code for the last element of the Array.
@Maps(withCustom = {MediaInterceptorA.class, MediaInterceptorB.class})
MediaJson asMediaJson(Media in);
The generated interceptor will be MediaInterceptorB.
It's not a problem because I just have to concatenate the two interceptors in one class but it remains ambiguous.
Version 1.0
Hi,
this is normal since Selma only allows one interceptor per type to type or field and type to field and type mapping.
If you have two interceptors with different signature, in the two custom classes, they will be handled correctly. But you can not have multiple interceptors for the same signature.
By default Selma will retain the last interceptor it finds.
So this should be clearly stated in documentation your right. Or else we can work on allowing multiple interceptors for the same mapping (but I don't really see why we would need this).
Hello,
I agree that improve the documentation is the right way.
Regards,