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:
1) foo(@PathVariable("pathVariableName") String pathVariable,
@RequestBody List<String> anyVariable)
but everything works fine when I use this (switching the parameters order):
2) 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 have the problem.
By the way: I stopped my project for a few minutes to post this here, before trying to run the application, just after getting a successful compilation. I'm not really sure the second way above works fine at runtime. It's just passed by the compilation phase without errors.
EDIT: This is not really a compilation error. The error occurs during the startup process of the springboot application.