spring-cloud-openfeign
spring-cloud-openfeign copied to clipboard
IllegalStateException when path variable is specified in @FeignClient path
trafficstars
Describe the bug Got the following error while starting the app:
Unexpected exception during bean creation; nested exception is java.lang.IllegalStateException: Body parameters cannot be used with form parameters.
Warnings:
-
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800)
org.springframework.cloud:spring-cloud-starter-openfeign:3.1.1
@FeignClient(name = "foo-service", path = "/user/{userId}")
public interface FooService {
@RequestMapping(value = "/foo", method = RequestMethod.POST)
void doFoo(@PathVariable Long userId, @RequestBody User user);
}
Works fine if there is no @RequestBody in the method.