Issue with registering method parameter hints
OlgaMaciaszek opened this issue · 3 comments
Initially reported in #860 (comment).
Calling client generated with the sample: https://github.com/CodeQualIT/CQITFunctions, causes feign.codec.EncodeException: Could not write request: no suitable HttpMessageConverter found for request type [nl.cqit.function.poc.java.helloworld.api.model.Person] and content type [application/json]
.
Possibly related to class generation.
CC @CC007
@CC007 You need to add @RegisterReflectionForBinding(nl.cqit.function.poc.java.helloworld.api.model.Person.class)
and not for nl.cqit.function.poc.java.boxedhello.api.model.Person.class
as in the sample, since it's the former that is in the OF client method signature. After changing it, the sample works correctly.
This is a simple and fast workaround for the issue, however, I will also take a look at registering reflection hints for classes used in OF method signatures automatically.
This should actually work already as per 06192a5. Will need to verify why it doesn't work in the sample.
Given that we can reasonably assume that any method defined in either a @FeignClient interface or a supertype interface is supposed to be part of the API, we should register all such methods for reflection and not only the ones declared for the annotated interface. That will fix the issue.