-
Notifications
You must be signed in to change notification settings - Fork 799
OpenFeign interface endpoint - PathVariable annotation was empty on param 0. #863
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
Hello @eno-lc. It should, indeed, work and, as far as I can say, it does. Please see a sample branch that works without any issues. If you're still experiencing any issues with it, please provide a minimal, complete, verifiable example that reproduces the issue. |
Hi @OlgaMaciaszek, reaching out from a colleague device here. Having the same issue on a different machine as well, not sure why. I'll provide the link to a repository where you can check the following application/microservice as we get the following error:
See the following repository: https://github.com/avdi-vrellaku/microservices-issue-on-empty-param-PathVariable Clients package contains the |
Hello @avdi-vrellaku, will take a look. Please learn how to properly format code and logs. |
Hello @avdi-vrellaku @eno-lc - please provide a minimal sample, with only the modules and classes necessary to reproduce your issue. |
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue. |
I know this is old and closed. Just wanted to leave this here, to help anyone searching for this error. |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Please provide details of the problem, including the version of Spring Cloud that you
are using.
It is my first time facing this and it is kind of confusing. Every time where I have used
@PathVariable
, I just matched the/{parameter}
with the actual parameter on the method so I wouldn't have to do it like this@PathVariable("parameter") Integer parameter
, but instead I would do it like@PathVariable Integer parameter
for/{parameter}
, but when doing the same thing while using OpenFeign there was an error saying " PathVariable annotation was empty on param 0." which is not really true because I have annotated my parameter as a@PathVariable
.This fails and throws 'PathVariable annotation was empty on param 0.'
This works, correct me if I am wrong but when specifying the method parameter with the same name as the endpoint parameter, there is no need to specify the
@PathVariable("thisHere")
but I can just use@PathVariable Integer customerId
without using the parenthesis on the @PathVariable to specify a value.Not sure if it is a bug or just a confusion from my side but I just wanted to let you guys know and clarify it for my self as well. Have a great one guys :)
The text was updated successfully, but these errors were encountered: