Feign PathVariable annotation was empty on param 0.

Feign PathVariable annotation was empty on param 0.
使用Feign的时候,如果参数中带有
@PathVariable形式的参数,则要用value=""标明对应的参数,否则会抛出IllegalStateException异常


@RequestMapping(value = “/dept/getById/{id}”, method = RequestMethod.GET)
public Dept getById(@PathVariable Long id); // wrong 错的

–>
@RequestMapping(value = “/dept/getById/{id}”, method = RequestMethod.GET)
public Dept getById(@PathVariable(value = “id”) Long id); // right 对的

©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页