Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with registering method parameter hints #1021

Closed
OlgaMaciaszek opened this issue Apr 11, 2024 · 3 comments
Closed

Issue with registering method parameter hints #1021

OlgaMaciaszek opened this issue Apr 11, 2024 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@OlgaMaciaszek
Copy link
Collaborator

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

@OlgaMaciaszek
Copy link
Collaborator Author

OlgaMaciaszek commented Apr 12, 2024

@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.

@OlgaMaciaszek OlgaMaciaszek changed the title feign.codec.EncodeException in native image Automatically add reflection hints for classes in OF method signatures Apr 12, 2024
@OlgaMaciaszek OlgaMaciaszek added enhancement New feature or request and removed in progress labels Apr 12, 2024
@OlgaMaciaszek OlgaMaciaszek added this to the 4.1.2 milestone Apr 12, 2024
@OlgaMaciaszek OlgaMaciaszek changed the title Automatically add reflection hints for classes in OF method signatures Issue with registering method parameter hints Apr 12, 2024
@OlgaMaciaszek OlgaMaciaszek added bug Something isn't working and removed enhancement New feature or request labels Apr 12, 2024
@OlgaMaciaszek
Copy link
Collaborator Author

This should actually work already as per 06192a5. Will need to verify why it doesn't work in the sample.

@OlgaMaciaszek
Copy link
Collaborator Author

OlgaMaciaszek commented Apr 12, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
Status: Done
Development

No branches or pull requests

1 participant