在使用 FeignClient 如果参数没有给默认名字
@PathVariable("districtId") Long districtId

比如

@FeignClient("tool-service")
public interface DistrictClient {

    @GetMapping("/rpc/district/{districtId}")
    ResBody<DistrictFullDto> getFullPath(@PathVariable Long districtId);
}

会报错:

Feign PathVariable annotation was empty on param 0

只是jdk在编译后用arg0,arg1...代替了原来的参数
导致Feign没有找到参数
只需要开启保留参数设置即可
如图:
-parameters 参数的使用 解决 Feign PathVariable annotation was empty on param 0

注意: 要重新编译

相关文章:

  • 2021-09-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-22
  • 2021-10-12
  • 2022-12-23
  • 2021-12-01
猜你喜欢
  • 2022-03-05
  • 2022-12-23
  • 2022-12-23
  • 2021-06-16
  • 2021-10-04
  • 2022-12-23
  • 2021-09-02
相关资源
相似解决方案