-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add documentation/exception for required java compiler flag "parameters" #2337
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
Comments
Thanks for finding this. Open to pull requests to update our documentation. |
Do you mind if I take care of it? I think adding a clear message at the code level would be more helpful than updating the documentation in this case. And I actually spent quite a bit of time trying to figure this out myself, so I believe a better message would really help others avoid the same confusion. If you feel this approach isn't appropriate, I’m happy to update the documentation instead. |
- Added a helpful hint in the exception message when @param is missing a value and parameter name can't be resolved. - Added a unit test to cover this case. Files affected: - Contract.java - DefaultContractTest.java Fixes OpenFeign#2337
- Added a helpful hint in the exception message when @param is missing a value and parameter name can't be resolved. - Added a unit test to cover this case. Files affected: - Contract.java - DefaultContractTest.java Fixes OpenFeign#2337
- Added a helpful hint in the exception message when @param is missing a value and parameter name can't be resolved. - Added a unit test to cover this case. - The test is skipped if the code was compiled with the `-parameters` compiler flag. Files affected: - Contract.java - DefaultContractTest.java Fixes OpenFeign#2337
When using OpenFeign in the following way (no name attribute specified):
You may encounter the following exception:
... annotation was empty on param 0
This happens because
@Param long catalogId
is compiled as@Param long arg0
. OpenFeign will then fail to read the parameter name via reflection.To fix this, you need to pass the
parameters
flag to the Java compiler:After hours of research and debugging I have found this solution. Just now I found a little hint in your documentation:
(if the code was compiled with -parameters flag)
. I would like to see that more visible or even in the exception..The text was updated successfully, but these errors were encountered: