-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Springcloud Netflix Feign Parameters order #1915
Comments
Order shouldn't matter. |
And does the fact of the @requestbody annotates a List<> matter? Maybe it's just a coincidence, but this is also the only place where I have a @requestbody annotating a List<>. I put this question in stackoverflow and someone there think that there's a limitation in using @requestbody with @PathVariable. Since I saw nothing about this in documentation, I decided to bring this question to github. |
I don't think so. Also, is this really a 'compilation error'? |
I'll check it again. |
Actually is during the application startup (I fixed the question above, thanks):
|
That's what I thought. I wonder why it thinks you have form parameters? What does the whole feign client look like? |
|
Ashamed of myself. I mistyped appID in @PathVariable. I had typed "appId". Sorry for taking your time because of this silly mistake. |
In my case this is not working:
But when I remove the REGEX it got working:
Is this a bug? |
EDIT: In the description bellow, it's not a compilation error. The error occurs during the startup process.
Is there any reason that explains why I get a compilation error (
Body parameters cannot be used with form parameters
) when declare a feign interface method like this:a)
foo(@PathVariable("pathVariableName") String pathVariable, @RequestBody List<String> anyVariable)
but everything works fine when I use this (switching the parameters order):
b)
foo(@RequestBody List<String> anyVariable, @PathVariable("pathVariableName") String pathVariable)
In the current project all other feign methods work just fine in the former form. I don't know if this information is important, but this is the only one in which I try to use a list annotated with
@RequestBody
parameter.Does the order of the parameters matters here like this answer? In this case, in which situations should I pay attention to the parameters order? Feign documentation seems to use it the way I experienced the problem.
By the way: I haven't tried to run the application yet, so I don't know how this will behave at runtime.
The text was updated successfully, but these errors were encountered: