Sadly enough, you’re not able to provide parameterized response types, @ounirayen.
It’s something we have on the backlog to work on.
You can find the issue here, by the way.
The intent is to investigate how feasible it is to provide this feature in 4.8.0 of Axon Framework (as you can see from the milestone attached to the issue).
So, for now, you’re best solution is to wrap the response in a local query response object.
Something that Axon’s Serializer can deal with, but more importantly, that works for the provided ResponseType implementations.
Concluding, sorry to bring you sad news here, @ounirayen.
I hope the workaround is something you can deal with for now.