One of the ways I can come up with is to write my own HandlerMethodArgumentResolver , which is responsible for translating the request into the argument values ββof the controller methods. You should be able to create a custom annotation that will point to Spring MVC that your argument handler of your custom handler will handle the specific arguments of the annotated method (say @CustomType Object argument
).
As soon as the call hits the handlerβs handler, you can probably determine the type that the json request should display and call json-mapper with the actual type.
You can register your own argument converter as follows:
<annotation-driven> <argument-resolvers> <beans:bean class="..CustomArgumentResolver"/> </argument-resolvers> </annotation-driven>
source share