In the SpringEncoder, the parameter bodyType is ignored and not passed to the canWrite and write methods of the GenericHttpMessageConverter (here and here) which is important for them to determine whether or not they support and can write the requestBody.
This could be done similar to this.
BTW, as long as this problem exists, what is the alternative solution for GenericHttpMessageConverters to determine the actual Type of the requestBody for example when it is a ParameterizedType which cannot be determined from requestBody.getClass()?
Comment From: ryanjbaxter
Would you like to submit a PR to fix the problem?
Comment From: ahmadmo
@ryanjbaxter sure, in a few days.